GreenPlum版本升级

📢📢📢📣📣📣
哈喽!大家好,我是【IT邦德】,江湖人称jeames007,10余年DBA及大数据工作经验
一位上进心十足的【大数据领域博主】!😜😜😜
中国DBA联盟(ACDU)成员,目前服务于工业互联网
擅长主流Oracle、MySQL、PG、高斯及Greenplum运维开发,备份恢复,安装迁移,性能优化、故障应急处理等。
✨ 如果有对【数据库】感兴趣的【小可爱】,欢迎关注【IT邦德】💞💞💞
❤️❤️❤️感谢各位大可爱小可爱!❤️❤️❤️

文章目录

  • 前言
    • 📣 1.升级简介
      • ✨ 1.1 大版本升级
      • ✨ 1.2 小版本升级
    • 📣 2. 6.23升级到6.24
      • ✨ 2.1 升级前检查
      • ✨ 2.2 所有节点软件升级
    • 📣 3.启动集群

前言

Greenplum版本升级的详细过程,此博客做了详细的介绍。

📣 1.升级简介

greenplum 升级分两种:大版本升级:跨越主版本的升级,比如 4.3 or 5 升级到 6,6升级到7
小版本升级:主版本内的升级,比如6.x to 6.newer

✨ 1.1 大版本升级

Greenplum 从5.28版本开始可以直接使用gpupgrade工具升级到6.9及以后的版本
https://github.com/greenplum-db/gpupgradegpupgrade 是一个用于 Greenplum 数据库版本升级的工具,它提供了一种简单的方法来将 Greenplum 数据库集群从一个主要版本升级到另一个主要版本。
对于GP4.3版本的数据库,如果升级到6,需要通过备份恢复的方式,可以使用gpbackup、gprestore或gpcopy 工具来实现,这种方式同样适用于GP5 to GP6以gpcopy命令,以4.3 升级到 6 为例,升级流程如下:
1)对原集群做好备份,并保证备份可用,如果升级失败需要原集群继续提供服务
2)准备GP6集群,保证集群状态可用
3)确保有足够的磁盘空间可以保留备份文件,建议数据库的5倍大小
4)如果磁盘不够,使用gpcopy(4.3.26及以上版本 or 5.9及以上版本)命令,不建议使用–truncate-source-after参数
5)对于GP6不兼容的扩展模块,需要在备份之前或者在restore的时候需要排除相关的表
6)GP6 的系统表、系统视图及函数变化比较大,留好操作日志,便于修复gpupgrade 的升级流程大致如下:
1)确认环境:在开始升级之前,需要确认源和目标 Greenplum 数据库版本的兼容性,并确保升级环境满足一些先决条件,如空间和内存等资源。
2)预升级检查:运行 gpupgrade 工具的 pre-upgrade 子命令,它会检查是否满足升级所需的各种条件,例如必备软件版本、配置文件设置、备份等。
3)备份源数据库:在升级之前,需要对源数据库进行完整备份,以便在升级过程中发生意外情况时进行还原。
4)执行升级:运行 gpupgrade 工具的 upgrade 子命令,它会执行升级过程,包括关闭源数据库、备份源数据库、替换二进制文件、启动目标数据库等。
5)后升级检查:在升级完成后,运行 gpupgrade 工具的 post-upgrade 子命令,它会检查目标数据库是否成功启动,升级是否完成,并验证新版本的 Greenplum 数据库是否工作正常。
6)完成升级:在确认升级成功后,删除源数据库备份,清理 gpupgrade 工具的工作目录以及其他不必要的文件。

✨ 1.2 小版本升级

小版本升级步骤很简单,如下:
1、各个主机下载最新版本的安装包
2、master执行gpcheckcat -A检查所有库
3、master停库gpstop -a -M fast
4、直接安装新版本软件包:rpm -U open-source-greenplum-db-XXXXXX-rhel7-x86_64.rpm --nodeps
5、启库 gpstart -a
6、检查:gpstate -i

📣 2. 6.23升级到6.24

✨ 2.1 升级前检查

