timmylicheng commented on a change in pull request #1428:
URL: https://github.com/apache/hadoop-ozone/pull/1428#discussion_r495538313



##########
File path: 
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/ha/SCMRatisServerImpl.java
##########
@@ -59,18 +68,62 @@
   SCMRatisServerImpl(final SCMHAConfiguration haConf,
                      final ConfigurationSource conf)
       throws IOException {
-    final String scmServiceId = "SCM-HA-Service";
-    final String scmNodeId = "localhost";
-    this.raftPeerId = RaftPeerId.getRaftPeerId(scmNodeId);
+    // If the SCM group starts from OZONE_SCM_NAMES, its raft peers
+    // should locate on different nodes, and use the same port to
+    // communicate with each other.
+    //
+    // Assume ozone.scm.names is "ip0,ip1,ip2", scm with ip0 identifies
+    // its RaftPeerId as scm0, scm with ip1 identifies its RaftPeerId
+    // as scm1, scm with ip2 identifies its RaftPeerId as scm2. After
+    // startup, they will communicate with each other via
+    // ozone.scm.ha.ratis.bind.port, and form a raft group with
+    // groupID "SCM-HA-Service".
+    List<String> scmHosts =
+        Arrays.stream(conf.getTrimmedStrings(ScmConfigKeys.OZONE_SCM_NAMES))
+            .map(scmName -> HddsUtils.getHostName(scmName).get())
+            .collect(Collectors.toList());
+
     this.address = haConf.getRatisBindAddress();
-    final RaftPeer localRaftPeer = new RaftPeer(raftPeerId, address);
+    InetAddress localHost = InetAddress.getLocalHost();
+
+    int selfIndex = -1;

Review comment:
       Could we move this self validation to an overall IP validation method so 
that we could throw in more validation once we are getting close to the 
ultimate HA config version?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: ozone-issues-h...@hadoop.apache.org

Reply via email to