升级操作
介绍就地升级、灰度升级和滚动升级的详细操作。
就地升级和灰度升级操作步骤
- 以root身份登录节点。
- 创建新包目录。
1. mkdir -p /opt/software/gaussdb_upgrade
3. 将需要更新的新包上传至目录“/opt/software/gaussdb_upgrade”并解压。
4. 进入安装包解压出的script目录下:
1. cd /opt/software/gaussdb_upgrade/script
5. 在就地升级或灰度升级前执行前置脚本gs_preinstall。
1. ./gs_preinstall -U omm -G dbgrp -X /opt/software/GaussDB_Kernel/clusterconfig.xml
6. 切换至omm用户。
1. su - omm
7. 数据库状态正常时,使用如下命令进行就地升级或者灰度升级。
示例一:使用gs_upgradectl脚本执行就地升级。
1. gs_upgradectl -t auto-upgrade -X /opt/software/GaussDB_Kernel/clusterconfig.xml
示例二:使用gs_upgradectl脚本执行灰度升级。
1. gs_upgradectl -t auto-upgrade -X /opt/software/GaussDB_Kernel/clusterconfig.xml --grey
8. 数据库状态正常时,使用如下命令进行滚动升级。
示例一:使用gs_upgradectl脚本执行指定单节点升级。
1. gs_upgradectl -t auto-upgrade -X /opt/software/GaussDB_Kernel/clusterconfig.xml --grey -h hostname0
示例二:使用gs_upgradectl脚本执行指定多节点升级。
1. gs_upgradectl -t auto-upgrade -X /opt/software/GaussDB_Kernel/clusterconfig.xml --grey -h hostname0,hostname1
9. 数据库状态正常时,使用如下命令进行升级剩余节点。
1. gs_upgradectl -t auto-upgrade -X /opt/software/GaussDB_Kernel/clusterconfig.xml --grey --continue
