当前位置:网站首页>Greenplum【部署 08】数据库小版本升级流程及问题处理 Error: open-source-greenplum-db-6 conflicts with
Greenplum【部署 08】数据库小版本升级流程及问题处理 Error: open-source-greenplum-db-6 conflicts with
2022-07-26 23:14:00 【シ風箏】
1.升级原因
- 为什么会一直关注Greenplum的版本信息?
项目数据库要从 MySQL 切换到 Greenplum 问题最多的就是 SQL 语法不同,MySQL有on duplicate key update实现冲突更新,Greenplum却没有。
PostgreSQL 9.5 引入了 UPSET 功能,其语法insert on conflict do非常强大,支持合并写入(当违反某唯一约束时,冲突则更新,不冲突则写入),同时支持流式计算。
当前使用的 Greenplum 数据库版本为6.13.0其 PostgreSQL 版本为 9.4.24无法使用 UPSERT 语法:
# select version();
PostgreSQL 9.4.24
(Greenplum Database 6.13.0 build commit:4f1adf8e247a9685c19ea02bcaddfdc200937ecd Open Source)
on x86_64-unknown-linux-gnu, compiled by gcc (GCC) 6.4.0, 64-bit compiled on Dec 18 2020 22:31:16
遗憾的是20220408发布的最新版本6.20.3依然是9.4
PostgreSQL 9.4.26
(Greenplum Database 6.20.3 build commit:24b949d2585cdbe8a157062fb756013e7c2874ab Open Source)
on x86_64-unknown-linux-gnu, compiled by gcc (GCC) 6.4.0, 64-bit compiled on Apr 6 2022 19:59:57
最终通过代码实现了replace insert或insert on conflict类似on duplicate key update批量入库数据(合并插入无则新增有则更新)的操作,代码可查看《Greenplum 代码 01》。
PostgreSQL 9.5 的合并似乎要等到 Greenplum7.0,20220714发布了最新版本6.21.0,这里进行一次数据库升级操作,同时也验证一下内核版本。
2.小版本升级流程
2.1 安装GPDB
# 0.首先要停掉当前数据库
gpstop -M fast
# 1.安装(默认安装到/usr/local)目录下
yum install -y ./open-source-greenplum-db-6.21.0-rhel7-x86_64.rpm
报错与之前的版本冲突了:
No package matched to upgrade: open-source-greenplum-db-6
--> Finished Dependency Resolution
Error: open-source-greenplum-db-6 conflicts with greenplum-db-6-6.13.0-1.el7.x86_64
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
# 使用 rpm 安装 添加 --nodeps 表示不含依赖
rpm -ivh open-source-greenplum-db-6.21.0-rhel7-x86_64.rpm --nodeps
# 安装过程
Preparing... ################################# [100%]
Updating / installing...
1:open-source-greenplum-db-6-6.21.0################################# [100%]
# 2.赋权给 gpadmim
chown -R gpadmin:gpadmin /usr/local/greenplum*
2.2 重建或修改软连接
# 重建软连接
rm -rf /usr/local/greenplum-db
ln -s /usr/local/greenplum-db-6.21.0 /usr/local/greenplum-db
# 修改软连接
ln –snf /usr/local/greenplum-db-6.21.0 /usr/local/greenplum-db
2.3 启动验证
# 启动
gpstart -a
# select version();
PostgreSQL 9.4.26
(Greenplum Database 6.21.0 build commit:d0087e3b24c54d203ca8bb315559205f13cd6393 Open Source)
on x86_64-unknown-linux-gnu, compiled by gcc (GCC) 6.4.0, 64-bit compiled on Jun 10 2022 01:57:17
数据库启动成功,版本也升级到了6.21.0当然内核版本依然是9.4.26。这个是小版本的升级,大版本的升级有可能要重新初始化数据库。
边栏推荐
- Solve prime numbers between 100 and 200
- Hcip the next day
- 砺夏行动|源启数字化:既有模式,还是开源创新?
- Writing a pacesetter frequently -- yunxiaojing
- Plato Farm有望通过Elephant Swap,进一步向外拓展生态
- HCIP-第四天-OSPF路由协议
- go语言慢速入门——包
- 面试必问 | 一个线程从创建到消亡要经历哪些阶段?
- Sort the three integers from large to small (introduce various methods in detail)
- Open the door of programming
猜你喜欢

【自此文之后,学习链表一片坦途】

Hcip day 1

Hcip first day

Plato Farm有望通过Elephant Swap,进一步向外拓展生态

C language - first program, print, variables and constants

【洋哥带你玩转线性表(三)——双向链表】

在有序数组找具体某个数字

Little sister's notes: how do I learn simple source code to expand my horizons

蚂蚁京东新浪10位架构师424页佳作深入分布式缓存从原理到实践pdf

Rip routing information protocol topology experiment
随机推荐
Constant knowledge explanation of C language
见证中国网安力量 “解码2022中国网安强星”即将启航
证券炒股开户需要现场开户吗网上开户安全吗
Hcip first day
C language - array, string handler, strlen, strcpy and strncpy, strcat and strncat, StrCmp and strncmp
JUC concurrent programming
【降维打击,带你深度学习CPU(上)】
[enchanting interpretation, 15 minutes let you thoroughly learn how to use the stack!!!]
【洋哥带你玩转线性表(一)——顺序表】
Redis distributed lock implemented by annotation
Is it useful to lie down with your eyes closed when you can't sleep?
Handsomeforum Learning Forum
HCIP第一天静态路由综合实验
Little sister's notes: how do I learn simple source code to expand my horizons
关于序列化变量保存的坑,加了索引器的数据不能序列化
猜拳小程序 基于Object-C 新手上路
最新多线程&高并发学习资料,面试心里有底气
小姐姐笔记:我是如何学习简单源码拓展视野的
【在Visual Studio 2019中使用SQLite3库实现学生信息管理系统】
NPM reports an error, error: eperm: operation not permitted, MKDIR