change localport to databaseport+1

This commit is contained in:
Racardo.Cui
2021-03-30 11:10:06 +08:00
parent c61f87e34a
commit a5e66dfbb4

View File

@ -1085,7 +1085,7 @@ class dbNodeInfo():
elif (instRole == INSTANCE_ROLE_DATANODE):
dbInst.port = self.__assignNewInstancePort(self.datanodes,
instRole, instanceType)
dbInst.haPort = dbInst.port + 6
dbInst.haPort = dbInst.port + 1
dbInst.ssdDir = ssddir
dbInst.syncNum = syncNum
self.datanodes.append(dbInst)
@ -3428,7 +3428,6 @@ class dbClusterInfo():
input : []
output : NA
"""
# port range from +1 to +7, here define haPort = dataportBase + 6
for dbNode in self.dbNodes:
i = 0
for dbInst in dbNode.datanodes:
@ -3436,11 +3435,11 @@ class dbClusterInfo():
dbInst.port = dbNode.masterBasePorts[
INSTANCE_ROLE_DATANODE] + i * \
PORT_STEP_SIZE
dbInst.haPort = dbInst.port + 6
dbInst.haPort = dbInst.port + 1
peerInsts = self.__getPeerInstance(dbInst)
for j in range(len(peerInsts)):
peerInsts[j].port = dbInst.port
peerInsts[j].haPort = peerInsts[j].port + 6
peerInsts[j].haPort = peerInsts[j].port + 1
i += 1
# flush CMSERVER instance port
i = 0