add logic about read uwal_config from xml

This commit is contained in:
whytao
2023-12-26 14:08:03 +08:00
parent 73f0ca11cb
commit 94a981e0ce
4 changed files with 107 additions and 0 deletions

View File

@ -45,6 +45,9 @@ STANDBY_INSTANCE = 1
DUMMY_STANDBY_INSTANCE = 2
CASCADE_STANDBY_INSTANCE = 3
# uwal num
BASE_ID_GTM = 1001
BASE_ID_DATANODE = 6001
class DN_OLAP(Kernel):
'''
@ -241,6 +244,11 @@ class DN_OLAP(Kernel):
tmp_dn_dict["enable_data_replicate"] = "off"
tmp_dn_dict["replication_type"] = "1"
tmp_dn_dict["max_wal_senders"] = "16"
if self.instInfo.uwal_ip != "":
uwal_id = int(self.instInfo.instanceId) - BASE_ID_DATANODE
uwal_ip = self.instInfo.uwal_ip
uwal_port = self.instInfo.port + BASE_ID_GTM
tmp_dn_dict["uwal_config"] = "'{\\\"uwal_nodeid\\\": %d, \\\"uwal_ip\\\": \\\"%s\\\", \\\"uwal_port\\\": %d}'" % (uwal_id, uwal_ip, uwal_port)
totalnum = len(peerInsts)
for inst in peerInsts:
if inst.instanceType == CASCADE_STANDBY_INSTANCE: