CrunchyData / crunchy-containers

Containers for Managing PostgreSQL on Kubernetes by Crunchy Data
https://www.crunchydata.com/
Apache License 2.0
1.01k stars 328 forks source link

Unable to run service using stack deployment #1350

Open Nutties93 opened 3 years ago

Nutties93 commented 3 years ago

https://github.com/CrunchyData/crunchy-containers/tree/master/examples/docker/swarm-service

I have copied the docker-compose file and tried running it. However, the services are not starting. I tried to deploy only the primary service without replica, and it's still not running. Do you know what's the reason? Did it miss out on anything?

jkatz commented 3 years ago

Without any logs, commands, etc. this is a bit challenging to troubleshoot.

Nutties93 commented 3 years ago

Oh. I managed to resolve this. I realized that the MODE environment variable needs to be set to POSTGRES. Meanwhile, I was testing the replication. it works fine. However, when I tried to down the primary database. I'm unable to do a write to the other. Is there a way to implement an election between the databases so that the selection of the primary databases will be dynamic? like an etcd configuration or something?

dancernogorsky commented 2 years ago

Oh. I managed to resolve this. I realized that the MODE environment variable needs to be set to POSTGRES. Meanwhile, I was testing the replication. it works fine. However, when I tried to down the primary database. I'm unable to do a write to the other. Is there a way to implement an election between the databases so that the selection of the primary databases will be dynamic? like an etcd configuration or something?

@Nutties93 I know it's been a minute, but where you ever able to get the failover to work in swarm? I am getting ready to try this again. In the past a I had the same issues and aborted but it looks like theres been updates to the package.

mikesutton commented 1 week ago

Quote reply Reference i

This is from the future.

MODE=postgres [lower case]

is what you need to get past the deploy failing (as I just did)

Will test and report if replication and recovery fail