• 南大通用数据库-Gbase-8a-学习-17-Gbase8a集群版本升级


    一、测试环境

    名称
    cpuIntel® Core™ i5-1035G1 CPU @ 1.00GHz
    操作系统CentOS Linux release 7.9.2009 (Core)
    内存4G
    逻辑核数3
    Gbase-8a节点-IP192.168.142.10
    Gbase-8a数据库旧版本8.6.2.43-R33.132743
    Gbase-8a数据库新版本8.6.2-R43.34.27468a27

    二、旧版本环境

    1、集群状态

    [gbase@localhost gcinstall]$ gcadmin showdistribution
    
                  Distribution ID: 1 | State: new | Total segment num: 1
    
         Primary Segment Node IP                           Segment ID         Duplicate Segment node IP
    ========================================================================================================================
    |    192.168.142.12                              |       1          |                                                  |
    ========================================================================================================================
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8

    2、测试数据

    gbase> create database czg;
    Query OK, 1 row affected (Elapsed: 00:00:00.01)
    
    gbase> use czg;
    Query OK, 0 rows affected (Elapsed: 00:00:00.00)
    
    gbase> create table sun (a int,b double,c varchar(100),d text,e blob,f longblob,g date,h timestamp);
    Query OK, 0 rows affected (Elapsed: 00:00:00.16)
    
    gbase> insert into sun values(1,1.1,'czg','快乐的小天使','qwertasdsdfzxczxxv','gregergjsfishfuieehfuiew','1995-09-18','2022-08-03 09:24:00.000');
    Query OK, 1 row affected (Elapsed: 00:00:00.14)
    
    gbase> insert into sun values(1,1.1,'czg','快乐的小天使','qwertasdsdfzxczxxv','gregergjsfishfuieehfuiew','1995-09-18','2022-08-03 09:24:00.000');
    Query OK, 1 row affected (Elapsed: 00:00:00.14)
    
    gbase> insert into sun values(1,1.1,'czg','快乐的小天使','qwertasdsdfzxczxxv','gregergjsfishfuieehfuiew','1995-09-18','2022-08-03 09:24:00.000');
    Query OK, 1 row affected (Elapsed: 00:00:00.02)
    
    gbase> insert into sun select * from sun;
    Query OK, 3 rows affected (Elapsed: 00:00:00.21)
    Records: 3  Duplicates: 0  Warnings: 0
    
    gbase> select * from sun;
    +------+------+------+--------------------+--------------------+--------------------------+------------+---------------------+
    | a    | b    | c    | d                  | e                  | f                        | g          | h                   |
    +------+------+------+--------------------+--------------------+--------------------------+------------+---------------------+
    |    1 |  1.1 | czg  | 快乐的小天使       | qwertasdsdfzxczxxv | gregergjsfishfuieehfuiew | 1995-09-18 | 2022-08-03 09:24:00 |
    |    1 |  1.1 | czg  | 快乐的小天使       | qwertasdsdfzxczxxv | gregergjsfishfuieehfuiew | 1995-09-18 | 2022-08-03 09:24:00 |
    |    1 |  1.1 | czg  | 快乐的小天使       | qwertasdsdfzxczxxv | gregergjsfishfuieehfuiew | 1995-09-18 | 2022-08-03 09:24:00 |
    |    1 |  1.1 | czg  | 快乐的小天使       | qwertasdsdfzxczxxv | gregergjsfishfuieehfuiew | 1995-09-18 | 2022-08-03 09:24:00 |
    |    1 |  1.1 | czg  | 快乐的小天使       | qwertasdsdfzxczxxv | gregergjsfishfuieehfuiew | 1995-09-18 | 2022-08-03 09:24:00 |
    |    1 |  1.1 | czg  | 快乐的小天使       | qwertasdsdfzxczxxv | gregergjsfishfuieehfuiew | 1995-09-18 | 2022-08-03 09:24:00 |
    +------+------+------+--------------------+--------------------+--------------------------+------------+---------------------+
    6 rows in set (Elapsed: 00:00:00.01)
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34

    3、版本查看

    gbase> select version();
    +---------------------+
    | version()           |
    +---------------------+
    | 8.6.2.43-R33.132743 |
    +---------------------+
    1 row in set (Elapsed: 00:00:00.00)
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7

    三、升级步骤

    cexec命令的安装步骤看之前的写的文章里有,文章连接:南大通用数据库-Gbase-8a-学习-12-Gbase8a常用运维命令(持续更新哈)

    1、确定业务是否停止

    确保没有运行的Sql。

    [gbase@localhost gcinstall]$ cexecs data: 'gncli -uroot -e "show processlist"|grep -v Sleep'
    ************************ data  ************************
    --------- 192.168.142.12---------
    Warning: Permanently added '192.168.142.12' (ECDSA) to the list of known hosts.
    Id      User    Host    db      Command Time    State   Info
    36      root    localhost       NULL    Query   0       NULL    show processlist
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6

    2、定时任务检查

    (1)查看定时任务
    [root@localhost opt]# cexecs data: 'cat /var/spool/cron/gbase'
    ************************ data  ************************
    --------- 192.168.142.12---------
    Warning: Permanently added '192.168.142.12' (ECDSA) to the list of known hosts.
    0 */2 * * * /opt/gnode/server/bin/gc_syncpacklog.sh /opt
    
    • 1
    • 2
    • 3
    • 4
    • 5
    (2)注释定时任务

    如果升级时间段内有定时任务需注释。

    [root@localhost opt]# cexecs data: 'sed -i "s/^[^#]/#&/" /var/spool/cron/gbase'
    ************************ data  ************************
    --------- 192.168.142.12---------
    Warning: Permanently added '192.168.142.12' (ECDSA) to the list of known hosts.
    
    [root@localhost opt]# cexecs data: 'cat /var/spool/cron/gbase'
    ************************ data  ************************
    --------- 192.168.142.12---------
    Warning: Permanently added '192.168.142.12' (ECDSA) to the list of known hosts.
    #0 */2 * * * /opt/gnode/server/bin/gc_syncpacklog.sh /opt
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    (3)解除定时任务注释(升级结束后执行)
    [root@localhost opt]# cexecs data: 'sed -i "s/^[#]//" /var/spool/cron/gbase'
    ************************ data  ************************
    --------- 192.168.142.12---------
    Warning: Permanently added '192.168.142.12' (ECDSA) to the list of known hosts.
    
    [root@localhost opt]# cexecs data: 'cat /var/spool/cron/gbase'
    ************************ data  ************************
    --------- 192.168.142.12---------
    Warning: Permanently added '192.168.142.12' (ECDSA) to the list of known hosts.
    0 */2 * * * /opt/gnode/server/bin/gc_syncpacklog.sh /opt
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10

    3、检查集群状态

    如果有节点异常,先处理再升级。

    [root@localhost opt]# gcadmin
    CLUSTER STATE:  ACTIVE
    CLUSTER MODE:   NORMAL
    
    =====================================================================
    |               GBASE COORDINATOR CLUSTER INFORMATION               |
    =====================================================================
    |   NodeName   |       IpAddress       |gcware |gcluster |DataState |
    ---------------------------------------------------------------------
    | coordinator1 |    192.168.142.12     | OPEN  |  OPEN   |    0     |
    ---------------------------------------------------------------------
    =================================================================
    |                GBASE DATA CLUSTER INFORMATION                 |
    =================================================================
    |NodeName |       IpAddress       |gnode |syncserver |DataState |
    -----------------------------------------------------------------
    |  node1  |    192.168.142.12     | OPEN |   OPEN    |    0     |
    -----------------------------------------------------------------
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18

    4、检查EVENT

    (1)查看命令
    [root@localhost opt]# gcadmin showdmlevent
    Event count:0
    
    [root@localhost opt]# gcadmin showddlevent
    Event count:0
    
    [root@localhost opt]# gcadmin showdmlstorageevent
    Event count:0
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    (2)日志排查

    如果上述结果有不为0的,需查看日志中是否有报错日志,根据报错解决相应问题。

    [gbase@localhost gcinstall]$ tail -f /opt/gcluster/log/gcluster/gc_recover.log 
    2022-08-23 09:39:09.242 [INFO ] <RECOVER-INFO>: Recover Thread(0x7fccba42c700) is been built success 
    2022-08-23 09:39:09.242 [INFO ] <RECOVER-INFO>: Recover Thread(0x7fccb9c2b700) is been built success 
    2022-08-23 09:39:09.242 [INFO ] <RECOVER-INFO>: Recover Thread(0x7fccb942a700) is been built success 
    2022-08-23 09:39:09.242 [INFO ] <RECOVER-INFO>: Recover Thread(0x7fccb8c29700) is been built success 
    2022-08-23 09:39:09.243 [INFO ] <RECOVER-INFO>: Recover Thread(0x7fccb8428700) is been built success 
    2022-08-23 09:39:09.243 [INFO ] <RECOVER-INFO>: Recover Thread(0x7fccb7c27700) is been built success 
    2022-08-23 09:39:09.243 [INFO ] <RECOVER-INFO>: Recover Thread(0x7fccb7426700) is been built success 
    2022-08-23 09:39:09.243 [INFO ] <RECOVER-INFO>: Recover Thread(0x7fccb6c25700) is been built success 
    2022-08-23 09:39:09.243 [INFO ] <RECOVER-INFO>: Recover Thread(0x7fccb6424700) is been built success 
    2022-08-23 09:39:09.243 [INFO ] <GCWare>: master node is: 210675904 192.168.142.12
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11

    5、集群版本检查(升级前后都需要做)

    升级前后都需要记录,分别升级后做版本对比。

    (1)集群服务版本
    [gbase@localhost gcinstall]$ cexecs coor: "/opt/gcluster/server/bin/gclusterd -V"
    ************************ coor  ************************
    --------- 192.168.142.12---------
    Warning: Permanently added '192.168.142.12' (ECDSA) to the list of known hosts.
    /opt/gcluster/server/bin/gclusterd ver 8.6.2.43-R33.132743 for unknown-linux-gnu on x86_64
    
    • 1
    • 2
    • 3
    • 4
    • 5
    (2)数据节点服务版本
    [gbase@localhost gcinstall]$ cexecs data: "/opt/gnode/server/bin/gbased -V"
    ************************ data  ************************
    --------- 192.168.142.12---------
    Warning: Permanently added '192.168.142.12' (ECDSA) to the list of known hosts.
    /opt/gnode/server/bin/gbased ver 8.6.2.43-R33.132743 for unknown-linux-gnu on x86_64
    
    • 1
    • 2
    • 3
    • 4
    • 5
    (3)gcadmin版本
    [gbase@localhost gcinstall]$ cexecs "gcadmin -V"
    ************************ coor  ************************
    --------- 192.168.142.12---------
    Warning: Permanently added '192.168.142.12' (ECDSA) to the list of known hosts.
    gcadmin 1.2.9 build 129123
    
    • 1
    • 2
    • 3
    • 4
    • 5
    (4)其他组件版本
    gbase>  SHOW VARIABLES LIKE '%VERSION';
    +----------------------------+---------------------+
    | Variable_name              | Value               |
    +----------------------------+---------------------+
    | gbase_kafka_broker_version |                     |
    | gbase_show_version         | 1                   |
    | gcluster_hash_version      | 1                   |
    | protocol_version           | 10                  |
    | version                    | 8.6.2.43-R33.132743 |
    +----------------------------+---------------------+
    5 rows in set (Elapsed: 00:00:00.01)
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11

    6、停止集群服务

    [root@localhost opt]# cexec all: "service gcware stop"
    ************************* all *************************
    --------- 192.168.142.12---------
    Warning: Permanently added '192.168.142.12' (ECDSA) to the list of known hosts.
    Stopping GCMonit success!
    Signaling GCRECOVER (gcrecover) to terminate: [  确定  ]
    Waiting for gcrecover services to unload:...[  确定  ]
    Signaling GCSYNC (gc_sync_server) to terminate: [  确定  ]
    Waiting for gc_sync_server services to unload:[  确定  ]
    Signaling GCLUSTERD  to terminate: [  确定  ]
    Waiting for gclusterd services to unload:........[  确定  ]
    Signaling GBASED  to terminate: [  确定  ]
    Waiting for gbased services to unload:..[  确定  ]
    Signaling GCWARE (gcware) to terminate: [  确定  ]
    Waiting for gcware services to unload:..[  确定  ]
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15

    7、获取现有SCN和TABLEID

    记录现有的SCN号和TABLEID号,用于升级意外失败的手工恢复。

    [gbase@localhost gcinstall]$ python
    Python 2.7.5 (default, Jun 28 2022, 15:30:04) 
    [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import gcware
    >>> gcware.getscn()
    16
    >>> gcware.gettableid()
    8
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9

    8、集群配置文件备份

    (1)集群层配置文件备份
    [root@czg2 ~]# cexec coor: 'cp -a /opt/gcluster/ /home/gbase/bak/' 
    
    • 1
    (2)数据层配置文件备份
    [root@czg2 ~]# cexec coor: 'cp -a /opt/gnode/ /home/gbase/bak/' 
    
    • 1
    (3)其他配置文件备份
    [root@czg2 ~]# cexec coor: "cp -a /var/lib/gcware/ /home/gbase/bak/ "
    
    [root@czg2 ~]# cexec coor: "cp -a /etc/corosync /home/gbase/bak/ "
    
    • 1
    • 2
    • 3

    9、解压新版本

    [root@localhost opt]# cd /opt/pkg/Gbase8a-34/
    
    [root@localhost Gbase8a-34]# ll
    总用量 88300
    -rw-rw-rw- 1 root root 90416620 823 09:20 GBase8a_MPP_Cluster-NoLicense-8.6.2_build43-R34-2-redhat7-x86_64.tar.bz2
    
    [root@localhost Gbase8a-34]# tar -xvf GBase8a_MPP_Cluster-NoLicense-8.6.2_build43-R34-2-redhat7-x86_64.tar.bz2 
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7

    10、修改配置文件

    [root@localhost gcinstall]# cat demo.options 
    installPrefix= /opt
    coordinateHost = 192.168.142.12
    coordinateHostNodeID = 234,235,237
    dataHost = 192.168.142.12
    #existCoordinateHost =
    #existDataHost =
    loginUser= root
    loginUserPwd = 'qwer1234'
    #loginUserPwdFile = loginUserPwd.json
    dbaUser = gbase
    dbaGroup = gbase
    dbaPwd = 'gbase'
    rootPwd = 'qwer1234'
    #rootPwdFile = rootPwd.json
    dbRootPwd = ''
    #mcastAddr = 226.94.1.39
    mcastPort = 5493
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18

    11、集群升级

    (1)升级命令
    [gbase@czg2 gcinstall]$ python gcinstall.py --silent=demo.options -U
    192.168.142.12          Install gcluster on host 192.168.142.12 successfully.
    192.168.142.12          Install gcluster on host 192.168.142.12 successfully.
    Starting all gcluster nodes...
    Upgrade Successfully.
    
    • 1
    • 2
    • 3
    • 4
    • 5
    (2)升级日志
    [root@localhost gcinstall]# tail -f gcinstall.log 
    2022-08-23 11:20:08,756-root-INFO Copying pexpect.py to host 192.168.142.12:/opt_prepare successfully
    2022-08-23 11:20:08,757-root-INFO Copying BUILDINFO to host 192.168.142.12:/opt_prepare
    2022-08-23 11:20:09,925-root-INFO Copying BUILDINFO to host 192.168.142.12:/opt_prepare successfully
    2022-08-23 11:20:09,925-root-INFO Copying bundle.tar.bz2 to host 192.168.142.12:/opt_prepare
    2022-08-23 11:20:11,997-root-INFO Copying bundle.tar.bz2 to host 192.168.142.12:/opt_prepare successfully
    2022-08-23 11:20:11,998-root-INFO Copying bundle_data.tar.bz2 to host 192.168.142.12:/opt_prepare
    2022-08-23 11:20:13,206-root-INFO Copying bundle_data.tar.bz2 to host 192.168.142.12:/opt_prepare successfully
    2022-08-23 11:20:13,206-root-INFO Copy data files to host 192.168.142.12 successfully.
    2022-08-23 11:20:13,206-root-INFO Upgrade gcluster.
    2022-08-23 11:20:13,207-root-INFO send cmd: /usr/bin/python /opt_prepare/InstallTar.py --silent=/opt_prepare/192.168.142.12.options --IsCoordinator --IsData  -U  --ClusterUUID=4aa9025c-2292-11ed-9142-000c29c7ba0f --is_IPV4
    2022-08-23 11:30:19,783-root-INFO Install gcluster on host 192.168.142.12 successfully.
    2022-08-23 11:30:20,297-root-DEBUG set gc_syncpacklog on host 192.168.142.12
    2022-08-23 11:30:21,647-root-INFO crontab -l > conf;sed -i '/gc_syncpacklog.sh/d' conf;sed -i '/^$/d' conf;echo '0 */2 * * * /opt/gnode/server/bin/gc_syncpacklog.sh /opt' >> conf;                crontab conf;rm -rf conf;
    2022-08-23 11:30:22,270-root-DEBUG Starting all gcluster nodes...
    2022-08-23 11:30:35,841-root-INFO start service successfull on host 192.168.142.12.
    2022-08-23 11:30:36,345-root-DEBUG /bin/chown -R gbase:gbase gcChangeInfo.xml
    2022-08-23 11:30:36,354-root-DEBUG source /home/gbase/.gbase_profile;gcadmin showcluster f
    2022-08-23 11:30:42,437-root-INFO /opt/gcluster/server/bin/gbase -p'***' -uroot -e"select count(uid) from gbase.user where uid <> 0"
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19

    12、修改参数

    V8.6.2build43R31及之后的版本推荐添加或修改如下参数。
    所有管理节点都需要添加这两个参数,后续需重启数据库。

    (1)corosync.conf参数
    参数名描述
    inner_connect_read_write_timeoutgbase_inner_connect 连接、写、读的超时时间。
    参数值:整数型 1~5,单位:秒,默认值:1,最大值 5。

    添加到gcware标签里。

    [root@czg2 ~]# cat /etc/corosync/corosync.conf
    totem {
        version: 2
        secauth: off
        interface {
            member {
                memberaddr: 192.168.142.12
            }
            ringnumber: 0
            bindnetaddr: 192.168.142.12
            mcastport: 5493
            ttl: 1
        }
        transport: udpu
        token: 60000
        token_retransmits_before_loss_const:80
        send_join: 80
        join: 1500
        consensus:120000
    }
    logging {
        fileline: off
        to_stderr: no
        to_file: yes
        to_syslog: no
        logfile: /var/log/corosync.log
        corosync_system_log: /opt/gcluster/log/gcluster/corosync_system.log
        debug: off
        timestamp: on
        logger {
            ident: AMF
            debug: off
            tags: enter|leave|trace1|trace2|trace3|trace4|trace6
        }
    }
    
    gcware {
        persistent_interval: 5
        check_interval: 30
        whole_check_interval_num: 20
        cfg_connect_timeout: 5000
        gcluster_port: 5258
        gnode_port: 5050
        syncserver_port: 5288
        node_ssh_port: 22
        singlecastport: 5678
        check_coordinator_thread_num: 1
        check_dataserver_thread_num: 10
        check_tcp_only: 1
        inner_connect_read_write_timeout: 5
        coordinator {
            member {
                memberaddr: 192.168.142.12
            }
        }
    }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    (2)gcluster_shrink_to_rebalance
    参数名描述
    gcluster_shrink_to_rebalancerebalance 实现 shrink space 功能和原 shrink space 功能共存,用参数控制:gcluster_shrink_to_rebalance
    默认值 0; 取值 1: 打开 shrink to rebalance 功能; 取值 0:关闭shrink to rebalance 功能。

    在gbase_8a_gcluster.cnf中的模块[gbased]中添加gcluster_shrink_to_rebalance参数。

    [root@czg2 ~]# cat /opt/gcluster/config/gbase_8a_gcluster.cnf
    [client]
    port=5258
    socket=/tmp/gcluster_5258.sock
    connect_timeout=43200
    #default_character_set=gbk
    
    [gbased]
    basedir = /opt/gcluster/server
    datadir = /opt/gcluster/userdata/gcluster
    socket=/tmp/gcluster_5258.sock
    pid_file = /opt/gcluster/log/gcluster/gclusterd.pid
    
    #default_character_set=gbk
    
    log_error
    port=5258
    gcluster_gnode_port=5050
    core_file
    
    default_storage_engine=express
    default_time_zone='+8:00'
    _gbase_query_path=0
    
    skip_name_resolve
    query_cache_type = 0
    query_cache_size = 0M
    event_scheduler= 1
    
    thread_stack = 1048576
    
    sql_mode=PAD_CHAR_TO_FULL_LENGTH,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,NO_AUTO_CREATE_USER,NO_AUTO_VALUE_ON_ZERO,NO_ENGINE_SUBSTITUTION,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ONLY_FULL_GROUP_BY
    lower_case_table_names=1
    
    max_connections = 10000
    max_connect_errors=1000000
    max_allowed_packet = 64M
    net_write_timeout = 1000000
    net_read_timeout = 1000000
    connect_timeout = 1000000
    interactive_timeout  =1000000
    wait_timeout = 1000000
    open_files_limit = 65535
    
    gbase_express_log = 1
    
    gcluster_connect_net_read_timeout  =  1000000   
    gcluster_connect_net_write_timeout =  1000000
    gcluster_connect_timeout = 1000000
    gcluster_wait_query_cancel_timeout = 200
    gcluster_reconn_times = 3
    gcluster_async_connect_timeout = 120
    
    gcluster_use_special_insert_method = 1
    gcluster_use_special_materialized_table = 1
    gcluster_special_insert_method_comment=temp
    
    gcluster_use_new_threadpool = 1
    gcluster_max_thread_in_pool = 600  
    
    gcluster_use_conn_pool = 1
    gcluster_max_conn_in_pool = 300
    gcluster_conn_ping_expire = 0
    
    gcluster_local_max_conn_in_pool = 50
    
    gcluster_dynamic_cluster_node_status = 1
    gcluster_lock_level = 2
    gcluster_temp_table_engine='express nolock'
    gcluster_dml_ddl_proxy_switch = 0
    gcluster_adjust_nodes_before_redist = 0
    
    gcluster_starschema_optimize = 0
    gcluster_starschema_join_estimate_optimize = 1
    gcluster_hash_redistribute_groupby_optimize = 1
    gcluster_hash_redistribute_join_optimize = 2
    gcluster_crossjoin_use_hash_distribution = 1
    gcluster_insertselect_use_values_optimize = 0
    gcluster_union_optimize = 1
    gcluster_count_optimize = 1
    gcluster_insert_singlegrouppart_optimize = 0
    
    gcluster_empty_result_set_optimize = 0
    
    gcluster_special_correlated_optimize = 1
    gcluster_support_hash_redist_combiner = 0
    gcluster_order_by_limit_offset_optimize = 0
    
    
    gcluster_ha_event_monitor = 1
    gcluster_ha_node_left_event_delay = 120000
    
    gcluster_sql_statistics = 0
    gcluster_use_new_decimal = 1
    gcluster_query_retry = 1
    gcluster_insert_optimize_flag = 95
    
    gcluster_serial_exec_query = 0
    #gcluster_special_correlated_optimize = 1
    #gcluster_ddl_parallel_execute =1
    
    gbase_compression_str_method=5
    gbase_compression_num_method=5
    
    back_log = 65535
    
    gcluster_hash_version = 1
    
    _gbase_transaction_disable = 1
    
    #const express can calculated before query
    gcluster_prepare_const_express = 0
    #disallow non printable char in char and varchar.
    up_disallow_non_printable_char = 0
    
    gcluster_shrink_to_rebalance = 1
    
    [gbasedump]
    max_allowed_packet = 64M
    
    
    [gbase]
    max_allowed_packet = 64M
    no_auto_rehash
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64
    • 65
    • 66
    • 67
    • 68
    • 69
    • 70
    • 71
    • 72
    • 73
    • 74
    • 75
    • 76
    • 77
    • 78
    • 79
    • 80
    • 81
    • 82
    • 83
    • 84
    • 85
    • 86
    • 87
    • 88
    • 89
    • 90
    • 91
    • 92
    • 93
    • 94
    • 95
    • 96
    • 97
    • 98
    • 99
    • 100
    • 101
    • 102
    • 103
    • 104
    • 105
    • 106
    • 107
    • 108
    • 109
    • 110
    • 111
    • 112
    • 113
    • 114
    • 115
    • 116
    • 117
    • 118
    • 119
    • 120
    • 121
    • 122
    • 123
    • 124

    13、重启集群

    [root@czg2 ~]# cexec all: "service gcware restart"
    ************************* all *************************
    --------- 192.168.142.12---------
    Warning: Permanently added '192.168.142.12' (ECDSA) to the list of known hosts.
    Stopping GCMonit success!
    Signaling GCRECOVER (gcrecover) to terminate: [  确定  ]
    Waiting for gcrecover services to unload:..[  确定  ]
    Signaling GCSYNC (gc_sync_server) to terminate: [  确定  ]
    Waiting for gc_sync_server services to unload:[  确定  ]
    Signaling GCLUSTERD  to terminate: [  确定  ]
    Waiting for gclusterd services to unload:.......[  确定  ]
    Signaling GBASED  to terminate: [  确定  ]
    Waiting for gbased services to unload:.....[  确定  ]
    Signaling GCWARE (gcware) to terminate: [  确定  ]
    Waiting for gcware services to unload:.[  确定  ]
    Starting GCWARE (gcwexec): [  确定  ]
    Starting GBASED    : [  确定  ]
    Starting GCSYNC : [  确定  ]
    Starting GCLUSTERD :   [  确定  ]
    Starting GCRECOVER : [  确定  ]
    Starting GCMonit success!
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21

    14、验证升级情况

    重复:5、集群版本检查(升级前后都需要做)

    [gbase@czg2 gcinstall]$ gccli
    
    GBase client 8.6.2-R43.34.27468a27. Copyright (c) 2004-2022, GBase.  All Rights Reserved.
    
    gbase> select version();
    +-----------------------+
    | version()             |
    +-----------------------+
    | 8.6.2-R43.34.27468a27 |
    +-----------------------+
    1 row in set (Elapsed: 00:00:00.00)
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11

    集群状态检查:

    [gbase@czg2 gcinstall]$ gcadmin
    CLUSTER STATE:  ACTIVE
    CLUSTER MODE:   NORMAL
    
    =====================================================================
    |               GBASE COORDINATOR CLUSTER INFORMATION               |
    =====================================================================
    |   NodeName   |       IpAddress       |gcware |gcluster |DataState |
    ---------------------------------------------------------------------
    | coordinator1 |    192.168.142.12     | OPEN  |  OPEN   |    0     |
    ---------------------------------------------------------------------
    =================================================================
    |                GBASE DATA CLUSTER INFORMATION                 |
    =================================================================
    |NodeName |       IpAddress       |gnode |syncserver |DataState |
    -----------------------------------------------------------------
    |  node1  |    192.168.142.12     | OPEN |   OPEN    |    0     |
    -----------------------------------------------------------------
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18

    15、升级失败回退

    (1)方法一

    先杀掉gbase用户下的残留进程。

    [root@czg2 gcinstall]# ./Restore.py --help
    Usage: Restore.py [options]
    
    Options:
      -h, --help            show this help message and exit
      -a                    do not prompt the user for confirmation
      --backupFile=BACKUPFILE
                            backup file.
      --silent=SILENTCONFIG
                            use the supplied properties file for a 'silent'
                            restore
      --passwordInputMode=PASSWORDINPUTMODE
                            This process get password method, default:file. mode
                            ["file","pwdsame","pwddiff"]
                            file:    get from config file[password without
                            encrypted].                        pwdsame: get
                            password from user input when all node password same.
                            pwddiff: get password from user input for nodes one by
                            one.
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    [gbase@localhost gcinstall]$ ./Restore.py --backupFile=/home/gbase/gcluster_backup_xxxx.tar.bz2 --silent=demo.options
    
    • 1

    gcluster_backup_xxxx.tar.bz2是执行升级脚本后,自动生成的backup 文件。最后出现Success to RestoreLocal的字样,表示回退成果。

    (2)方法二

    先停服务用新版本unInstall.py卸掉新版本,再用老版本gcinstall.py安装,需要和原来路径一致。再停服务,把 6、集群配置文件备份中的文件移动回原位置之前,最好把原位置的文件先删除,最后再启动服务即可。

  • 相关阅读:
    区块链不止一种工作方式
    Python接口自动化测试自学路线
    [附源码]计算机毕业设计打印助手平台
    LeetCode75——Day18
    python中的并发编程-进程、线程2
    13个Redis面试题,你都知道哪些?
    Spring AOP框架
    多商户自营连锁小程序商城的作用是什么
    使用Python绘制旭日图
    [LeetCode]剑指 Offer 16. 数值的整数次方
  • 原文地址:https://blog.csdn.net/qq_45111959/article/details/126478882