[gpadmin@master ~]$ gpcheckcat -AUsage: gpcheckcat [<option>] [dbname]-? | --help              : help menu-B parallel              : number of worker threads-g dir                   : generate SQL to rectify catalog corruption, put it in dir-p port                  : DB port number-P passwd                : DB password-U uname                 : DB User Name-v                       : verbose-A                       : all databases-S option                : shared table options (none, only)-O                       : Online-l                       : list all tests-R test | 'test1, test2' : run this particular test(s) (quoted, comma seperated list for multiple tests)-s test | 'test1, test2' : skip this particular test(s) (quoted, comma seperated list for multiple tests)-C catname               : run cross consistency, FK and ACL tests for this catalog tableTest subset options are mutually exclusive, use only one of '-R', '-s', or '-C'.[gpadmin@master ~]$ gpcheckcat -p5432 -A
Truncated batch size to number of primaries: 3Connected as user 'gpadmin' to database 'postgres', port '5432', gpdb version '6.23'
-------------------------------------------------------------------
Batch size: 3
Performing test 'unique_index_violation'
Total runtime for test 'unique_index_violation': 0:00:01.84
Performing test 'duplicate'
Total runtime for test 'duplicate': 0:00:01.62
Performing test 'missing_extraneous'
Total runtime for test 'missing_extraneous': 0:00:00.57
Performing test 'inconsistent'
Total runtime for test 'inconsistent': 0:00:01.59
Performing test 'foreign_key'
Total runtime for test 'foreign_key': 0:00:01.27
Performing test 'pgclass'
Total runtime for test 'pgclass': 0:00:00.06
Performing test 'namespace'
Total runtime for test 'namespace': 0:00:00.00
Performing test 'distribution_policy'
Total runtime for test 'distribution_policy': 0:00:00.00
Performing test 'dependency'
Total runtime for test 'dependency': 0:00:03.45
Performing test 'part_integrity'
Total runtime for test 'part_integrity': 0:00:00.05
Performing test 'part_constraint'
Total runtime for test 'part_constraint': 0:00:00.15
Performing test 'orphaned_toast_tables'
Total runtime for test 'orphaned_toast_tables': 0:00:00.77
Performing test 'aoseg_table'
Total runtime for test 'aoseg_table': 0:00:00.00SUMMARY REPORT
===================================================================
Completed 13 test(s) on database 'postgres' at 2023-06-04 19:06:05 with elapsed time 0:00:11
Found no catalog issueConnected as user 'gpadmin' to database 'rptdb', port '5432', gpdb version '6.23'
-------------------------------------------------------------------
Batch size: 3
Performing test 'unique_index_violation'
Total runtime for test 'unique_index_violation': 0:00:03.71
Performing test 'duplicate'
Total runtime for test 'duplicate': 0:00:02.73
Performing test 'missing_extraneous'
Total runtime for test 'missing_extraneous': 0:00:00.51
Performing test 'inconsistent'
Total runtime for test 'inconsistent': 0:00:01.36
Performing test 'foreign_key'
Total runtime for test 'foreign_key': 0:00:01.28
Performing test 'pgclass'
Total runtime for test 'pgclass': 0:00:00.04
Performing test 'namespace'
Total runtime for test 'namespace': 0:00:00.00
Performing test 'distribution_policy'
Total runtime for test 'distribution_policy': 0:00:00.00
Performing test 'dependency'
Total runtime for test 'dependency': 0:00:03.55
Performing test 'part_integrity'
Total runtime for test 'part_integrity': 0:00:00.02
Performing test 'part_constraint'
Total runtime for test 'part_constraint': 0:00:00.10
Performing test 'orphaned_toast_tables'
Total runtime for test 'orphaned_toast_tables': 0:00:00.07
Performing test 'aoseg_table'
Total runtime for test 'aoseg_table': 0:00:00.00SUMMARY REPORT
===================================================================
Completed 13 test(s) on database 'rptdb' at 2023-06-04 19:06:20 with elapsed time 0:00:13
Found no catalog issueConnected as user 'gpadmin' to database 'template1', port '5432', gpdb version '6.23'
-------------------------------------------------------------------
Batch size: 3
Performing test 'unique_index_violation'
Total runtime for test 'unique_index_violation': 0:00:03.95
Performing test 'duplicate'
Total runtime for test 'duplicate': 0:00:03.16
Performing test 'missing_extraneous'
Total runtime for test 'missing_extraneous': 0:00:00.46
Performing test 'inconsistent'
Total runtime for test 'inconsistent': 0:00:01.86
Performing test 'foreign_key'
Total runtime for test 'foreign_key': 0:00:01.27
Performing test 'pgclass'
Total runtime for test 'pgclass': 0:00:00.02
Performing test 'namespace'
Total runtime for test 'namespace': 0:00:00.00
Performing test 'distribution_policy'
Total runtime for test 'distribution_policy': 0:00:00.00
Performing test 'dependency'
Total runtime for test 'dependency': 0:00:01.98
Performing test 'part_integrity'
Total runtime for test 'part_integrity': 0:00:00.02
Performing test 'part_constraint'
Total runtime for test 'part_constraint': 0:00:00.11
Performing test 'orphaned_toast_tables'
Total runtime for test 'orphaned_toast_tables': 0:00:00.56
Performing test 'aoseg_table'
Total runtime for test 'aoseg_table': 0:00:00.00SUMMARY REPORT
===================================================================
Completed 13 test(s) on database 'template1' at 2023-06-04 19:06:34 with elapsed time 0:00:13
Found no catalog issue

