# 现版本为GBase8cV5 S5.0.0B09[gbase@gbase8c ~]$ gsql -V
gsql (single_node GBase8cV5 S5.0.0B09 build 5054ff66) compiled at 2023-06-12 15:08:36 commit 0 last mr 182[gbase@gbase8c ~]$ gs_om -t status --detail[ Cluster State ]
cluster_state : Normal
redistributing : No
current_az : AZ_ALL
[ Datanode State ]node node_ip port instance state
------------------------------------------------------------------------------------------------
1 gbase8c 192.168.140.23 154006001 /opt/database/install/data/dn P Primary Normal
2、上传新包,并解压
[root@gbase8c ~]# cd /opt/gbase8c_install/[root@gbase8c gbase8c_install]# ls
GBase8cV5_S5.0.0B24_centos7.8_x86_64.tar.gz
[root@gbase8c gbase8c_install]# tar -xvf GBase8cV5_S5.0.0B24_centos7.8_x86_64.tar.gz[root@gbase8c gbase8c_install]# tar -xf GBase8cV5_S5.0.0B24_CentOS_x86_64_om.tar.gz
3、拷贝旧的安装模板,重新预安装
[root@gbase8c gbase8c_install]# cp ../gbase/gbase.xml ./[root@gbase8c gbase8c_install]# script/gs_preinstall -U gbase -G gbase -X gbase.xml
Parsing the configuration file.
Successfully parsed the configuration file.
Installing the tools on the local node.
Successfully installed the tools on the local node.
Setting hostipenv
Successfully sethostip env.
Are you sure you want to create the user[gbase](yes/no)? yes
Preparing SSH service.
Successfully prepared SSH service.
Checking OS software.
Successfully check os software.
Creating cluster's path.
Successfully created cluster's path.
Set and check OS parameter.
Setting OS parameters.
Successfully set OS parameters.
Set and check OS parameter completed.
Preparing CRON service.
Successfully prepared CRON service.
Setting user environmental variables.
Successfully set user environmental variables.
Setting the dynamic link library.
Successfully set the dynamic link library.
Setting Core file
Successfully set core path.
Setting pssh path
Successfully set pssh path.
Setting Cgroup.
Successfully set Cgroup.
Set ARM Optimization.
No need to set ARM Optimization.
Fixing server package owner.
Setting finish flag.
Successfully set finish flag.
Preinstallation succeeded.
4、执行升级,会自动停数据库(auto-upgrade就地升级)
[root@gbase8c ~]$ su - gbase
[gbase@gbase8c gbase8c_install]$ cd /opt/gbase8c_install/
[gbase@gbase8c gbase8c_install]$ gs_upgradectl -t auto-upgrade -X gbase.xml
Static configuration matched with old static configuration files.
Performing inplace rollback.
Rollback succeeded.
Checking upgrade environment.
Successfully checked upgrade environment.
Successfully started cluster.
Start to do health check.
Successfully checked cluster status.
Backing up current application and configurations.
Successfully backed up current application and configurations.
Stop cluster with gs_om successfully.
Backing up cluster configuration.
Successfully backup hotpatch config file.
Successfully backed up cluster configuration.
Installing new binary.
Restoring cluster configuration.
Successfully restored cluster configuration.
Successfully started cluster.
Start check CMS parameter.
Stop cluster with gs_om successfully.
Modifying the socket path.
Successfully modified socket path.
Successfully started cluster.
copy certs from /opt/database/install/app_5054ff66 to /opt/database/install/app_973db353.
Successfully copy certs from /opt/database/install/app_5054ff66 to /opt/database/install/app_973db353.
Stop cluster with gs_om successfully.
Switch symbolic link to new binary directory.
Successfully switch symbolic link to new binary directory.
Successfully started cluster.
Stop cluster with gs_om successfully.
Successfully started cluster.
Waiting for the cluster status to become normal.
.
The cluster status is normal.
Start to do health check.
Successfully checked cluster status.
Upgrade main process has been finished, user can do some check now.
Once the check done, please execute following command to commit upgrade:
gs_upgradectl -t commit-upgrade -X /opt/gbase8c_install/gbase.xml
[gbase@gbase8c gbase8c_install]$ gs_om -t status --detail[ Cluster State ]
cluster_state : Normal
redistributing : No
current_az : AZ_ALL
[ Datanode State ]node node_ip port instance state
------------------------------------------------------------------------------------------------
1 gbase8c 192.168.140.23 154006001 /opt/database/install/data/dn P Primary Normal
5、执行命令提交升级
[gbase@gbase8c gbase8c_install]$ gs_upgradectl -t commit-upgrade -X /opt/gbase8c_install/gbase.xml
NOTICE: Start to commit binary upgrade.
Start to check whether can be committed.
Can be committed.
Start to set commit flag.
Set commit flag succeeded.
Start to do operations that cannot be rollback.
Cancel the upgrade status succeeded.
Start to clean temp files for upgrade.
Clean up backup catalog files.
Successfully cleaned old install path.
Stop cluster with gs_om successfully.
Successfully started cluster.
Clean temp files for upgrade succeeded.
NOTICE: Commit binary upgrade succeeded.
6、检查版本及状态
[gbase@gbase8c ~]$ gsql -V
gsql (single_node GBase8cV5 S5.0.0B24 build 973db353) compiled at 2024-03-01 13:42:35 commit 0 last mr 484[gbase@gbase8c ~]$ gs_om -t status --detail[ Cluster State ]
cluster_state : Normal
redistributing : No
current_az : AZ_ALL
[ Datanode State ]node node_ip port instance state
------------------------------------------------------------------------------------------------
1 gbase8c 192.168.140.23 154006001 /opt/database/install/data/dn P Primary Normal