Changing PostgreSQL cluster settings
After creating a cluster, you can:
-
Configure PostgreSQL servers according to the PostgreSQL documentation
. -
Move a cluster to another folder.
Changing the host class
Note
Some PostgreSQL settings depend on the selected host class.
- Go to the folder page and select Managed Service for PostgreSQL.
- Select the cluster and click Edit cluster in the top panel.
- Under Host class, select the class for the PostgreSQL hosts.
- Click Save changes.
If you don't have the Nebius AI command line interface yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name
or --folder-id
parameter.
To change the host class for the cluster:
-
View a description of the update cluster CLI command:
ncp managed-postgresql cluster update --help
-
Request a list of available host classes (the
ZONES
column specifies the availability zones where you can select the appropriate class):ncp managed-postgresql resource-preset list
Result:
+----------+-------------+-------+----------+ | ID | ZONE IDS | CORES | MEMORY | +----------+-------------+-------+----------+ | s3-c2-m8 | eu-north1-c | 2 | 8.0 GB | | ... | +----------+-------------+-------+----------+
-
Specify the class in the update cluster command:
ncp managed-postgresql cluster update <cluster ID or name> \ --resource-preset <host class ID>
Managed Service for PostgreSQL will run the update host class command for the cluster.
Increasing storage size
Note
Some PostgreSQL settings depend on the storage size.
Make sure the cloud has enough quota to increase the storage size. Open the cloud's quotas page in the management console and make sure there is space available under Managed Databases in the SSD storage capacity line.
To increase the cluster storage size:
- Go to the folder page and select Managed Service for PostgreSQL.
- Select the cluster and click Edit cluster in the top panel.
- Under Storage size, specify the required value.
- Click Save changes.
If you don't have the Nebius AI command line interface yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name
or --folder-id
parameter.
To increase the cluster storage size:
-
View a description of the update cluster CLI command:
ncp managed-postgresql cluster update --help
-
Specify the required storage in the cluster update command (it must be at least as large as
disk_size
in the cluster properties):ncp managed-postgresql cluster update <cluster ID or name> \ --disk-size <storage size in GB>
Changing PostgreSQL settings
You can change the DBMS settings of the hosts in your cluster.
Warning
- You cannot change PostgreSQL settings using SQL commands.
- Some PostgreSQL settings depend on the selected host class or storage size.
- Go to the folder page and select Managed Service for PostgreSQL.
- Select the cluster and click Edit cluster in the top panel.
- Change the PostgreSQL settings by clicking Configure under DBMS settings.
- Click Save.
- Click Save changes.
If you don't have the Nebius AI command line interface yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name
or --folder-id
parameter.
To change PostgreSQL server settings:
-
View the full list of settings specified for the cluster:
ncp managed-postgresql cluster get <cluster ID or name> --full
-
View a description of the update cluster configuration CLI command:
ncp managed-postgresql cluster update-config --help
-
Set the required parameter values:
ncp managed-postgresql cluster update-config <cluster ID or name> \ --set <parameter1 name>=<value1>,<parameter2 name>=<value2>,...
For the list of supported parameters, see PostgreSQL settings.
Changing additional cluster settings
-
Go to the folder page and select Managed Service for PostgreSQL.
-
Select the cluster and click Edit cluster in the top panel.
-
Change additional cluster settings:
-
Backup start time (UTC): UTC time in 24-hour format when you would like to start creating a cluster backup. If the time is not set, the backup will start at 22:00 UTC.
-
Pooling mode: Choose one of connection pooler modes.
-
Deletion protection: Manages cluster protection from accidental deletion by a user.
Cluster deletion protection will not prevent a manual connection to delete the contents of a database.
-
If you don't have the Nebius AI command line interface yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name
or --folder-id
parameter.
To change additional cluster settings:
-
View a description of the update cluster CLI command:
ncp managed-postgresql cluster update --help
-
Run the following command with a list of settings to update:
ncp managed-postgresql cluster update <cluster ID or name> \ --backup-window-start <backup start time> \ --deletion-protection=<cluster deletion protection: true or false> \ --connection-pooling-mode=<connection manager mode>
You can change the following settings:
--backup-window-start
: The cluster backup start time, set in UTC formatHH:MM:SS
. If the time is not set, the backup will start at 22:00 UTC.
-
--connection-pooling-mode
: Specifies the connection pooler mode:SESSION
,TRANSACTION
, orSTATEMENT
. -
--deletion-protection
: Cluster protection from accidental deletion by a user.Cluster deletion protection will not prevent a manual connection to delete the contents of a database.
You can retrieve the cluster name with a list of clusters in the folder.
Manually switching the master
In a fault-tolerant Managed Service for PostgreSQL cluster with multiple hosts, you can switch the master role from the current master host to one of the replicas. After this operation, the current master host becomes the replica host of the new master.
Specifics of switching master hosts in Managed Service for PostgreSQL
- You can't switch the master host to a replica for which the source of the replication stream is explicitly given.
- If you don't specify the replica host name explicitly, the master host will switch to one of the quorum replicas.
For more information, see Replication in Managed Service for PostgreSQL.
To switch the master:
- Go to the folder page and select Managed Service for PostgreSQL.
- Click the name of the cluster you want and select the Hosts tab.
- Click
- To switch the master to one of the quorum replicas, leave the Choose master host automatically option enabled.
- To switch the master to a specific replica, disable the Choose master host automatically option and then select the desired replica from the drop-down list.
Switch master.
- Click Switch.
If you don't have the Nebius AI command line interface yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name
or --folder-id
parameter.
Run the following command:
ncp managed-postgresql cluster start-failover <cluster ID or name> \
--host <replica host name>
You can request the replica host name with a list of cluster hosts and the cluster name with a list of clusters in the folder.
Moving a cluster
- Go to the folder page and select Managed Service for PostgreSQL.
- Click the
- Click Move.
- Select the folder you want to move the cluster to.
- Click Move.
If you don't have the Nebius AI command line interface yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name
or --folder-id
parameter.
To move a cluster:
-
View a description of the CLI move cluster command:
ncp managed-postgresql cluster move --help
-
Specify the destination folder in the move cluster command:
ncp managed-postgresql cluster move <cluster ID> \ --destination-folder-name=<destination folder name>
You can get the cluster ID with a list of clusters in the folder.
Note
After the cluster is moved, it will continue using the cloud network from the source folder. If you want to host the cluster in a different cloud network, use the restore from a backup feature and specify the desired network for the cluster backup.