wal2json pg扩展centos7构建
使用wal2json可以将pg 变动输出为json 格式,是一个pg 扩展,支持pg9.4+ 目前看到netflix 的dblog 对于pg 的支持就是基于此插件
以下是关于centos 7的构建说明
因为使用了centos-release-scl
pg 开发包安装
- 添加yum仓库包
yum install https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
- 安装开发包
yum install -y postgresql11-devel
- 配置pg_config
为了复用,使用的profile
export PATH=$PATH:/usr/pgsql-11/bin
生效
source /etc/profile
安装centos-release-scl
- 包含了llvm(clang,以及gcc)
yum install -y devtoolset-7-llvm centos-release-scl devtoolset-7-gcc* llvm5.0
说明: 安装llvm5.0 是在安装阶段需要的
构建
- clone 代码
git clone https://github.com/eulerto/wal2json.git
- 构建
需要先进入scl 的devtoolset 环境
scl enable devtoolset-7 bash
cd wal2json
make
- 效果
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -fPIC -I. -I./ -I/usr/pgsql-11/include/server -I/usr/pgsql-11/include/internal -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include -c -o wal2json.o wal2json.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -fPIC -L/usr/pgsql-11/lib -Wl,--as-needed -L/usr/lib64/llvm5.0/lib -L/usr/lib64 -Wl,--as-needed -Wl,-rpath,'/usr/pgsql-11/lib',--enable-new-dtags -shared -o wal2json.so wal2json.o
/opt/rh/llvm-toolset-7/root/usr/bin/clang -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -O2 -I. -I./ -I/usr/pgsql-11/include/server -I/usr/pgsql-11/include/internal -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include -flto=thin -emit-llvm -c -o wal2json.bc wal2json.c
- 安装
make install
效果
/bin/mkdir -p '/usr/pgsql-11/lib'
/bin/install -c -m 755 wal2json.so '/usr/pgsql-11/lib/'
/bin/mkdir -p '/usr/pgsql-11/lib/bitcode/wal2json'
/bin/mkdir -p '/usr/pgsql-11/lib/bitcode'/wal2json/
/bin/install -c -m 644 wal2json.bc '/usr/pgsql-11/lib/bitcode'/wal2json/./
cd '/usr/pgsql-11/lib/bitcode' && /usr/lib64/llvm5.0/bin/llvm-lto -thinlto -thinlto-action=thinlink -o wal2json.index.bc wal2json/wal2json.bc
说明
以上就是看到dblog 使用了wal2json 扩展插件,进行的一个学习环境准备,后边可以构建一个docker镜像
参考资料
https://github.com/eulerto/wal2json
https://www.postgresql.org/download/linux/redhat/
https://medium.com/netflix-techblog/dblog-a-generic-change-data-capture-framework-69351fb9099b
wal2json pg扩展centos7构建的更多相关文章
- .NET Core的文件系统[5]:扩展文件系统构建一个简易版“云盘”
FileProvider构建了一个抽象文件系统,作为它的两个具体实现,PhysicalFileProvider和EmbeddedFileProvider则分别为我们构建了一个物理文件系统和程序集内嵌文 ...
- 一篇讲解如何调试pg 扩展的文章
以下链接这片关于pg 扩展调试的文章挺不错,记录下 http://big-elephants.com/2015-10/writing-postgres-extensions-part-iii/ ...
- PipelineDB 1.0.0 发布——使用标准的pg 扩展开发模型
PipelineDB 1.0.0 发布已经发布了,现在的已经成为一个标准的pg 扩展了,语法也有变动 create continous view 修改为了view,create streaem 修改为 ...
- 添加新硬盘,扩展Centos7根分区
##背景介绍,系统安装时,分配的硬盘容量太小,根分区空间不够用,现添加一个新硬盘,通过以下步骤来扩展centos7根分区 [root@t201 ~]# df -h 文件系统 容量 已用 可用 已用% ...
- centos7构建kylo-0.10.1
构建服务器使用centos7,8G内存.建议使用8G内存,因为内存不够失败了好几次. 系统需要提前安装一下组件: yum install -y gcc bzip2 rpm-build rpmdev ...
- Kubernetes 降本增效标准指南 | 基于K8s 扩展机制构建云上成本控制系统
作者 王玉君,腾讯云后台高级开发工程师,负责腾讯云原生系统开发及建设. 晏子怡,腾讯云容器产品经理,在K8s弹性伸缩.资源管理领域有丰富的实战经验. 导语 Kubernetes 作为 IaaS 和 P ...
- 07.centos7构建 IntelliJ IDEA(简称IDEA)开发环境
一.安装IDEA 进入官网下载linux版的社区便,IDEA分为社区版和旗舰版,社区版免费,并且基本满足spark开发需求. 解压安装 目录为/opt/idea 注意:centos命令行界面下是无法安 ...
- 扩展centos7.4虚拟机磁盘大小
虚拟机分配磁盘40GB,实际系统分区只用了20GB,需要手工扩展到40GB,操作方法如下: 查看磁盘信息(确认主分区只有17GB):[root@test-web1 ~]# df -hFilesyste ...
- linux篇-Centos7构建NFS服务器和连接
准备两台centos7虚拟机 192.168.30.133 192.168.30.129 2.192.168.30.1(服务端), 3查看rpc服务是否启动 4测试安装是否成功 5修改配置文件vi/e ...
随机推荐
- [LeetCode] 11. Container With Most Water 装最多水的容器
Given n non-negative integers a1, a2, ..., an , where each represents a point at coordinate (i, ai). ...
- OpenCV 相机标定 findChessboardCorners() 与 cornerSubPix() 函数
OpenCV 官方文档 findChessboardCorners():Finds the positions of internal corners of the chessboard. bool ...
- LeetCode1——两数之和
最近在家拧三阶魔方,把初级的玩法掌握了,也就是可以还原六个面了,速度不快,但是也很兴奋.三阶魔方的初级玩法按照套路拧就可以了,每一步需要完成的任务,该步骤转动的方法基本都是固定的,而且变化也并不是特别 ...
- Restful服务应不应该在URI中加入版本号
程序员们对于Restful服务应不应该在URI中加入版本信息的问题在stackoverflow上进行了积极的讨论: Best practices for API versioning ,该问题被赞了7 ...
- Spring Cloud Ribbon客户端负载均衡(四)
序言 Ribbon 是一个客户端负载均衡器(Nginx 为服务端负载均衡),它赋予了应用一些支配 HTTP 与 TCP 行为的能力,可以得知,这里的客户端负载均衡也是进程内负载均衡的一种.它在 Spr ...
- 【题解】NOIP2016提高组 复赛
[题解]NOIP2016提高组 复赛 传送门: 玩具谜题 \(\text{[P1563]}\) 天天爱跑步 \(\text{[P1600]}\) 换教室 \(\text{[P1850]}\) 组合数问 ...
- C#使用FileSystemWatcher来监控指定文件夹,并使用TCP/IP协议通过Socket发送到另外指定文件夹
项目需求: 局域网内有两台电脑,电脑A(Windows系统)主要是负责接收一些文件(远程桌面粘贴.FTP上传.文件夹共享等方式),希望能在A接收文件后自动传输到电脑B(Windows系统)来做一个备份 ...
- python numba讲解
目录 一:什么是numba 二:如何使用numba 由于python有动态解释性语言的特性,跑起代码来相比java.c++要慢很多,尤其在做科学计算的时候,十亿百亿级别的运算,让python的这种 ...
- SQLAlchemy多表操作
目录 SQLAlchemy多表操作 一对多 数据准备 具体操作 多对多 数据准备 操作 其它 SQLAlchemy多表操作 一对多 数据准备 models.py from sqlalchemy.ext ...
- Linux搭建www,mail,ftp三大DNS服务器
##############################-----服务器端----###############################1. 安装bind# yum install bin ...