From d6c233fce67104c1c4da802eb695526e60058536 Mon Sep 17 00:00:00 2001 From: Xiaoyu Yao Date: Wed, 3 Apr 2019 11:53:51 -0700 Subject: [PATCH] HDDS-1377. OM failed to start with incorrect hostname set as ip address in CSR. (#683) --- .../main/java/org/apache/hadoop/ozone/om/OzoneManager.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java index 6f81b105911..b8da717a043 100644 --- a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java +++ b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java @@ -1382,6 +1382,7 @@ public final class OzoneManager extends ServiceRuntimeInfoImpl } // Get host name. String hostname = omRpcAdd.getAddress().getHostName(); + String ip = omRpcAdd.getAddress().getHostAddress(); String subject = UserGroupInformation.getCurrentUser() .getShortUserName() + "@" + hostname; @@ -1392,16 +1393,16 @@ public final class OzoneManager extends ServiceRuntimeInfoImpl .setScmID(omStore.getScmId()) .setClusterID(omStore.getClusterID()) .setSubject(subject) - .addIpAddress(hostname); + .addIpAddress(ip); LOG.info("Creating csr for OM->dns:{},ip:{},scmId:{},clusterId:{}," + - "subject:{}", hostname, omRpcAdd.getAddress().getHostAddress(), + "subject:{}", hostname, ip, omStore.getScmId(), omStore.getClusterID(), subject); HddsProtos.OzoneManagerDetailsProto.Builder omDetailsProtoBuilder = HddsProtos.OzoneManagerDetailsProto.newBuilder() .setHostName(omRpcAdd.getHostName()) - .setIpAddress(hostname) + .setIpAddress(ip) .setUuid(omStore.getOmId()) .addPorts(HddsProtos.Port.newBuilder() .setName(RPC_PORT)