✨ 2.2 所有节点软件升级

[root@master opt]# cd /usr/local/
[root@master local]# ll
total 0
drwxr-xr-x.  2 root    root      6 Apr 11  2018 bin
drwxr-xr-x.  2 root    root      6 Apr 11  2018 etc
drwxr-xr-x.  2 root    root      6 Apr 11  2018 games
lrwxrwxrwx   1 gpadmin gpadmin  30 Jun  4 12:08 greenplum-db -> /usr/local/greenplum-db-6.23.1
drwxr-xr-x  11 gpadmin gpadmin 238 Jun  4 12:08 greenplum-db-6.23.1
drwxr-xr-x.  2 root    root      6 Apr 11  2018 include
drwxr-xr-x.  2 root    root      6 Apr 11  2018 lib
drwxr-xr-x.  2 root    root      6 Apr 11  2018 lib64
drwxr-xr-x.  2 root    root      6 Apr 11  2018 libexec
drwxr-xr-x.  2 root    root      6 Apr 11  2018 sbin
drwxr-xr-x.  5 root    root     49 Jun  4 09:11 share
drwxr-xr-x.  2 root    root      6 Apr 11  2018 src##关闭集群
[root@master ~]# su - gpadmin
[gpadmin@master ~]$ gpstop -a
20230604:19:24:30:024309 gpstop:master:gpadmin-[INFO]:-Starting gpstop with args: -a
20230604:19:24:30:024309 gpstop:master:gpadmin-[INFO]:-Gathering information and validating the environment...
20230604:19:24:30:024309 gpstop:master:gpadmin-[INFO]:-Obtaining Greenplum Master catalog information
20230604:19:24:30:024309 gpstop:master:gpadmin-[INFO]:-Obtaining Segment details from master...
20230604:19:24:30:024309 gpstop:master:gpadmin-[INFO]:-Greenplum Version: 'postgres (Greenplum Database) 6.23.1 build commit:2731a45ecb364317207c560730cf9e2cbf17d7e4 Open Source'
20230604:19:24:30:024309 gpstop:master:gpadmin-[INFO]:-Commencing Master instance shutdown with mode='smart'
20230604:19:24:30:024309 gpstop:master:gpadmin-[INFO]:-Master segment instance directory=/greenplum/data/master/gpseg-1
20230604:19:24:30:024309 gpstop:master:gpadmin-[INFO]:-Stopping master segment and waiting for user connections to finish ...
server shutting down
20230604:19:24:31:024309 gpstop:master:gpadmin-[INFO]:-Attempting forceful termination of any leftover master process
20230604:19:24:31:024309 gpstop:master:gpadmin-[INFO]:-Terminating processes for segment /greenplum/data/master/gpseg-1
20230604:19:24:31:024309 gpstop:master:gpadmin-[INFO]:-No standby master host configured
20230604:19:24:31:024309 gpstop:master:gpadmin-[INFO]:-Targeting dbid [2, 3] for shutdown
20230604:19:24:31:024309 gpstop:master:gpadmin-[INFO]:-Commencing parallel segment instance shutdown, please wait...
20230604:19:24:31:024309 gpstop:master:gpadmin-[INFO]:-0.00% of jobs completed
20230604:19:24:32:024309 gpstop:master:gpadmin-[INFO]:-100.00% of jobs completed
20230604:19:24:32:024309 gpstop:master:gpadmin-[INFO]:-----------------------------------------------------
20230604:19:24:32:024309 gpstop:master:gpadmin-[INFO]:-   Segments stopped successfully      = 2
20230604:19:24:32:024309 gpstop:master:gpadmin-[INFO]:-   Segments with errors during stop   = 0
20230604:19:24:32:024309 gpstop:master:gpadmin-[INFO]:-----------------------------------------------------
20230604:19:24:32:024309 gpstop:master:gpadmin-[INFO]:-Successfully shutdown 2 of 2 segment instances
20230604:19:24:32:024309 gpstop:master:gpadmin-[INFO]:-Database successfully shutdown with no errors reported
20230604:19:24:32:024309 gpstop:master:gpadmin-[INFO]:-Cleaning up leftover gpmmon process
20230604:19:24:32:024309 gpstop:master:gpadmin-[INFO]:-No leftover gpmmon process found
20230604:19:24:32:024309 gpstop:master:gpadmin-[INFO]:-Cleaning up leftover gpsmon processes
20230604:19:24:32:024309 gpstop:master:gpadmin-[INFO]:-No leftover gpsmon processes on some hosts. not attempting forceful termination on these hosts
20230604:19:24:32:024309 gpstop:master:gpadmin-[INFO]:-Cleaning up leftover shared memory##安装最新版本的安装包,所有节点均执行
[root@master opt]# rpm -U open-source-greenplum-db-6.24.3-rhel7-x86_64.rpm --nodeps
[root@master opt]# chown -R gpadmin:gpadmin /usr/local/greenplum*[root@master opt]# cd /usr/local/
[root@master local]# ll
total 0
drwxr-xr-x.  2 root    root      6 Apr 11  2018 bin
drwxr-xr-x.  2 root    root      6 Apr 11  2018 etc
drwxr-xr-x.  2 root    root      6 Apr 11  2018 games
lrwxrwxrwx   1 gpadmin gpadmin  30 Jun  4 19:35 greenplum-db -> /usr/local/greenplum-db-6.24.3
drwxr-xr-x  11 gpadmin gpadmin 238 Jun  4 19:35 greenplum-db-6.24.3
drwxr-xr-x.  2 root    root      6 Apr 11  2018 include
drwxr-xr-x.  2 root    root      6 Apr 11  2018 lib
drwxr-xr-x.  2 root    root      6 Apr 11  2018 lib64
drwxr-xr-x.  2 root    root      6 Apr 11  2018 libexec
drwxr-xr-x.  2 root    root      6 Apr 11  2018 sbin
drwxr-xr-x.  5 root    root     49 Jun  4 09:11 share
drwxr-xr-x.  2 root    root      6 Apr 11  2018 src

