11

I am curious if somebody is actually running PostgreSQL in a container in production on some form of distributed file system - GlusterFS preferably, or anything.

I am currently running Mesos/Marathon. In case the PostgreSQL node fails, Marathon simply launches another instance of PostgreSQL on other nodes and if done properly (service discovery and application recovering from database connection loss), the ultimate fault tolerance will be achieved.

I know PostgreSQL has its own HA solutions, like log shipping and hot stand-by backup, but then one still need to solve the problem on when to switch from master to slave, how to do it properly and so on.

So, how do you run PostgreSQL in production on GlusterFS or similar? If so, is it stable? How about performance?

3

2 Answers 2

1

but then one still need to solve the problem on when to switch from master to slave, how to do it properly and so on.

Each and every cluster usually has notion of quorum: watchers (monitors, whatever) are to decide which node is the master. Then you can use theirs information to route requests properly. It's quite typical to run haproxy with not only basic TCP/IP health checks but some high level logic implemented with service specific queries.

Check out peacemaker, for e. g..

1
  • The veritas cluster (now symantec cluster, afaik) does not use quorum mechanisms. Quite clever solution.
    – Nils
    Sep 16, 2021 at 15:30
1

You need to run postgresql in stateful service mode. Scaling is done by mesos but data replication is done by the postgresql it self. Take a look at this site stateful service and persistent volumes.

1
  • Your link for stateful service is broken. Can you please supply a working one?
    – Nils
    Sep 16, 2021 at 15:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .