HDDS-1377. OM failed to start with incorrect hostname set as ip address in CSR. (#683)
This commit is contained in:
parent
be488b6070
commit
d6c233fce6
@ -1382,6 +1382,7 @@ private static void getSCMSignedCert(CertificateClient client,
|
|||||||
}
|
}
|
||||||
// Get host name.
|
// Get host name.
|
||||||
String hostname = omRpcAdd.getAddress().getHostName();
|
String hostname = omRpcAdd.getAddress().getHostName();
|
||||||
|
String ip = omRpcAdd.getAddress().getHostAddress();
|
||||||
|
|
||||||
String subject = UserGroupInformation.getCurrentUser()
|
String subject = UserGroupInformation.getCurrentUser()
|
||||||
.getShortUserName() + "@" + hostname;
|
.getShortUserName() + "@" + hostname;
|
||||||
@ -1392,16 +1393,16 @@ private static void getSCMSignedCert(CertificateClient client,
|
|||||||
.setScmID(omStore.getScmId())
|
.setScmID(omStore.getScmId())
|
||||||
.setClusterID(omStore.getClusterID())
|
.setClusterID(omStore.getClusterID())
|
||||||
.setSubject(subject)
|
.setSubject(subject)
|
||||||
.addIpAddress(hostname);
|
.addIpAddress(ip);
|
||||||
|
|
||||||
LOG.info("Creating csr for OM->dns:{},ip:{},scmId:{},clusterId:{}," +
|
LOG.info("Creating csr for OM->dns:{},ip:{},scmId:{},clusterId:{}," +
|
||||||
"subject:{}", hostname, omRpcAdd.getAddress().getHostAddress(),
|
"subject:{}", hostname, ip,
|
||||||
omStore.getScmId(), omStore.getClusterID(), subject);
|
omStore.getScmId(), omStore.getClusterID(), subject);
|
||||||
|
|
||||||
HddsProtos.OzoneManagerDetailsProto.Builder omDetailsProtoBuilder =
|
HddsProtos.OzoneManagerDetailsProto.Builder omDetailsProtoBuilder =
|
||||||
HddsProtos.OzoneManagerDetailsProto.newBuilder()
|
HddsProtos.OzoneManagerDetailsProto.newBuilder()
|
||||||
.setHostName(omRpcAdd.getHostName())
|
.setHostName(omRpcAdd.getHostName())
|
||||||
.setIpAddress(hostname)
|
.setIpAddress(ip)
|
||||||
.setUuid(omStore.getOmId())
|
.setUuid(omStore.getOmId())
|
||||||
.addPorts(HddsProtos.Port.newBuilder()
|
.addPorts(HddsProtos.Port.newBuilder()
|
||||||
.setName(RPC_PORT)
|
.setName(RPC_PORT)
|
||||||
|
Loading…
Reference in New Issue
Block a user