Initializing your cluster

Before you begin

The data directory in Patroni must be owned by PostgreSQL superuser. Provide appropriate permissions to superuser as follows:
chown -R <SUPERUSER_NAME> <DATA_DIR>
Change data directory permissions so that only superuser can access with these commands:
chmod -R 700 <DATA_DIR>
Where, <DATA_DIR> is data directory path and name.

About this task

The user who is running the commands must have privileges. Use sudo if your user is in sudoers list.

Procedure

  1. Use the following command to start etcd:
    systemctl restart etcd
  2. Start Patroni.
    1. systemctl start patroni
  3. Start HAProxy.
    systemctl restart haproxy
  4. Go to http:<HAPROXY_HOST>:<STATISTIC_PORT>/prd

    You can check the health of your cluster on HAProxy screen.