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 ...
随机推荐
- Linux中$()和${}区别(转)
文章转自 https://blog.csdn.net/hxchuangxiaochuan/article/details/81204084 $( )中放的是命令,相当于` `,例如todaydate ...
- mac pe简单安装方法
1.工具下载 TechTool Pro for mac V11.0.4:http://www.pc6.com/mac/112462.html 2.准备16g u盘 3.安装工具并按照注册码注册 在Te ...
- POJ-2661Factstone Benchmark
Factstone Benchmark Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 5577 Accepted: 25 ...
- Logstash:多个配置文件(conf)
Logstash:多个配置文件(conf) 对于多个配置的处理方法,有多个处理方法: 多个pipeline 一个pipleline处理多个配置文件 一个pipeline含有一个逻辑的数据流,它从inp ...
- Linux(CentOS)启动时自动执行脚本(rc.local)
下面说说通过rc.local文件进行开机启动 1.首先创建一个启动脚本,这里以启动docker为例 创建 docker-startup.sh 脚本 #! /bin/bash /usr/bin/mk-d ...
- Spring集成Quartz框架的两种方式。
可参考:https://blog.csdn.net/yk614294861/article/details/84324603 1.使用Spring与Quarta配置作业得两种方式: a.方式一,Met ...
- 使用EF批量新增数据十分缓慢
使用EF来批量新增数据,发现效率非常的差,几千条数据时甚至需要几分钟来执行,迫于无奈使用sql来执行了. 今天偶然看到一篇关于EF的文章,才发觉原来是自己对EF不够了解的原因. 一般新增时我们是将所有 ...
- C 函数声明、函数参数
参考连接:https://www.runoob.com/cprogramming/c-functions.html 局部变量与全局变量在内存中的储存方式 全局变量保存在内存中的全局储存区中,占用静态的 ...
- easyui datagird 解决行高不一致问题!
<style>.datagrid-btable .datagrid-cell {padding: 6px 4px;overflow: hidden;text-overflow: ellip ...
- Html头部meta标签
meta元素有4个属性:name.http-equiv.content.charset.meta标签通过name属性来表述页面文档的元信息,通过http-equiv属性设置http请求指令,通过c ...