- Add and edit the install_slony.sh in the SLAVE VM, check the version of slony and postgresql, they must be the same on both machine (SLAVE machine and MASTER machine).
the script is available here.
- Then add the ssh key of the MASTER machine in the slave machine.
- On the MASTER machine configure your SLAVE machine at slony/script/.
- First add you slave definition in this file definition.inc. Master is PRIMARY and others nodes are the slaves.
~~~~bash
define EXAMPLE 31;
~~~~
- Then you must create 3 files : _disconnect_EXAMPLE.sk_, _replicate_EXAMPLE.sk_ and _init_EXAMPLE.sk_
- You can copy an older configuration and just update the database name, user, password, domain name
And define data table which need a slony replication.
- On the master machine, edit /etc/postgresql/9.6/main/pg_hba.conf and add at the end
- Before to run slony, you must to add your configuration in the script "re-init-slony.sh"
So on the master machine you must to add in the part :
* replicate : replicate_EXAMPLE.sk
* init : init_EXAMPLE.sk
* disconnect : disconnect_EXAMPLE.sk
when all is ok you can run re-init-slony.sh
the script take approximately 1 hour, and must no return error.
* Note that if the slony replication encounters an issue with a SLAVE VM , the slony replication doesn't work for all other slave
## Launching the synchronization or restarting the synchronization
If you are launching the synchronization for the first time (seen from the master) then you can start from point 4. At any point in the process if you encounter an error, you will need to restart from 1.