注:升级存在风险,一定要先备份数据库。
Greenplum当前版本4.3.12.0
[gpadmin@mdw ~]$ gpstate
20201216:10:27:19:101109 gpstate:mdw:gpadmin-[INFO]:-Starting gpstate with args:
20201216:10:27:19:101109 gpstate:mdw:gpadmin-[INFO]:-local Greenplum Version: ‘postgres (Greenplum Database) 4.3.12.0 build 1’
20201216:10:27:19:101109 gpstate:mdw:gpadmin-[INFO]:-master Greenplum Version: ‘PostgreSQL 8.2.15 (Greenplum Database 4.3.12.0 build 1) on x86_64-unknown-linux-gnu, compiled by GCC gcc (GCC) 4.4.2 compiled on Feb 27 2017 20:45:12’
安装GP软件:
[root@mdw ~]# /bin/bash /opt/tools/greenplum-db-4.3.33.5-rhel5-x86_64.bin
[root@mdw ~]# chown -R gpadmin:gpadmin /usr/local/greenplum-db-4.3.33.5
删除软连接
[root@mdw ~]# rm -rf /usr/local/greenplum-db
[root@mdw ~]# ln -s /usr/local/greenplum-db-4.3.33.5 /usr/local/greenplum-db
或是修改软连接
[root@mdw ~]# ln –snf /usr/local/greenplum-db-4.3.33.5 /usr/local/greenplum-db
修改配置文件,检查如下文件,如有GP版本号改为新的版本号即可。
这里检查本文环境没有配置GP环境变量,不需要修改。
vi ~/.bashrc
vi ~/.bash_profile
vi /etc/profile
安装
[root@mdw ~]# source /usr/local/greenplum-db/greenplum_path.sh
[root@mdw ~]# gpseginstall -f /home/gpadmin/all_hosts
注:本文GP环境参考https://blog.csdn.net/xiadan_xiadan/article/details/110953238
all_hosts文件内容如下:
mdw
smdw
sdw1
sdw2
重启数据库
[gpadmin@mdw ~]$ gpstop –ra
如果之前已关闭数据库了,也可以输入如下命令启动数据库
[gpadmin@mdw ~]$ gpstart -a
查看Greenplum更新后的版本4.3.33.5
[gpadmin@mdw ~]$ gpstate
20201221:16:08:58:086473 gpstate:mdw:gpadmin-[INFO]:-Starting gpstate with args:
20201221:16:08:58:086473 gpstate:mdw:gpadmin-[INFO]:-local Greenplum Version: ‘postgres (Greenplum Database) 4.3.33.5 build 1’
20201221:16:08:58:086473 gpstate:mdw:gpadmin-[INFO]:-master Greenplum Version: ‘PostgreSQL 8.2.15 (Greenplum Database 4.3.33.5 build 1) on x86_64-unknown-linux-gnu, compiled by GCC gcc (GCC) 4.4.2 compiled on Feb 5 2020 01:39:09’
升级成功