灰度升级适配CM组件参数 upgrade_from
This commit is contained in:
@ -2282,7 +2282,7 @@ class DefaultValue():
|
||||
return False
|
||||
|
||||
@staticmethod
|
||||
def getPrimaryNode(userProfile):
|
||||
def getPrimaryNode(userProfile, logger=None):
|
||||
"""
|
||||
:param
|
||||
:return: PrimaryNode
|
||||
@ -2294,8 +2294,15 @@ class DefaultValue():
|
||||
cmd = "source {0} && gs_om -t query".format(
|
||||
userProfile)
|
||||
(status, output) = subprocess.getstatusoutput(cmd)
|
||||
if status == 0:
|
||||
if status == 0 and ("cluster_state : Normal" in output \
|
||||
or "cluster_state : Degraded" in output):
|
||||
break
|
||||
if count == 2:
|
||||
start_cmd = "source {0} && gs_om -t start --timeout 30".format(userProfile)
|
||||
_, output = subprocess.getstatusoutput(start_cmd)
|
||||
if logger:
|
||||
logger.debug("Start cluster for get current primary datanode, "
|
||||
"the result is : \n{0}".format(output))
|
||||
time.sleep(10)
|
||||
count += 1
|
||||
if status != 0:
|
||||
@ -3655,7 +3662,7 @@ class ClusterInstanceConfig():
|
||||
if pi.instanceType == DefaultValue.MASTER_INSTANCE:
|
||||
masterInst = pi
|
||||
elif pi.instanceType == DefaultValue.STANDBY_INSTANCE or \
|
||||
dbInst.instanceType == DefaultValue.CASCADE_STANDBY:
|
||||
pi.instanceType == DefaultValue.CASCADE_STANDBY:
|
||||
standbyInstIdLst.append(pi.instanceId)
|
||||
|
||||
if dbInst.instanceType == DefaultValue.MASTER_INSTANCE:
|
||||
|
||||
Reference in New Issue
Block a user