how to configure primary-replica configuration for postgres containers by aws copilot
we are hosting postgres containers into ecs by aws copilot , so how to configure master slave configuration for database containers by aws copilot. Can anyone please help
For database replication how to configure master and slave configuration ecs db(postgres) containers by aws copilot
Would storage helps with data transfer between master and slave containers in your case?
In the meanwhile, if any one has existing set up, please feel free to share and it'll be very appreciated!
@Lou1415926 , Is there any option to create secondary container from copy of primary container ?
Yes.
In the meantime you can also look into RDS's read replica option. You should be able to create an RDS database with PostgreSQL engine as an addon.
As of now we are hosting db in ecs containers , can you please help to configure replica from primary to secondary by copilot
@Lou1415926 , Now i created 2 ecs containers by copilot , and mounted two different efs volumes for both the containers , Now to how to make sync with primary and secondary ?? can you please help
Hopefully this post can help!
Or you can set up two Backend services: a master service, and some slave services. When master services receive WRITE to the database, it connects to the slave service via. service discovery endpoint replicating the data. That's potentially an option to explore too.
Hey @Dhina-test! Have you looked at https://github.com/bitnami/containers/tree/main/bitnami/postgresql? I think that looks like the easiest way to deploy postgres in a container with a primary/replica setup - they have a nice guide for it here.
Assuming you're deploying this as two Copilot backend services, then you can just configure the environment variables on the primary and replia services following that guide, using service discovery URLs like @Lou1415926 mentioned.
yes @dannyrandall , I am deploying two copilot backend postgres containers , mounted two different efs volumes .checking to configure one as primary and another as a replica.
This issue is stale because it has been open 60 days with no response activity. Remove the stale label, add a comment, or this will be closed in 14 days.
This issue is closed due to inactivity. Feel free to reopen the issue if you have any further questions!