Configure the Immuta PostgreSQL Instance
Last updated
Last updated
Audience: Application Admins
Content Summary: Immuta uses the tool 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.
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:
.
.
.
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.
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.
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: