1) Add the new worker node from the coordinator
Run the following on the coordinator (control plane) with psql to addworker3 to the cluster:
2) Inspect shard distribution for the users table
Query the citus_shards catalog on the coordinator to see how many shards for the users table exist on each worker:
As shown,
worker3 was added and already hosts some shards, but the distribution is not yet balanced across all workers.
To even out shard placement across the cluster, run a rebalance operation (for example,
rebalance_table_shards) so shards move onto the new node(s). After the rebalance completes, re-run the shard-count query above to confirm an even distribution.3) Rebalance shards onto the new node
A typical rebalance step for a table namedusers is:
Running a rebalance on a production cluster may increase load and affect query latency. Schedule rebalances during maintenance windows or throttle them if your Citus deployment supports that.
4) Verify shard distribution again
After rebalance completes, run the samecitus_shards query from step 2 to verify shards are distributed evenly:
worker1, worker2, and worker3).