862版本升级至952版本:
需要检查准备升级的版本gnode层配置文件中是否有local_address参数。
(1)V862_build33最新版本gnode层配置文件中增加了local_address参数,由于V952和V953版本目前还未增加该参数,直接升级至V952版本会出现报错回退且gcware服务无法启动的情况,需要在所有管理节点手工创建/var/lib/corosync目录gcware才能重启恢复正常。
如果准备升级的版本gnode层有local_address参数,升级前注释掉gnode层配置文件gbase_8a_gbase.cnf中的local_address参数可以升级成功。
(2)如果准备升级的版本gnode层没有local_address参数,升级至952,且不计划升级至V953版本,可以从V862版本直接升级至V952最新版本。
升级脚本:
def update_conf(self,host,port=22,user='gbase',passwd='gbase'):
ssh=paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect(host, port, user, passwd)
print("---------- start update gbase_8a_gcluster.cnf")
_,GBASE_BASE,_=ssh.exec_command("echo $GBASE_BASE")
time.sleep(2)
GBASE_BASE=str(GBASE_BASE.read(), encoding="utf8").strip()
gnode_conf=GBASE_BASE+"/config/gbase_8a_gbase.cnf"
_,out,_=ssh.exec_command(f"cat {gnode_conf}")
time.sleep(2)
out_lines=str(out.read(), encoding="utf8").split('\n')
content=''
for line in out_lines:
if line.startswith('local_address'):
continue
content=content+line+"\n"
_,_,_=ssh.exec_command(f"cp {gnode_conf} {gnode_conf}.back")
time.sleep(2)
_,_,_=ssh.exec_command(f"echo '{content}' > {gnode_conf}")
time.sleep(2)
ssh.close()




