Configure the Immuta PostgreSQL Instance
Audience: Application Admins
Content Summary: Immuta uses the tool Patroni to manage streaming replication of the PostgreSQL database. You need to interact with the Patroni API in order to change PostgreSQL setting.
This page outlines how to change the PostgreSQL settings, connect to the database container, modify the configuration, and apply changes and restart the cluster.
Change PostgreSQL Settings
The easiest way to interact with the Patroni API is using the tool patronictl
that is installed in the Immuta database docker containers. Updating the PostgreSQL settings involves 3 processes:
Connect to the Database Container
Use
kubectl
to determine the name of the pod running the PostgreSQL master:For the metadata database:
For the Immuta Query Engine database:
Make note of the pod name, which will be used when connecting:
The following steps should be executed from within this context.
Modify the Configuration
Once inside the database container, you can run
patronictl
to modify the configuration.A few environment variables must be exported for the
patronictl edit-config
command to run successfully:The following command will then open up the PostgreSQL configuration in
vi
for editing.Optional Flags:
edit-config
can be used with other flags set to specific values-q
,--quiet
: Do not show changes.-s
,--set
: With additional text, this parameter will set a specific configuration value. Can be specified multiple times.-p
,--pg
: With additional text, this parameter will set the specific PostgreSQL parameter value. Can be specified multiple times.
Make any changes, and then close the
vi
session by saving the configuration (Type<ESC>:wq
).You will be asked if you would like to apply the changes; type
y
and press enter.
Apply the Changes and Restart the Cluster
Now that changes have been made you can push these changes out using patronictl restart
.
Get the Patroni cluster name:
The cluster name is the first column in the result. There should be only one unique value. Use this cluster name in the call to
patronictl restart
.If you have modified the value of
max_connections
, then you should use the following command to restart the master instance only; the changes will propagate to the replicas automatically:If you have not modified the value of
max_connections
you can simply run the following command:
Last updated