debezium 之五 安装postgres-decoderbufs

规划

192.168.56.11  k1
192.168.56.12  k2
192.168.56.13  k3
192.168.56.21  pg11n1
192.168.56.22  pg11n2

主机 pg11n1 、pg11n2上安装好 postgresql 11 后,需要安装 postgres-decoderbufs

debezium 需要插件 decoderbufs 或者 wal2json ,或者 pgoutput。

postgres-decoderbufs 有如下依赖
1)PostgreSQL 9.6+
2)Protobuf-c 1.2+
3)PostGIS 2.1+

安装 postgis

# yum install postgis25_11*

# yum list installed |grep -i postgis
postgis25_11.x86_64                2.5.5-5.rhel7                       @pgdg11  
postgis25_11-client.x86_64         2.5.5-5.rhel7                       @pgdg11  
postgis25_11-devel.x86_64          2.5.5-5.rhel7                       @pgdg11  
postgis25_11-docs.x86_64           2.5.5-5.rhel7                       @pgdg11  
postgis25_11-gui.x86_64            2.5.5-5.rhel7                       @pgdg11  
postgis25_11-utils.x86_64          2.5.5-5.rhel7                       @pgdg11

安装 protobuf

# cd /opt
# wget https://github.com/google/protobuf/releases/download/v2.6.1/protobuf-2.6.1.tar.gz
# tar -zxvf ./protobuf-2.6.1.tar.gz
# cd protobuf-2.6.1
# ./configure
# make
# make check
# make install

安装 protobuf-c

# cd /opt
# wget https://github.com/protobuf-c/protobuf-c/releases/download/v1.2.1/protobuf-c-1.2.1.tar.gz
# tar -zxvf protobuf-c-1.2.1.tar.gz
# cd protobuf-c-1.2.1

# export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig // 指定protobuf.pc文件所在

# ./configure
# make
# make install

安装 decoderbufs

# cd /opt
# wget https://github.com/debezium/postgres-decoderbufs/archive/refs/tags/v1.7.0.Final.tar.gz
# tar -zxvf ./v1.7.0.Final.tar.gz
# cd postgres-decoderbufs-1.7.0.Final/
# export PGHOME=/usr/pgsql-11 
export PGDATA=/var/lib/pgsql/11/data

export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${PGHOME}/lib
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/lib
export PATH=${PGHOME}/bin:$PATH
export MANPATH=${PGHOME}/share/man:$MANPATH

export TMP=/tmp
export TEMP=/tmp
export TMPDIR=/tmp

# make
# make install

修改 shared_preload_libraries

修改postgresql配置文件

shared_preload_libraries = 'decoderbufs'

参考:
https://github.com/debezium/postgres-decoderbufs

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

数据库人生

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值