首页 > 数据库 > > 数据库管理工具-gs_upgradectl
用户会根据GaussDB 100提供的新特性,确定是否对现有系统进行升级。
如果升级过程中出现异常导致升级失败,并且自动回滚失败时,需要用户自动执行回滚命令进行手动回滚。
gs_upgradectl -t upgrade-type -X XMLFILE [-l LOGFILE]自动升级集群
gs_upgradectl -t auto-upgrade -X XMLFILE [-l LOGFILE]自动回滚集群
gs_upgradectl -t auto-rollback -X XMLFILE [-l LOGFILE]二进制升级集群
gs_upgradectl -t binary-upgrade -X XMLFILE [-l LOGFILE]二进制回滚集群
gs_upgradectl -t binary-rollback -X XMLFILE [-l LOGFILE]小版本升级集群
gs_upgradectl -t systable-upgrade -X XMLFILE [-l LOGFILE]小版本升级回滚
gs_upgradectl -t systable-rollback -X XMLFILE [-l LOGFILE]升级提交
gs_upgradectl -t commit-upgrade -X XMLFILE [-l LOGFILE]显示帮助信息
gs_upgradectl { -? | --help }显示版本号信息
gs_upgradectl { -V | --version }参数说明
gs_upgradectl命令的类型。
取值范围:upgrade-type、auto-upgrade、auto-rollback、binary-upgrade、binary-rollback、systable-upgrade、systable-rollback和commit-upgrade。
用于记录升级或回滚过程中的日志信息。
取值范围:任意存在的可访问的绝对路径。
默认值:$GAUSSLOG/om/gs_upgradectl.log
显示帮助信息。
显示版本号信息。
指定集群配置文件。
取值范围:xml文档的存储路径。
omm@plat1:/opt/software/gaussdb/script> gs_upgradectl -t auto-upgrade -X /opt/software/gaussdb/ClusterConfig.xml
Performing systable-upgrade.
Performing rollback.
No need to rollback.
Checking cluster health.
Successfully checked cluster health.
Checking database status.
Successfully checked database status.
Switching redo log file for primary dn.
Successfully switch redo log for primary dn.
Checking LSN for dns.
Successfully checking LSN for dns.
Deleting archive_log for dns.
Successfully Deleted archive_log for dns.
Generating upgrade sql file.
Successfully generated upgrade sql file.
Generating combined upgrade sql file.
Successfully generated combined upgrade sql file.
Backing up current application and configurations.
Successfully backed up current application and configurations.
Saving system tabls path.
Successfully saved system tables path.
Saving redo log file path.
Successfully saved redolog file path.
Saving undo log file path.
Successfully saved redolog file path.
Stopping the cluster.
Successfully stopped the cluster.
Starting all dns to open status for backuping system ctrl and redolog.
Successfully started all dns to open status for backuping system ctrl and redolog.
Backing up current system tables.
Successfully backed up system tables.
Backing up current ctrl files.
Successfully backed up ctrl files.
Backing up current redolog files.
Successfully backed up redolog files.
Backing up current undolog files.
Successfully backed up undolog files.
Backing up current kudu.
Successfully backed up kudu.
Shutdowning all dns for backuping system ctrl and redolog.
Successfully shutdown all dns for backuping system ctrl and redolog.
Starting the primary dn to open status for covering ctrl and redolog.
Successfully started the primary dn to open status for covering ctrl and redolog.
Shuting down the primary dn for covering ctrl and redolog.
Successfully shutdowned the primary dn to open status for covering ctrl and redolog.
Upgrading application.
Successfully upgraded application.
Starting the restricted mode cluster.
Successfully started the restricted mode cluster.
Upgrading the system table
Successfully upgraded the system table
Shutting down the restricted mode cluster
Successfully shut down the restricted mode cluster
Starting the dns to open status.
Successfully started the dns to open status.
Shutting down the open status dns.
Successfully shutted down the open status dns.
Starting the etcd.
Successfully started the etcd.
Loading the json.
Successfully loaded the json.
Starting cm agent.
Successfully started cm agent.
Starting the cluster.
Successfully started the cluster.
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/software/gaussdb/clusterconfig.xml
Time for "UpgradeCheck" : 29.3515 seconds
Time for "UpgradeBackup" : 19.7635 seconds
Time for "UpgradeStopCluster" : 23.9331 seconds
Time for "UpgradeBackupSysCtrlRedo" : 73.8159 seconds
Time for "UpgradeCoverCtrlRedo" : 81.3543 seconds
Time for "Upgrade" : 3.9485 seconds
Time for "KernelUpgrade" : 103.603 seconds
Time for "ShutdownRestrict" : 13.0126 seconds
Time for "StartOpen" : 16.2596 seconds
Time for "ShutdownOpen" : 8.4706 seconds
Time for "SystemTable" : 291.2652 seconds
Time for "UpgradeStartCluster" : 88.7027 seconds
Time for "Total" : 628.4768 secondsomm@plat1:~> gs_upgradectl -t binary-upgrade -X /opt/software/gaussdb/clusterconfig.xml
Performing binary upgrade.
Performing rollback.
No need to rollback.
Checking cluster health.
Successfully checked cluster health.
Backing up current application and configurations.
Successfully backed up current application and configurations.
Stopping the cluster.
Successfully stopped the cluster.
Upgrading application.
Successfully upgraded application.
Starting the etcd.
Successfully started the etcd.
Loading the json.
Successfully loaded the json.
Starting cm agent.
Successfully started cm agent.
Starting the cluster.
Successfully started the cluster.
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 /home/xml/green_3c1d2s.xml
Time for "UpgradeCheck" : 0.5707 seconds
Time for "UpgradeBackup" : 15.3427 seconds
Time for "UpgradeStopCluster" : 16.7897 seconds
Time for "Upgrade" : 4.3377 seconds
Time for "UpgradeStartCluster" : 66.1169 seconds
Time for "Total" : 116.0948 secondsomm@plat1:~> gs_upgradectl -t systable-upgrade -X /opt/software/gaussdb/clusterconfig.xml
Performing systable-upgrade
Performing rollback.
No need to rollback.
Checking cluster health.
Successfully checked cluster health.
Checking database status.
Successfully checked database status.
Switching redo log file for primary dn.
Successfully switch redo log for primary dn.
Checking LSN for dns.
Successfully checking LSN for dns.
Deleting archive_log for dns.
Successfully Deleted archive_log for dns.
Generating upgrade sql file.
Successfully generated upgrade sql file.
Generating combined upgrade sql file.
Successfully generated combined upgrade sql file.
Backing up current application and configurations.
Successfully backed up current application and configurations.
Saving system tabls path.
Successfully saved system tables path.
Saving redo log file path.
Successfully saved redolog file path.
Saving undo log file path.
Successfully saved redolog file path.
Stopping the cluster.
Successfully stopped the cluster.
Starting all dns to open status for backuping system ctrl and redolog.
Successfully started all dns to open status for backuping system ctrl and redolog.
Backing up current system tables.
Successfully backed up system tables.
Backing up current ctrl files.
Successfully backed up ctrl files.
Backing up current redolog files.
Successfully backed up redolog files.
Backing up current undolog files.
Successfully backed up undolog files.
Backing up current kudu.
Successfully backed up kudu.
Shutdowning all dns for backuping system ctrl and redolog.
Successfully shutdown all dns for backuping system ctrl and redolog.
Starting the primary dn to open status for covering ctrl and redolog.
Successfully started the primary dn to open status for covering ctrl and redolog.
Shuting down the primary dn for covering ctrl and redolog.
Successfully shutdowned the primary dn to open status for covering ctrl and redolog.
Upgrading application.
Successfully upgraded application.
Starting the restricted mode cluster.
Successfully started the restricted mode cluster.
Upgrading the system table
Successfully upgraded the system table
Shutting down the restricted mode cluster
Successfully shut down the restricted mode cluster
Starting the dns to open status.
Successfully started the dns to open status.
Shutting down the open status dns.
Successfully shutted down the open status dns.
Starting the etcd.
Successfully started the etcd.
Loading the json.
Successfully loaded the json.
Starting cm agent.
Successfully started cm agent.
Starting the cluster.
Successfully started the cluster.
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/software/gaussdb/clusterconfig.xml
Time for "UpgradeCheck" : 29.3515 seconds
Time for "UpgradeBackup" : 19.7635 seconds
Time for "UpgradeStopCluster" : 23.9331 seconds
Time for "UpgradeBackupSysCtrlRedo" : 73.8159 seconds
Time for "UpgradeCoverCtrlRedo" : 81.3543 seconds
Time for "Upgrade" : 3.9485 seconds
Time for "KernelUpgrade" : 103.603 seconds
Time for "ShutdownRestrict" : 13.0126 seconds
Time for "StartOpen" : 16.2596 seconds
Time for "ShutdownOpen" : 8.4706 seconds
Time for "SystemTable" : 291.2652 seconds
Time for "UpgradeStartCluster" : 88.7027 seconds
Time for "Total" : 628.4768 seconds
以二进制升级的回滚为例。
omm@plat1:/opt/software/gaussdb/script> gs_upgradectl -t auto-rollback -X /opt/software/gaussdb/ClusterConfig.xml
Performing rollback.
Restoring application and configurations.
Successfully restored application and configuration.
Restoring cluster configuration.
Successfully restored cluster configuration.
Restarting the ETCD.
Successfully restarted the ETCD.
Loading the configuration file.
Successfully loaded the configuration file.
Starting the cluster.
Successfully started the cluster.
Rollback succeeded.
omm@plat1:/opt/software/gaussdb/script> gs_upgradectl -t systable-rollback -X /opt/software/gaussdb/ClusterConfig.xml
Performing rollback.
Rollbacking for systable upgrade.
Successfully rollbacked for systable upgrade.
Restoring application and configurations.
Successfully restored application and configuration.
Shuting down the primary dn for covering ctrl and redolog.
Successfully shutdowned the primary dn to open status for covering ctrl and redolog.
Shutdowning all dns before restoring system ctrl and redolog.
Shutdowning all dns before restoring system ctrl and redolog.
Rollbacking for cntl, redolog and undolog.
Successfully rollbacked for cntl, redolog and undolog.
Rollbacking for kudu.
Successfully rollbacked for kudu.
Starting all dns to open status after restoring system ctrl and redolog.
Successfully started all dns to open status after restoring system ctrl and redolog.
Shutdowning all dns after restoring system ctrl and redolog.
Successfully shutdown all dns after restoring system ctrl and redolog.
Shuting down the primary dn for covering ctrl and redolog.
Successfully shutdowned the primary dn to open status for covering ctrl and redolog.
Shutdowning all dns for backuping system ctrl and redolog.
Successfully shutdown all dns for backuping system ctrl and redolog.
Restarting the ETCD.
Successfully restarted the ETCD.
Loading the configuration file.
Successfully loaded the configuration file.
Starting the cluster.
Successfully started the cluster.
Rollback succeeded.omm@plat1:/opt/software/gaussdb/script> gs_upgradectl -t commit-upgrade -X /opt/software/gaussdb/ClusterConfig.xml
Commit systable-upgrade succeeded.omm@plat1:/opt/software/gaussdb/script> gs_upgradectl -t commit-upgrade -X /opt/software/gaussdb/ClusterConfig.xml
Commit binary-upgrade succeeded.来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/69959250/viewspace-3132033/ ,如需转载,请注明出处,否则将追究法律责任。