postgresql multi-master 系列 Rubyrep 之一 setup

迷南。 2023-02-18 01:58 103阅读 0赞

Development of an open-source solution for asynchronous, master-master replication of relational databases that is

ridiculously easy to use
database independent

有两种方式

  1. Standard Ruby flavor
  2. JRuby flavor

在这里插入图片描述

本次采用 Standard Ruby flavor

  1. 192.168.56.111 n1
  2. 192.168.56.112 n2

版本

  1. # cat /etc/centos-release
  2. CentOS Linux release 7.4.1708 (Core)
  3. #
  4. #
  5. # yum list installed |grep -i postgresql
  6. postgresql11.x86_64 11.8-1PGDG.rhel7 @pgdg11
  7. postgresql11-contrib.x86_64 11.8-1PGDG.rhel7 @pgdg11
  8. postgresql11-debuginfo.x86_64 11.5-1PGDG.rhel7 @pgdg11
  9. postgresql11-devel.x86_64 11.8-1PGDG.rhel7 @pgdg11
  10. postgresql11-docs.x86_64 11.8-1PGDG.rhel7 @pgdg11
  11. postgresql11-libs.x86_64 11.8-1PGDG.rhel7 @pgdg11
  12. postgresql11-llvmjit.x86_64 11.8-1PGDG.rhel7 @pgdg11
  13. postgresql11-odbc.x86_64 12.01.0000-1PGDG.rhel7 @pgdg11
  14. postgresql11-plperl.x86_64 11.8-1PGDG.rhel7 @pgdg11
  15. postgresql11-plpython.x86_64 11.8-1PGDG.rhel7 @pgdg11
  16. postgresql11-pltcl.x86_64 11.8-1PGDG.rhel7 @pgdg11
  17. postgresql11-server.x86_64 11.8-1PGDG.rhel7 @pgdg11
  18. postgresql11-tcl.x86_64 2.4.0-2.rhel7.1 @pgdg11
  19. postgresql11-test.x86_64 11.8-1PGDG.rhel7 @pgdg11
  20. # su - postgres
  21. Last login: Wed Jan 15 18:34:12 CST 2020 on pts/0
  22. $
  23. $
  24. $ psql -c "select version();"
  25. version
  26. ---------------------------------------------------------------------------------------------------------
  27. 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
  28. (1 row)

安装 RVM, Ruby

n1、n2 节点都需要安装
参考<<rvm,ruby的安装>>

安装 rubyrep

n1、n2 节点都需要安装
依赖 pg_config

  1. # export PGHOME=/usr/pgsql-11;
  2. export PGDATA=/var/lib/pgsql/11/data;
  3. export MANPATH=${PGHOME}/share/man:$MANPATH;
  4. export LD_LIBRARY_PATH=${PGHOME}/lib;
  5. export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/lib;
  6. export PATH=${PGHOME}/bin:$PATH;
  7. export TEMP=/tmp;
  8. export TMPDIR=/tmp;
  9. # gem install pg
  10. # gem install rubyrep

参考:
https://wiki.postgresql.org/wiki/Rubyrep

http://www.rubyrep.org/
https://github.com/rubyrep/rubyrep

发表评论

表情:
评论列表 (有 0 条评论,103人围观)

还没有评论,来说两句吧...

相关阅读