PostgreSQL replication multi-master
today i will show you, how to PostgreSQL replication multi-master with Bucardo
https://bucardo.org/Bucardo/
https://bucardo.org/Bucardo/
sudo apt-get install libboolean-perl libdbd-mock-perl libdbd-pg-perl libanyevent-dbd-pg-perl libpg-hstore-perl libpgobject-perl
sudo apt-get install libdbix-safe-perl
wget http://bucardo.org/downloads/dbix_safe.tar.gz
tar xvfz dbix_safe.tar.gz
cd DBIx-Safe-1.2.5/
perl Makefile.PL
sudo apt install make
make
make test
sudo make install
cd ..
wget http://bucardo.org/downloads/Bucardo-5.4.1.tar.gz
tar xvfz Bucardo-5.4.1.tar.gz
cd Bucardo-5.4.1/
perl Makefile.PL
sudo make install
sudo apt-get install postgresql-plperl-9.5
sudo mkdir /var/run/bucardo
sudo chmod 777 /var/run/bucardo
create user bucardo superuser;
create database bucardo;
ALTER DATABASE bucardo OWNER TO bucardo;
sudo bucardo install
add db =>
bucardo add database serv1 dbname=dbone
bucardo add database serv2 dbname=dbone host=apptwo
add tables =>
bucardo add table % db=serv1
bucardo add table % db=serv2
add herd=>
bucardo add all tables --herd=one_two db=serv1
bucardo add all tables --herd=two_one db=serv2
add sync=>
bucardo add sync sync_oneToTwo relgroup=one_two db=serv1,serv2
bucardo add sync sync_TwoToOne relgroup=two_one db=serv2,serv1
Post a Comment