当前位置:网站首页>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。这个是小版本的升级,大版本的升级有可能要重新初始化数据库。
边栏推荐
- Fist guessing applet based on Object-C novice on the road
- [C language programming] branch structure
- Area optimization of digital chips: detailed explanation of question 1 in the digital direction of the third "Huawei Cup" graduate innovation core competition
- Multipoint bidirectional republication and routing strategy topology experiment
- Smooth data migration from single table to sub table
- OSPF路由信息协议-拓扑实验
- Find a specific number in an ordered array
- 【斐波那契数列及螺线 基于C语言】
- C language - assignment operator, compound assignment operator, self increasing and self decreasing operator, comma operator, conditional operator, goto statement, comment
- OSPF routing information protocol topology experiment
猜你喜欢
随机推荐
【力扣】1859.将句子排序
【C语言】strlen与sizeof相关区分
Sort the three integers from large to small (introduce various methods in detail)
HCIP oSPF知识总结
动态路由配置
小姐姐笔记:我是如何学习简单源码拓展视野的
面试必问 | 一个线程从创建到消亡要经历哪些阶段?
C language -- nesting of relational and logical operators, if statements, switch statements, and branch structures
Hcip OSPF knowledge summary
HCIP-第一天
C language -- while statement, dowhile statement, for loop and loop structure, break statement and continue statement
C语言 学生信息管理系统 基于数组 可以存取到文本文件
Detailed source code of golang bufio reader
Wechat applet: user wechat login process (attached: flow chart + source code)
膜拜,阿里内部都在强推的321页互联网创业核心技术pdf,真的跪了
【用C语言绘制谢尔宾斯基三角形】
HCIP-第四天-OSPF路由协议
[use SQLite3 library to realize student information management system in Visual Studio 2019]
[Fibonacci sequence and spiral are based on C language]
I was fired at the age of 30. I want to understand a few things








![[draw sherpinski triangle in C language]](/img/e6/9d1d088d1c7675c23725443000329b.png)
