Reputation: 87
I'm relatively new to dockers, but I'm kind of wondering whether is it possible for me to create two master-slave postgres containers. I can do it on virtual machines, but I'm a bit confused on the one in docker.
If it's possible can someone please point me to right directions? I have tried to docker exec -it, but all the files are all missing and I cannot edit the files inside.
Upvotes: 3
Views: 5116
Reputation: 10048
Since you are new to Docker, and you wish to get up and running quickly, you can try using Bitnami's images, which allow you to specify a POSTGRESQL_REPLICATION_MODE
environment variable, which will allow you to designate a container as a standby/slave.
Just save their docker-compose-replication.yml
as docker-compose.yml
in the director of your choice, run docker-compose up -d
, and it will pull the necessary image and set everything up for you quickly.
However, I would highly encourage you to tinker on your own to learn how Docker works. Specifically, you could just use the community Postgres image, and then write your own entrypoint.sh
file (along with any additional helper files as necessary), and customize the setup to your requirements.
Disclosure: I work for EnterpriseDB (EDB)
Upvotes: 5