[root@gauss1 ~]# su - omm -c "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 gauss1 10.125.8.248 15400 6001 /usr/bin/gaussdb/data/dn P Primary Normal
同时创建测试B库ssss,创建测试表test(t1 int,t2 int);
ssss=> \d test Table "public.test" Column | Type | Modifiers --------+---------+----------- t1 | integer | t2 | integer |
[root@gauss1 upgrade]# cd script/ [root@gauss1 script]# pwd /opt/openGauss/upgrade/script [root@gauss1 script]# date 2024年 11月 08日 星期五 03:27:56 CST [root@gauss1 script]# ./gs_preinstall -U omm -G dbgrp -X /opt/openGauss/cluster_config.xml --non-interactive 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 host ip env Successfully set host ip env. Preparing SSH service. Successfully prepared SSH service. Checking OS software. Successfully check OS software. Checking OS version. Successfully checked OS version. Checking cpu instructions. Successfully checked cpu instructions. Creating cluster's path. Successfully created cluster's path. Set and check OS parameter. Setting OS parameters. Successfully set OS parameters. Warning: Installation environment contains some warning messages. Please get more details by "/opt/openGauss/upgrade/script/gs_checkos -i A -h gauss1 -X /opt/openGauss/cluster_config.xml --detail". 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.
su - omm -c "gs_guc reload -N all -I all -h \"local all all trust\""
开始升级
[root@gauss1 script]# su - omm -c "gs_upgradectl -t auto-upgrade -X /opt/openGauss/cluster_config.xml --grey" Static configuration matched with old static configuration files. Successfully set upgrade_mode to 0. Progress report: (9%) Checking upgrade environment. Successfully checked upgrade environment. Progress report: (18%) Start to do health check. Successfully checked cluster status. Progress report: (27%) Upgrade one node 'gauss1'. NOTICE: The directory /usr/bin/gaussdb/app_a07d57c3 will be deleted after commit-upgrade, please make sure there is no personal data. Progress report: (36%) Performing grey rollback. No need to rollback. The directory /usr/bin/gaussdb/app_a07d57c3 will be deleted after commit-upgrade, please make sure there is no personal data. Progress report: (45%) Installing new binary. Progress report: (55%) copy certs from /usr/bin/gaussdb/app_a07d57c3 to /usr/bin/gaussdb/app_aee4abd5. Successfully copy certs from /usr/bin/gaussdb/app_a07d57c3 to /usr/bin/gaussdb/app_aee4abd5. Progress report: (64%) Successfully backup hotpatch config file. Sync cluster configuration. Successfully synced cluster configuration. Switch symbolic link to new binary directory. Successfully switch symbolic link to new binary directory. Start check CMS parameter. Progress report: (73%) Switching all db processes. Check cluster state. Cluster state: [ Cluster State ]
cluster_state : Normal redistributing : No current_az : AZ_ALL
[ Datanode State ]
node node_ip port instance state ---------------------------------------------------------------------- 1 gauss1 10.125.8.248 15400 6001 P Primary Normal Create checkpoint before switching. Start to wait for om_monitor. Switching DN processes. Ready to grey start cluster. Grey start cluster successfully. Wait for the cluster status normal or degrade. Successfully switch all process version Progress report: (82%) The nodes ['gauss1'] have been successfully upgraded to new version. Then do health check. Start to do health check. Successfully checked cluster status. Progress report: (91%) Waiting for the cluster status to become normal. . The cluster status is normal. Upgrade main process has been finished, user can do some check now. Once the check done, please execute following command to commit upgrade:
[root@gauss1 script]# su - omm -c "gsql -V" gsql (openGauss 6.0.0 build aee4abd5) compiled at 2024-09-29 19:14:27 commit 0 last mr [root@gauss1 script]# su - omm -c "gaussdb -V" gaussdb (openGauss 6.0.0 build aee4abd5) compiled at 2024-09-29 19:14:27 commit 0 last mr
working_version_num此时由于未执行重启,查询出来的是旧版本号
[root@gauss1 script]# su - omm -c "gsql -d postgres -p 15400 -c \"select working_version_num();\"" working_version_num --------------------- 92848 (1 row) [root@gauss1 upgrade]# su - omm -c "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 gauss1 10.125.8.248 15400 6001 /usr/bin/gaussdb/data/dn P Primary Normal
7.升级提交
[root@gauss1 script]# su - omm -c "gs_upgradectl -t commit-upgrade -X /opt/openGauss/cluster_config.xml" Start to do health check. Successfully checked cluster status. Start check CMS parameter. Successfully cleaned old install path. Commit upgrade succeeded.
8.重启数据库执行版本号查询,与version.cfg 内一致
[root@gauss1 upgrade]# su - omm -c "gs_om -t restart --time-out=30"
Stopping cluster. ========================================= Successfully stopped cluster. ========================================= End stop cluster.
Starting cluster. ========================================= [SUCCESS] gauss1 2024-11-08 07:29:45.204 672d4d69.1 [unknown] 139742442641856 [unknown] 0 dn_6001 01000 0 [BACKEND] WARNING: could not create any HA TCP/IP sockets 2024-11-08 07:29:45.204 672d4d69.1 [unknown] 139742442641856 [unknown] 0 dn_6001 01000 0 [BACKEND] WARNING: could not create any HA TCP/IP sockets 2024-11-08 07:29:45.208 672d4d69.1 [unknown] 139742442641856 [unknown] 0 dn_6001 01000 0 [BACKEND] WARNING: Failed to initialize the memory protect for g_instance.attr.attr_storage.cstore_buffers (1024 Mbytes) or shared memory (4482 Mbytes) is larger. ========================================= Successfully started. [root@gauss1 upgrade]# su - omm -c "gsql -d postgres -p 15400 -c \"select working_version_num();\"" working_version_num --------------------- 92954 (1 row) [root@gauss1 upgrade]# cat version.cfg openGauss-Server-6.0.0 92.954 aee4abd5 release
failed to connect /usr/bin/gaussdb/tmp:15400. failed to connect /usr/bin/gaussdb/tmp:15400. failed to connect /usr/bin/gaussdb/tmp:15400. failed to connect /usr/bin/gaussdb/tmp:15400.