📣 3.启动集群

[root@master ~]# su - gpadminLast login: Sun Jun  4 19:24:28 CST 2023 on pts/0
[gpadmin@master ~]$ gpstart -a
20230604:19:39:48:029329 gpstart:master:gpadmin-[INFO]:-Starting gpstart with args: -a
20230604:19:39:48:029329 gpstart:master:gpadmin-[INFO]:-Gathering information and validating the environment...
20230604:19:39:48:029329 gpstart:master:gpadmin-[INFO]:-Greenplum Binary Version: 'postgres (Greenplum Database) 6.24.3 build commit:25d3498a400ca5230e81abb94861f23389315213 Open Source'
20230604:19:39:48:029329 gpstart:master:gpadmin-[INFO]:-Greenplum Catalog Version: '301908232'
20230604:19:39:48:029329 gpstart:master:gpadmin-[INFO]:-Starting Master instance in admin mode
20230604:19:39:50:029329 gpstart:master:gpadmin-[INFO]:-Obtaining Greenplum Master catalog information
20230604:19:39:50:029329 gpstart:master:gpadmin-[INFO]:-Obtaining Segment details from master...
20230604:19:39:50:029329 gpstart:master:gpadmin-[INFO]:-Setting new master era
20230604:19:39:50:029329 gpstart:master:gpadmin-[INFO]:-Master Started...
20230604:19:39:50:029329 gpstart:master:gpadmin-[INFO]:-Shutting down master
20230604:19:39:52:029329 gpstart:master:gpadmin-[INFO]:-Commencing parallel segment instance startup, please wait...
......
20230604:19:39:59:029329 gpstart:master:gpadmin-[INFO]:-Process results...
20230604:19:39:59:029329 gpstart:master:gpadmin-[INFO]:-----------------------------------------------------
20230604:19:39:59:029329 gpstart:master:gpadmin-[INFO]:-   Successful segment starts                                            = 2
20230604:19:39:59:029329 gpstart:master:gpadmin-[INFO]:-   Failed segment starts                                                = 0
20230604:19:39:59:029329 gpstart:master:gpadmin-[INFO]:-   Skipped segment starts (segments are marked down in configuration)   = 0
20230604:19:39:59:029329 gpstart:master:gpadmin-[INFO]:-----------------------------------------------------
20230604:19:39:59:029329 gpstart:master:gpadmin-[INFO]:-Successfully started 2 of 2 segment instances
20230604:19:39:59:029329 gpstart:master:gpadmin-[INFO]:-----------------------------------------------------
20230604:19:39:59:029329 gpstart:master:gpadmin-[INFO]:-Starting Master instance master directory /greenplum/data/master/gpseg-1
20230604:19:40:00:029329 gpstart:master:gpadmin-[INFO]:-Command pg_ctl reports Master master instance active
20230604:19:40:00:029329 gpstart:master:gpadmin-[INFO]:-Connecting to dbname='template1' connect_timeout=15
20230604:19:40:00:029329 gpstart:master:gpadmin-[INFO]:-No standby master configured.  skipping...
20230604:19:40:00:029329 gpstart:master:gpadmin-[INFO]:-Database successfully started##确定版本是否升级成功
[gpadmin@master ~]$ gpstate --version
gpstate version 6.24.3 build commit:25d3498a400ca5230e81abb94861f23389315213 Open Source

