1
Well I have the following scenario, I need to do a replication of a bank A for bank B. Well so far I was able to make from one machine to another making 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 that there works a beauty, but I discovered that the banks that I have to perform replication are not at door 5432 standard postgres are at door 9700, 9701 and 9702. In other words, I have to replicate the data from the databases on port 9700,9701 and 9702 on the master computer to the slave computer on the respective ports 9700, 9701 and 9702.
What change should I make?
In postgresql.conf you have the parameter
port
to set the cluster port number and pg_basebackup has the parameter-p
to set the door, I think changing these two already works.– Camilo Santos