Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HDDS-6453. Ozone start/stop script cannot resolve OM nodes in HA #3366

Closed
wants to merge 5 commits into from

Conversation

MLikeWater
Copy link
Contributor

@MLikeWater MLikeWater commented Apr 29, 2022

What changes were proposed in this pull request?

Fix the problem that the Ozone start and stop script resolve OM node, and ensure that the start-ozone.sh and stop-ozone.sh command is used to manage the start and stop services of the Ozone cluster.

What is the link to the Apache JIRA

HDDS-6453

How was this patch tested?

  1. configure password-free login between Ozone cluster nodes
  2. start the Ozone service on an Ozone node
start-ozone.sh
  1. stop the Ozone service on an Ozone node
stop-ozone.sh

@@ -82,7 +82,8 @@ OZONE_JUMBO_RETCOUNTER=$?

#---------------------------------------------------------
# Ozone ozonemanager nodes
OM_NODES=$("${OZONE_HOME}/bin/ozone" getconf -ozonemanagers 2>/dev/null)
TMP_OM_NODES=$("${OZONE_HOME}/bin/ozone" getconf -ozonemanagers 2>/dev/null)
OM_NODES=`echo $TMP_OM_NODES | grep -o '\([0-9]\{1,3\}\.\)\{3\}[0-9]\{1,3\}' | sort -d | uniq`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a comment for what the intent of this line is.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, thanks for the tip.

Copy link
Contributor

@adoroszlai adoroszlai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see my comment on the Jira.

@adoroszlai adoroszlai changed the title HDDS-6453. Fix Ozone start/stop script resolve OM nodes HDDS-6453. Ozone start/stop script cannot resolve OM nodes in HA Apr 29, 2022
@MLikeWater
Copy link
Contributor Author

@adoroszlai Obtain OM nodes list by using the command ozone getconf -ozonemanagers.
Please review.

Copy link
Contributor

@adoroszlai adoroszlai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @MLikeWater for the patch and sorry for the delay in review.

TestGetConfOptions is failing and needs to be updated.

@@ -113,9 +113,10 @@ public static InetSocketAddress getOmAddress(ConfigurationSource conf) {
* @param conf {@link ConfigurationSource}
* @return {service.id -> [{@link InetSocketAddress}]}
*/
public static Map<String, List<InetSocketAddress>> getOmHAAddressesById(
public static Collection<InetSocketAddress> getOmHAAddressesById(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We would like to add structured output later (item 3 from the Jira issue). So please keep getOmHAAddressesById() (and testGetOmHAAddressesById()) unchanged, and add a new method that flattens the map to a list.

One way to implement that, but you can also use loops:

  public static Collection<InetSocketAddress> getOmAddresses(
      ConfigurationSource conf) {
    return getOmHAAddressesById(conf).values().stream()
        .flatMap(Collection::stream)
        .collect(toList());
  }

This should be called from OzoneManagersCommandHandler, and a new test method in TestOmUtils.

@adoroszlai
Copy link
Contributor

/pending

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Marking this issue as un-mergeable as requested.

Please use /ready comment when it's resolved.

Please note that the PR will be closed after 21 days of inactivity from now. (But can be re-opened anytime later...)

/pending

@github-actions
Copy link

Thank you very much for the patch. I am closing this PR temporarily as there was no activity recently and it is waiting for response from its author.

It doesn't mean that this PR is not important or ignored: feel free to reopen the PR at any time.

It only means that attention of committers is not required. We prefer to keep the review queue clean. This ensures PRs in need of review are more visible, which results in faster feedback for all PRs.

If you need ANY help to finish this PR, please contact the community on the mailing list or the slack channel."

@github-actions github-actions bot closed this Dec 29, 2022
@kerneltime
Copy link
Contributor

@MLikeWater do you plan to revisit this PR and address pending review comments?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants