openGauss数据库3.0.0升级5.0.0操作实践
文章目录
- 1.1 前言
- 1.2 升级须知
-
- 升级流程
- 升级方式
- 升级约束
- 1.3 升级前准备
- 1.4 升级操作
- 1.5 升级验证
- 1.6 提交升级
1.1 前言
openGauss是一款开源关系型数据库管理系统,采用木兰宽松许可证v2发行。之前基于3.0.0版本进行了一些实践,本篇就详细介绍如何将openGauss数据库从3.0.0升级到最新发布的5.0.0版本。
1.2 升级须知
升级流程
升级方式
用户挑选升级方式后,系统会自动判断并选择合适的升级策略。
- 就地升级:升级期间需停止业务进行,一次性升级所有节点。
- 灰度升级:灰度升级支持全业务操作,也是一次性升级所有节点。(openGauss1.1.0版本之后的版本支持该功能)
- 滚动升级:基于灰度升级,支持升级指定节点,支持部分节点升级。(openGauss3.1.0版本之后的版本支持该功能)。
本次我们采用灰度升级方式。
升级约束
升级约束官网文档详细列出,具体就不再一一列举。主要就是升级期间不要做增删改。生产和商业环境务必按照要求执行。
1.3 升级前准备
1.检查OS。
[root@hecs-1105531 etc]# cat centos-release CentOS Linux release 7.6.1810 (Core)
2.检查升级前版本
[omm@hecs-1105531 ~]$ gsql --version gsql (openGauss 3.0.0 build 02c14696) compiled at 2022-04-01 18:12:34 commit 0 last mr
3.查看数据库节点磁盘使用率,低于80%时再执行升级操作。
[omm@hecs-1105531 ~]$ df -h Filesystem Size Used Avail Use% Mounted on devtmpfs 1.9G 0 1.9G 0% /dev tmpfs 1.9G 24K 1.9G 1% /dev/shm tmpfs 1.9G 175M 1.7G 10% /run tmpfs 1.9G 0 1.9G 0% /sys/fs/cgroup /dev/vda1 40G 9.3G 28G 25% / tmpfs 379M 0 379M 0% /run/user/0
4.以数据库用户(如omm)登录节点,确认数据库状态Normal。
[omm@hecs-1105531 ~]$ gs_om -t status -------------------------------------------------------------------- cluster_name : ogCluster cluster_state : Normal redistributing : No ----------------------------------------------------------------------
5.以root用户执行如下命令对服务器的OS参数进行检查。检查服务器的OS参数的目的是为了保证数据库正常通过预安装,并且在安装成功后可以安全高效的运行。详细的检查项目请参见《工具参考》中的“服务端工具 > gs_checkos”工具。
cd /root/gauss_om/omm/script/ gs_checkos -i A
6.官网并没有单独的升级包,所以根据情况获取新的版本包。本次操作的基础版本是centos企业版,继续获取5.0.0企业版。
https://opengauss.org/zh/download.html
7.手动备份
升级一旦失败,有可能会影响到业务的正常开展。如有重要数据,请参考《数据库运维指南》中的“备份与恢复”章节,完成数据的备份。
1.4 升级操作
1.root用户创建新包目录。
mkdir -p /opt/software/gaussdb_upgrade
2.将需要更新的新包上传至目录“/opt/software/gaussdb_upgrade”并解压。
[root@hecs-1105531 script]# mkdir -p /opt/software/gaussdb_upgrade [root@hecs-1105531 script]# cp /opt/software/openGauss-5.0.0-CentOS-64bit-all.tar.gz /opt/software/gaussdb_upgrade/ [root@hecs-1105531 script]# cd /opt/software/gaussdb_upgrade [root@hecs-1105531 gaussdb_upgrade]# tar -zxvf openGauss-5.0.0-CentOS-64bit-all.tar.gz [root@hecs-1105531 gaussdb_upgrade]# tar -zxvf openGauss-5.0.0-CentOS-64bit-om.tar.gz
3.进入安装包解压出的script目录下,在升级前执行前置脚本gs_preinstall。cluster_config.xml是之前安装基础版本时所使用的那个文件。
cd /opt/software/gaussdb_upgrade/script ./gs_preinstall -U omm -G dbgrp -X /opt/software/openGauss/cluster_config.xml
执行过程如下
[root@hecs-1105531 script]# ./gs_preinstall -U omm -G dbgrp -X /opt/software/openGauss/cluster_config.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 host ip env Successfully set host ip env. Are you sure you want to create the user[omm] (yes/no)? no Preparing SSH service. Successfully prepared SSH service. Checking OS software. Successfully check os software. 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. Warning: Installation environment contains some warning messages. Please get more details by "/opt/software/gaussdb_upgrade/script/gs_checkos -i A -h hecs-1105531 --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.
4.切换至omm用户 使用如下命令进行就地升级或者灰度升级。最后提示successfully upgrade all nodes.就可以了。
[omm@hecs-1105531 ~]$ gs_upgradectl -t auto-upgrade -X /opt/software/openGauss/cluster_config.xml --grey Static configuration matched with old static configuration files. Successfully set upgrade_mode to 0. Checking upgrade environment. Successfully checked upgrade environment. Start to do health check. Successfully checked cluster status. Upgrade one node 'hecs-1105531'. NOTICE: The directory /opt/huawei/install/app_02c14696 will be deleted after commit-upgrade, please make sure there is no personal data. Performing grey rollback. No need to rollback. The directory /opt/huawei/install/app_02c14696 will be deleted after commit-upgrade, please make sure there is no personal data. Installing new binary. copy certs from /opt/huawei/install/app_02c14696 to /opt/huawei/install/app_a07d57c3. Successfully copy certs from /opt/huawei/install/app_02c14696 to /opt/huawei/install/app_a07d57c3. 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. 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 hecs-1105531 192.168.0.243 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 The nodes ['hecs-1105531'] have been successfully upgraded to new version. Then do health check. Start to do health check. Successfully checked cluster status. 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: gs_upgradectl -t commit-upgrade -X /opt/software/openGauss/cluster_config.xml Successfully upgrade all nodes.
1.5 升级验证
以数据库用户(如omm)执行如下命令查看数据库状态,查询结果的cluster_state为Normal代表数据库正常。
gs_om -t status gs_ssh -c "gsql -V"
用户可以自行验证其他数据库对象。
1.6 提交升级
升级完成后,如果验证也没问题,接下来就可以提交升级,需要注意的是,一旦提交操作完成,则不能再执行回滚操作。
以数据库用户(如omm)执行如下命令完成升级提交。
[omm@hecs-1105531 ~]$ gs_upgradectl -t commit-upgrade -X /opt/software/openGauss/cluster_config.xml
至此,openGauss3.0.0升级5.0.0版本完成。

低调大师中文资讯倾力打造互联网数据资讯、行业资源、电子商务、移动互联网、网络营销平台。
持续更新报道IT业界、互联网、市场资讯、驱动更新,是最及时权威的产业资讯及硬件资讯报道平台。
转载内容版权归作者及来源网站所有,本站原创内容转载请注明来源。
- 上一篇
GPT大语言模型Alpaca-lora本地化部署实践【大语言模型实践一】 | 京东云技术团队
模型介绍 Alpaca模型是斯坦福大学研发的LLM(Large Language Model,大语言)开源模型,是一个在52K指令上从LLaMA 7B(Meta公司开源的7B)模型微调而来,具有70亿的模型参数(模型参数越大,模型的推理能力越强,当然随之训练模型的成本也就越高)。 LoRA,英文全称Low-Rank Adaptation of Large Language Models,直译为大语言模型的低阶适应,这是微软的研究人员为了解决大语言模型微调而开发的一项技术。如果想让一个预训练大语言模型能够执行特定领域内的任务,一般需要做fine-tuning,但是目前推理效果好的大语言模型参数维度非常非常大,有些甚至是上千亿维,如果直接在大语言模型上做fine-tuning,计算量会非常的大,成本也会非常的高。 ’LoRA的做法是冻结预训练好的模型参数,然后在每个Transformer块里注入可训练的层,由于不需要对模型的参数重新计算梯度,所以,会大大的减少计算量。 具体如下图所示,核心思想是在原始预训练模型增加一个旁路,做一个降维再升维的操作。训练的时候固定预训练模型的参数,只训练降维...
- 下一篇
🚀 分布式监控系统 WGCLOUD v3.4.7 正式发布 新增主机异常进程监测
WGCLOUD是一款集成度较高的分布式运维监控平台,具有集群监控,易部署、易上手使用、轻量、高效、自动化等特点,server 端基于springboot 开发,agent 端使用 go 编写。核心模块包括:主机系统信息监控,CPU 监控,CPU 温度监控,内存监控,网络流量监控,磁盘 IO 监控,磁盘空间监测,系统负载监控,硬盘 smart 健康检测,应用进程监控,端口监控,docker 监控,日志文件监控,文件防篡改保护,数据可视化监控,自动生成拓扑图、大屏可视化,数通设备监测,服务接口监测,设备账号管理,web ssh ,指令下发,告警信息(邮件、钉钉、微信等)推送 码云仓库:https://gitee.com/wanghouhou/wgcloud GITHUB 仓库:https://github.com/tianshiyeben/wgcloud WGCLOUD 唯一官网:http://www.wgstart.com WGCLOUD 支持监测的操作系统平台 支持监测 Linux 系列:Debian、RedHat、CentOS、Ubuntu、Fedora、麒麟、统信 (UOS)、龙芯...
相关文章
文章评论
共有0条评论来说两句吧...