暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

862版本升级至952版本时需要打开特定参数

原创 付玉 2024-06-24
43

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()

「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论