Well I have the following scenario, I need to do a replication from bank A to bank B. Well I've been doing this from one machine to another with the following changes:
Master Machine - 10.0.0.1
sudo vim /etc/postgresql/9.4/main/postgresql.conf
listen_addresses = 'localhost,10.0.0.1'
wal_level = hot_standby
max_replication_slots = 3
max_wal_senders = 3
sudo vim /etc/postgresql/9.4/main/pg_hba.conf
host replication all 10.0.0.2/32 trust # the slave
sudo su - postgres
psql
select * from pg_create_physical_replication_slot('theslave');
sudo service postgresql restart
Slave Machine 10.0.0.2
sudo vim /etc/postgresql/9.4/main/postgresql.conf
listen_addresses = 'localhost,10.0.0.2'
wal_level = hot_standby
hot_standby = on
hot_standby_feedback = on
sudo service postgresql stop
sudo su - postgres
cd ~/9.4
rm -rf main
pg_basebackup -v -D main -R -P -h 10.0.0.1
sudo su postgresql start
Well using this there works a beauty, however I found that the banks that I have to perform the replication are not on the default port 5432 of postgres are on port 9700, 9701 and 9702. In other words, I have to replicate the data from the databases which are on port 9700, 9701, and 9702 on the master computer for the slave computer on its ports 9700, 9701, and 9702.
What change should I make?