Skip to content

barucho/PG_Docker_replication

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PG_Docker_replication

to build :

docker build -t postrep .

to clean:

docker rmi $(docker images | grep "^<none>" | awk '{print $3}')

to run :

docker run -d --name master  postrep
docker run -d --name slave -e SLAVE=<master_ip> postrep

run failover:

docker exec -it -u postgres slave  bash -c 'pg_ctl promote'

show log:

docker logs slave

show replication status:

docker exec -it -u postgres master  bash -c 'echo "select * from pg_stat_replication;" |psql' 
docker exec -it -u postgres slave  bash -c 'echo "select now()-pg_last_xact_replay_timestamp();" |psql'

About

docker replication

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages