How to configure and manage Postgres databases with Stolon?

Fly’s Postgres clusters are images that run Stolon.
This means that if we want to alter Postgres configuration settings, we ought to do this through Stolon’s interface.
Stolon’s settings are usually managed by calling stolonctl and indeed this binary exists within the deployed Postgres images.

However, when using stolonctl, we’re asked for a cluster name and store backend. The things I tried so far (fly-appname, fly-appname-db, fly_appname) did not work.

What is the proper way to call stolonctl / configure Postgres’ configuration?

Not sure if it’s the only way, but this should work:

fly ssh console --app name-here
export $(cat /data/.env | xargs)
stolonctl update --patch '{"pgParameters": { "name": "value"}}'
exit

You may then need to restart the app for that change to be applied to all its vms.

2 Likes

Thank you! That works perfectly :blush:.

After trying it out, it does seem like restarting the app is not necessary; Stolon forwards the changes to all connected VMs.

1 Like