概述
升级方式的选择
升级版本要求

1.只能低版本升级到高版本。 2.按照发布时间,只能发布时间早的版本升级到发布时间晚的版本。
升级注意事项
升级流程


环境说明

升级前的准备
升级包下载

[root@master etc]# uname -r
4.19.90-52.15.v2207.ky10.x86_64
# mkdir opt/software/openGauss6.0
拷贝安装包到/opt/software/openGauss6.0目录下
# cd openGauss6.0/
[root@master openGauss6.0]# ls
openGauss-All-6.0.0-openEuler20.03-x86_64.tar.gz
[root@master openGauss6.0]# tar -xf openGauss-All-6.0.0-openEuler20.03-x86_64.tar.gz
[root@master openGauss6.0]# tar -xf openGauss-OM-6.0.0-openEuler20.03-x86_64.tar.gz
[root@master openGauss6.0]# chown -R omm.dbgrp opt/software/openGauss6.0/
[root@master openGauss6.0]# ls -lrt
total 304868
-rw------- 1 omm dbgrp 564488 Sep 29 18:56 upgrade_sql.tar.gz
-rw------- 1 omm dbgrp 65 Sep 29 18:56 upgrade_sql.sha256
drwxr-x--- 11 omm dbgrp 4096 Sep 29 18:57 script
drwxr-x--- 19 omm dbgrp 4096 Sep 29 18:57 lib
-rw-r----- 1 omm dbgrp 35 Sep 29 18:57 version.cfg
-rw-r----- 1 omm dbgrp 24106389 Sep 29 18:57 openGauss-OM-6.0.0-openEuler20.03-x86_64.tar.gz
-rw-r----- 1 omm dbgrp 65 Sep 29 18:57 openGauss-OM-6.0.0-openEuler20.03-x86_64.sha256
-rw-r----- 1 omm dbgrp 109556000 Sep 29 18:59 openGauss-Server-6.0.0-openEuler20.03-x86_64.tar.bz2
-rw-r----- 1 omm dbgrp 65 Sep 29 18:59 openGauss-Server-6.0.0-openEuler20.03-x86_64.sha256
-rw-r----- 1 omm dbgrp 22539204 Sep 29 18:59 openGauss-CM-6.0.0-openEuler20.03-x86_64.tar.gz
-rw-r----- 1 omm dbgrp 0 Sep 29 18:59 openGauss-CM-6.0.0-openEuler20.03-x86_64.sha256
-rw-r--r-- 1 omm dbgrp 155382743 Nov 7 13:58 openGauss-All-6.0.0-openEuler20.03-x86_64.tar.gz
备份数据
升级前的检查
# java -version
openjdk version "1.8.0_312"
OpenJDK Runtime Environment Bisheng (build 1.8.0_312-b07)
OpenJDK 64-Bit Server VM Bisheng (build 25.312-b07, mixed mode)
操作系统检查
--使用root,运行gs_checkos工具
# cd opt/software/openGauss6.0/script
# gs_checkos -i A -h master,slave --detail
Checking items:
A1. [ OS version status ] : Normal
[master]
kylin_10_64bit
[slave]
kylin_10_64bit
A2. [ Kernel version status ] : Normal
The names about all kernel versions are same. The value is "4.19.90-52.15.v2207.ky10.x86_64".
A3. [ Unicode status ] : Normal
The values of all unicode are same. The value is "LANG=en_US.UTF-8".
A4. [ Time zone status ] : Normal
The informations about all timezones are same. The value is "+0800".
A5. [ Swap memory status ] : Normal
The value about swap memory is correct.
A6. [ System control parameters status ] : Normal
All values about system control parameters are correct.
A7. [ File system configuration status ] : Normal
Both soft nofile and hard nofile are correct.
A8. [ Disk configuration status ] : Normal
The value about XFS mount parameters is correct.
A9. [ Pre-read block size status ] : Normal
The value about Logical block size is correct.
BondMode Null
A11.[ Network card configuration status ] : Warning
[slave]
BondMode Null
Warning reason: network 'ens33' 'mtu' RealValue '1500' ExpectedValue '8192'
[master]
BondMode Null
Warning reason: network 'ens33' 'mtu' RealValue '1500' ExpectedValue '8192'
A12.[ Time consistency status ] : Warning
[master]
The NTPD not detected on machine and local time is "2024-11-07 14:16:20".
[slave]
The NTPD not detected on machine and local time is "2024-11-07 14:16:23".
A13.[ Firewall service status ] : Normal
The firewall service is stopped.
A14.[ THP service status ] : Normal
The THP service is stopped.
Total numbers:13. Abnormal numbers:0. Warning numbers:2.
$ df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 3.3G 0 3.3G 0% dev
tmpfs 8.0G 16K 8.0G 1% dev/shm
tmpfs 3.3G 9.6M 3.3G 1% run
tmpfs 3.3G 0 3.3G 0% sys/fs/cgroup
/dev/mapper/klas-root 52G 11G 42G 20%
tmpfs 3.3G 4.0K 3.3G 1% tmp
/dev/sda1 1014M 177M 838M 18% boot
tmpfs 667M 36K 666M 1% run/user/0
数据库的状态检查
[omm@master ~]$ gs_om -t status
-----------------------------------------------------------------------
cluster_name : dbCluster
cluster_state : Normal
redistributing : No
-----------------------------------------------------------------------
升级过程
配置文件复制到升级目录
# cp opt/software/openGauss5.0/cluster_config.xml opt/software/openGauss6.0/
升级前执行前置脚本
# cd opt/software/openGauss6.0
# script/gs_preinstall -U omm -G dbgrp -X cluster_config.xml

执行升级脚本
[root@master openGauss6.0]# su - omm
Last login: Thu Nov 7 14:35:50 CST 2024
[omm@master ~]$ cd opt/software/openGauss6.0/
[omm@master openGauss6.0]$ gs_upgradectl -t auto-upgrade -X cluster_config.xml --grey
while true;do
gsql -U omm -d postgres -p 15400 -c "select sysdate";
sleep 1;
done



升级后验证
[omm@master ~]$ gsql -V
gsql (openGauss 6.0.0 build aee4abd5) compiled at 2024-09-29 18:39:52 commit 0 last mr
[omm@master ~]$ gaussdb -V
gaussdb (openGauss 6.0.0 build aee4abd5) compiled at 2024-09-29 18:39:52 commit 0 last mr
[omm@master ~]$ gs_om -t status
-----------------------------------------------------------------------
cluster_name : dbCluster
cluster_state : Normal
redistributing : No
-----------------------------------------------------------------------
提交升级
说明: 一旦提交操作完成,则不能再执行回滚操作。
[omm@master openGauss6.0]$ gs_upgradectl -t commit-upgrade -X /opt/software/openGauss6.0/cluster_config.xml
Start to do health check.
Successfully checked cluster status.
Start check CMS parameter.
Successfully cleaned old install path.
Commit upgrade succeeded.
文章转载自openGauss,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




