jonathan
jonathan

Reputation: 51

PITR using docker both master and slave

Can you please help on this. I have master and and slave both are dockerized. I already setup the master and it work fine:

@ inside of my master container

/var/lib/postgresql/9.3/main/postgresql.conf

archive_mode = on
archive_command = 'test ! -f /my/location/archive/wal/%f && cp %p /my/location/archive/wal/%f'
wal_level = 'archive'

But when I will going to execute the recovery_command in my SLAVE docker

sudo docker exec -it myslave /bin/bash

cd /var/lib/postgresql/9.3/main/
cp -r /mnt/fileserverz2/getcare/archive/base/* /var/lib/postgresql/9.3/main/
rm /var/lib/postgresql/9.3/main/recovery.*
echo "restore_command = 'cp /my/location/archive/wal/%f \"%p\"'" > /var/lib/postgresql/9.3/main/recovery.conf 
echo "recovery_target_action = 'promote'" >> /var/lib/postgresql/9.3/main/recovery.conf 
echo "archive_cleanup_command = 'pg_archivecleanup /my/location/getcare/archive/wal/ %r'" >> /var/lib/postgresql/9.3/main/recovery.conf 

my slave docker is going to stop and cant start it. this is my logs:

dig_param is not set
dig_param is not set
Initializing datadir...
Initializing encfs...
Initializing logdir...
Initializing rundir...
Setting resolv.conf ACLs...
Trusting connections from the local network...
Initializing certdir...
pg_ctl: could not start server
Examine the log output.

Please help on this. I really appreciates all you guys! Thanks!

Upvotes: 1

Views: 225

Answers (0)

Related Questions