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

Add Postgres Node

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

  1. Modify the inventory file: Add the new node's IP address and specify new_node=true to indicate that this is a new node.

Example:

[master]
10.128.64.140 hostname=pgnode01 postgresql_exists=true

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

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

  1. Run the playbook: Execute the add_pgnode.yml playbook to add the new node to your cluster.
ansible-playbook add_pgnode.yml
note

When you run this playbook, the new node will undergo the same preparation process as during the initial cluster deployment. However, unlike the initial setup, all necessary configuration files will be automatically copied from server listed in the "master" group in the inventory file.