Skip to main content

Cluster Scaling

Once your PostgreSQL cluster is successfully deployed, you may find the need to scale it by adding additional nodes or balancers to handle increased load or redundancy.

Console (UI)

Cluster scaling is currently supported only through the command line.

tip

If you’re interested in having this functionality available through the UI, please consider becoming a sponsor.

Command line

To scale your cluster by adding a new node, follow these steps:

  1. Modify the inventory file: Add the new node’s IP and set new_node=true variable.

Example:

[master]
10.128.64.141 hostname=pgnode01

[replica]
10.128.64.142 hostname=pgnode02
10.128.64.143 hostname=pgnode03
10.128.64.144 hostname=pgnode04 new_node=true
info

In this example, we add a node with the IP address 10.128.64.144

  1. Run the playbook: Execute the add_node.yml playbook to add the new node to your cluster.
docker run --rm -it \
-e ANSIBLE_SSH_ARGS="-F none" \
-e ANSIBLE_INVENTORY=/project/inventory \
-v $PWD:/project \
-v $HOME/.ssh:/root/.ssh \
autobase/automation:2.4.1 \
ansible-playbook add_node.yml
tip

You can scale PostgreSQL nodes, and DCS cluster (etcd or Consul), as well as HAProxy load balancers (when with_haproxy_load_balancing is set to true).