用户根据openGauss提供的新特性和数据库现状,确定是否对现有系统进行升级。
当前支持的升级模式为就地升级和灰度升级。升级方式的策略又分为大版本升级和小版本升级。
用户挑选升级方式后,系统会自动判断并选择合适的升级策略。
就地升级:升级期间需停止业务进行,一次性升级所有节点。
灰度升级:灰度升级支持全业务操作,也是一次性升级所有节点(openGauss1.1.0版本之后的版本支持该功能)。
显示帮助信息
gs_upgradectl -? | --help
显示版本号信息
gs_upgradectl -V | --version
选择升级策略
gs_upgradectl -t chose-strategy [-l LOGFILE]
自动升级openGauss
gs_upgradectl -t auto-upgrade -X XMLFILE [-l LOGFILE] [--grey]
自动回滚升级
gs_upgradectl -t auto-rollback -X XMLFILE [-l LOGFILE] [--force]
升级提交
gs_upgradectl -t commit-upgrade -X XMLFILE [-l LOGFILE]
说明:
- 一旦提交操作完成,则不能再执行回滚操作。
-t
gs_upgradectl命令的类型。
取值范围:chose-strategy、auto-upgrade、auto-rollback和commit-upgrade。
-l
用于记录升级或回滚过程中的日志信息。
取值范围:任意存在的可访问的绝对路径。
默认值:/var/log/gaussdb/用户名/om/gs_upgradectl-YYYY-MM-DD_hhmmss.log
-?, --help
显示帮助信息。
-V, --version
显示版本号信息。
-X
指定openGauss配置文件。
取值范围:xml文件的存储路径。
--grey
使用灰度升级方式来进行升级操作。
--force
当openGauss状态不正常,无法支持正常回滚时,用此参数进行强制回滚操作。
示例一:升级前使用新包进行前置操作。
./gs_preinstall -U roach -G users -X /data/xml/3node_3c3d_1m2s_etcd.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 pssh path
Successfully set core path.
Distributing package.
Begin to distribute package to tool path.
Successfully distribute package to tool path.
Begin to distribute package to package path.
Successfully distribute package to package path.
Successfully distributed package.
Installing the tools in the cluster.
Successfully installed the tools in the cluster.
Checking hostname mapping.
Successfully checked hostname mapping.
Checking OS version.
Successfully checked OS version.
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.
Preparing SSH service.
Successfully prepared SSH service.
Setting user environmental variables.
Successfully set user environmental variables.
Configuring alarms on the cluster nodes.
Successfully configured alarms on the cluster nodes.
Setting the dynamic link library.
Successfully set the dynamic link library.
Setting pssh path
Successfully set pssh path.
Setting Cgroup.
Successfully set Cgroup.
Set ARM Optimization.
Successfully set ARM Optimization.
Preinstalling secbox.
Successfully installed secbox.
Setting finish flag.
Successfully set finish flag.
Preinstallation succeeded.
**示例二:**使用gs_upgradectl脚本执行就地升级。
gs_upgradectl -t upgrade -X /data/xml/3node_3c3d_1m2s_etcd.xml
Static configuration matched with old static configuration files.
Performing inplace rollback.
Rollback succeeded.
Checking upgrade environment.
Successfully checked 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.
Stopping the cluster.
Successfully stopped cluster.
Backing up cluster configuration.
Successfully backup hotpatch config file.
Successfully backed up cluster configuration.
Installing new binary.
Restoring cluster configuration.
Successfully restored cluster configuration.
Modifying the socket path.
Successfully modified socket path.
Switch symbolic link to new binary directory.
Successfully switch symbolic link to new binary directory.
Successfully started cluster.
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 /data/xml/3node_3c3d_1m2s_etcd.xml
**示例三:**使用gs_upgradectl脚本执行自动回滚,撤销已经成功/失败的升级操作(升级回滚)。
gs_upgradectl -t auto-rollback -X /data/xml/3node_3c3d_1m2s_etcd.xml
Static configuration matched with old static configuration files.
Performing inplace rollback.
Checking static configuration files.
Successfully checked static configuration files.
Restoring cluster configuration.
Successfully rollback hotpatch config file.
Successfully restored cluster configuration.
Switch symbolic link to old binary directory.
Successfully switch symbolic link to old binary directory.
Stopping the cluster.
Successfully stopped cluster.
Restoring application and configurations.
Successfully restored application and configuration.
Restoring cluster configuration.
Successfully rollback hotpatch config file.
Successfully restored cluster configuration.
Successfully started cluster.
Successfully cleaned new install path.
Rollback succeeded.
**示例四:**使用gs_upgradectl脚本执行升级后提交(升级提交)。
gs_upgradectl -t commit -X /data/xml/3node_3c3d_1m2s_etcd.xml
Old cluster app path is /data/gauss/app_e67b8bcd
Successfully Cleaned old install path.
Commit binary upgrade succeeded.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。