Sobes.tech
Middle+

Tell about your experience with databases. Have you worked with Patroni? How to view the cluster composition?

sobes.tech AI

Answer from AI

Patroni is a PostgreSQL cluster management system with automatic failover, based on using Etcd, Consul, or ZooKeeper to store the cluster state.

To view the Patroni cluster composition, you can use the command:

patronictl list

This command will display a list of cluster nodes, their roles (master/replica), status, and replication lag.

You can also access the Patroni REST API, usually available on port 8008, for example:

curl http://<node_ip>:8008

This will return a JSON with information about the state of a specific node and the cluster as a whole.

Experience with Patroni typically includes cluster setup, status monitoring, automatic failover configuration, and recovery after failures.