在这里插入图片描述

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.hqwc.cn/news/1463.html

如若内容造成侵权/违法违规/事实不符,请联系编程知识网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

10个图像处理的Python库

在这篇文章中&#xff0c;我们将整理计算机视觉项目中常用的Python库&#xff0c;如果你想进入计算机视觉领域&#xff0c;可以先了解下本文介绍的库&#xff0c;这会对你的工作很有帮助。 1、PIL/Pillow Pillow是一个通用且用户友好的Python库&#xff0c;提供了丰富的函数集…

芯片等高科技制造业 如何实现安全的跨网数据交换?

芯片是信息产业的基础&#xff0c;一直以来占据全球半导体产品超过80%的销售额&#xff0c;在计算机、家用电器、数码电子、自动化、电气、通信、交通、医疗、航空航天等几乎所有的电子设备领域中都有使用。 所以&#xff0c;对于芯片这种高科技制造业来说&#xff0c;数据的安…

新项目搞完啦!!!

大家好&#xff0c;我是鱼皮。 经过了 7 场直播&#xff0c;总时长近 20 小时&#xff0c;我在 自己的编程导航 的第 5 个 全程直播开发 的项目 —— 智能 BI 项目&#xff0c;完结啦&#xff01; 我在这里对该项目做一个简单的总结&#xff0c;希望让更多需要它的同学看到&am…

开发框架前后端分离的好处是什么

关于将前端和后端保持在一起或分开&#xff0c;存在广泛的意见分歧。唯一重要的是&#xff0c;这两个组件对于开发成熟的应用程序都是必需的。 考虑&#xff1a;紧密耦合的前端和后端 许多人认为后端和前端的分离是一个坏主意&#xff0c;这两个角色之间没有太大区别。 以下…

剑指 Offer 51: 数组中的逆序对

这道题归根结底就是一个归并问题&#xff0c;逆序对本质上就是比较大小&#xff0c;如果两边作为一个整体比较过那么就可以排序合并&#xff08;因为这个过程每一步都计算了count的值&#xff0c;所以合并起来是可以的&#xff09;。 下面的k应该是mid1&#xff08;从中间的右…

【数据库】事务、事务并发问题、并发事务隔离级别、及sql演示

文章目录 一、事务1.1 事务简介 及 sql 操作1.2 事务的特性 二、事务并发问题三、事务隔离级别四、sql 演示4.1 脏读4.2 不可重复读4.3 幻读 五、演示代码 一、事务 1.1 事务简介 及 sql 操作 事务&#xff1a;数据库执行的一系列操作&#xff0c;这些操作要么全部执行&#x…

WPS数据清洗+R语言读取文件画频数分布直方图

R语言是一门好语言&#xff0c;但很多人在读取文件中数据时会遇到问题。比如我遇到的问题就是从文件中读取数据后&#xff0c;数据无法用于画图。 检索了N篇博文&#xff08;抱歉我实在无法一一列举30篇博文&#xff09;后&#xff0c;终于看到曙光&#xff0c;事实告诉我学任…

关于数据库SQL优化

简介 在项目上线初期&#xff0c;业务数据量相对较少&#xff0c;SQL的执行效率对程序运行效率的影响可能不太明显&#xff0c;因此开发和运维人员可能无法判断SQL对程序的运行效率有多大。但随着时间的积累&#xff0c;业务数据量的增多&#xff0c;SQL的执行效率对程序的运行…

Windows11添加用户自定义短语

比如要输入手机号码&#xff0c;直接输入sj就会弹出预先设定好的手机号&#xff0c;也可以预先设置好邮箱&#xff0c;身份证等等&#xff0c;这样就不用输入了 这个咋设置的有时候确实会忘记&#xff0c;所以就记下来了 步骤 第一步 打开设置 时间和语言>语言和区域 第二…

虹科分享 | 高考大数据可视化志愿填报分析-基于虹科Domo BI工具

高考是中国教育系统中一项极为重要的考试&#xff0c;它不仅是学生完成高中学业的重要标志&#xff0c;也是进入大学的门槛。每年高考都会吸引数百万学生参加&#xff0c;同时也吸引了各地高校和招生部门的关注。高考招生数据是教育研究和政策制定的重要依据&#xff0c;通过对…

【算法基础】快速排序(模板)

&#x1f466;个人主页&#xff1a;Weraphael ✍&#x1f3fb;作者简介&#xff1a;目前正在学习c和算法 ✈️专栏&#xff1a;【C/C】算法 &#x1f40b; 希望大家多多支持&#xff0c;咱一起进步&#xff01;&#x1f601; 如果文章有啥瑕疵 希望大佬指点一二 如果文章对你有…

Elasticsearch:倒数排序融合 - Reciprocal rank fusion

警告&#xff1a;此功能处于技术预览阶段&#xff0c;可能会在未来版本中更改或删除。 Elastic 将尽最大努力修复任何问题&#xff0c;但技术预览中的功能不受官方 GA 功能的支持 SLA 约束。 倒数排序融合&#xff08;RRF&#xff09;是一种将具有不同相关性指标的多个结果集组…