postgresql multi-master 系列 Rubyrep 之一 setup
Development of an open-source solution for asynchronous, master-master replication of relational databases that is
ridiculously easy to use
database independent
有两种方式
- Standard Ruby flavor
- JRuby flavor
本次采用 Standard Ruby flavor
192.168.56.111 n1
192.168.56.112 n2
版本
# cat /etc/centos-release
CentOS Linux release 7.4.1708 (Core)
#
#
# yum list installed |grep -i postgresql
postgresql11.x86_64 11.8-1PGDG.rhel7 @pgdg11
postgresql11-contrib.x86_64 11.8-1PGDG.rhel7 @pgdg11
postgresql11-debuginfo.x86_64 11.5-1PGDG.rhel7 @pgdg11
postgresql11-devel.x86_64 11.8-1PGDG.rhel7 @pgdg11
postgresql11-docs.x86_64 11.8-1PGDG.rhel7 @pgdg11
postgresql11-libs.x86_64 11.8-1PGDG.rhel7 @pgdg11
postgresql11-llvmjit.x86_64 11.8-1PGDG.rhel7 @pgdg11
postgresql11-odbc.x86_64 12.01.0000-1PGDG.rhel7 @pgdg11
postgresql11-plperl.x86_64 11.8-1PGDG.rhel7 @pgdg11
postgresql11-plpython.x86_64 11.8-1PGDG.rhel7 @pgdg11
postgresql11-pltcl.x86_64 11.8-1PGDG.rhel7 @pgdg11
postgresql11-server.x86_64 11.8-1PGDG.rhel7 @pgdg11
postgresql11-tcl.x86_64 2.4.0-2.rhel7.1 @pgdg11
postgresql11-test.x86_64 11.8-1PGDG.rhel7 @pgdg11
# su - postgres
Last login: Wed Jan 15 18:34:12 CST 2020 on pts/0
$
$
$ psql -c "select version();"
version
---------------------------------------------------------------------------------------------------------
PostgreSQL 11.8 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39), 64-bit
(1 row)
安装 RVM, Ruby
n1、n2 节点都需要安装
参考<<rvm,ruby的安装>>
安装 rubyrep
n1、n2 节点都需要安装
依赖 pg_config
# export PGHOME=/usr/pgsql-11;
export PGDATA=/var/lib/pgsql/11/data;
export MANPATH=${PGHOME}/share/man:$MANPATH;
export LD_LIBRARY_PATH=${PGHOME}/lib;
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/lib;
export PATH=${PGHOME}/bin:$PATH;
export TEMP=/tmp;
export TMPDIR=/tmp;
# gem install pg
# gem install rubyrep
参考:
https://wiki.postgresql.org/wiki/Rubyrep
http://www.rubyrep.org/
https://github.com/rubyrep/rubyrep
还没有评论,来说两句吧...