This is just part of the note, the master hangs up and cuts to the repository.
Master:192.168. 1.111 from: 192.168. 1.222
Primary server
sudo apt-get Install rsync
From the server
sudo apt-get install Rsyncsudo apt-get install Openssh-server
Master db
Create user
sudo-'123456'; \q exit
Modifying a configuration file
Vim/etc/postgresql/9.x/main/pg_hba.conf
0.0. 0.0/0 MD5
Vim/etc/postgresql/9.x/main/postgresql.conf
" * " =3
From DB
Set the Postgres system account password to use when the user remotely rsync
Vim/etc/postgresql/9.x/main/postgresql.conf
Hot_standby = On
Vim/var/lib/postgresql/9.x/main/recovery.conf
Standby_mode = Onprimary_conninfo='host=192.168.1.111 user=repuser password=123456' /tmp/Switch_to_read_write, prepare the library can write #trigger_file='/tmp/switch_to_read_write '
About recovery's sample can be seen here/usr/share/postgresql/
Integration
Master and slave execution separately
sudo service PostgreSQL stop
It starts with the need to execute on the primary server
sudo rsync-ravztopg--exclude=/var/lib/postgresql/9. x/main/pg_xlog//var/lib/ postgresql/9. x/main/[email protected]192.168. 1.222:/var/lib/postgresql/9. x/main/
After success
executed separately in master and slave
Service PostgreSQL Start
master configuration of PostgreSQL (not ha, not eagerly)