gs_om生成xml工具添加约束最多支持一主八备
This commit is contained in:
parent
7da2622916
commit
94656943f3
@ -93,6 +93,11 @@ class ClusterKey:
|
||||
CM_SERVER_LEVEL, CM_SERVER_RELATION, CM_SERVER_PORT_STANDBY, CM_DIR]
|
||||
|
||||
|
||||
def check_cluster_node_count(cluster_info):
|
||||
node_count = len(cluster_info.dbNodes)
|
||||
if node_count < 0 or node_count > 9:
|
||||
raise Exception("The cluster supports a maximum of one primary node and eight backup nodes")
|
||||
|
||||
class GenerateXml:
|
||||
|
||||
def __init__(self):
|
||||
@ -140,6 +145,8 @@ class GenerateXml:
|
||||
cm_server.hostname = hostname
|
||||
cm_server.listenIps[0] = hostip
|
||||
cm_server.haIps[0] = hostip
|
||||
|
||||
check_cluster_node_count(cluster_info)
|
||||
|
||||
def do_generate_xml(self, cluster_info, new_host_info=None):
|
||||
"""
|
||||
|
Loading…
x
Reference in New Issue
Block a user