Create a PostgreSQL cluster
Create a cluster
-
In the control panel, in the top menu, click Products and select Cloud Databases.
-
Click Create cluster.
-
Enter the cluster name.
-
Select a location. You cannot change the location after the cluster is created.
-
Select a DBMS — PostgreSQL.
-
Select a version of PostgreSQL. You cannot change the version after the cluster is created.
-
Fill in the blocks:
- Node configuration;
- optional: Fault tolerance;
- optional: Logging;
- Network;
- optional: Security;
- Connection pooler;
- optional: DBMS settings.
-
Check the price of the Managed Database cluster.
-
Click Create cluster.
Node configuration
-
Select a configuration line.
-
If you selected a line with custom configurations, select the disk type, specify the number of vCPUs, RAM size, and disk size.
-
If you selected a line with fixed configurations, select a configuration.
After creating the cluster, you can change the node configuration — scale the cluster.
Optional: Fault tolerance
To ensure cluster fault tolerance, add replicas — full copies of the master node. To do this, specify the number of nodes in the cluster. The first node is the master node, the rest are replicas. Replicas are read-only (SELECT).
A multi-node cluster is covered by the SLA — we guarantee 99.95% write availability and 99.99% read availability.
Optional: Logging
To access cluster logs, enable logging. Logging uses part of the cluster's computing resources.
-
Select the Collect technical cluster logs to log service checkbox.
-
Select a log group or create a new group.
-
If you have selected a new group, enter its name.
Network
A PostgreSQL cluster can be connected:
-
to a private subnet — without internet access. You can connect a public floating IP address for internet access. A separate address is connected to each cluster node;
-
or to a public subnet — where all addresses are accessible from the internet.
You can create a new subnet or add the cluster to an existing one.
Private subnet
Public subnet
-
To add a cluster to an existing private subnet:
1.1. In the Subnet field, select an existing subnet. The number of addresses in the selected subnet must not be less than the number of nodes in the cluster. You cannot change the subnet after the cluster is created.
1.2. Optional: to make cluster nodes accessible from the internet, in the Public access to cluster nodes block, select the checkbox for the node to which you want to connect a public floating IP address. The Public access to cluster nodes block is available if the private subnet meets the requirements. If the subnet does not meet the requirements, you can connect a public floating IP address after creating the cluster.
-
To create a new private subnet:
2.1. In the Subnet field, select New private subnet. The number of addresses in the subnet must not be less than the number of nodes in the cluster. You cannot change the subnet after the cluster is created.
2.2. Optional: change the subnet CIDR.
2.3. Optional: change the network in which the subnet will be created — you can select an existing network or create a new one. Once the cluster is created, the network cannot be changed.
Optional: Security
Select security groups to filter inbound and outbound cluster traffic.
If the Security block is missing, traffic filtering (port security) is disabled on the cluster network. If traffic filtering is disabled, all traffic will be allowed.
Connection pooler
To optimize resource consumption, you can use a connection pooler.
- Select a pooling mode:
- transaction — the connection is assigned to the client for the duration of the transaction;
- session — the connection is assigned while the client is connected;
- statement — multi-statement transactions are not allowed.
- Select the pool size.
Optional: DBMS settings
To view default values of the DBMS settings or change them, click Edit. We recommend changing setting values only if necessary — incorrectly configured values can lead to cluster failure or degraded performance.
Create a database
- Создайте пользователя — the database must have an owner user.
- In the control panel, in the top menu, click Products and select Cloud Databases.
- Open the Active tab.
- Open the cluster page → Databases tab.
- Click Create database.
- Enter a database name.
- Select the database owner user.
- Enter the character set locale (
LC_CTYPE) — it determines character classification and case sensitivity. The locale cannot be changed after the database is created. Learn more about locales in the PostgreSQL documentation. - Enter the collation locale (
LC_COLLATE) — it determines string and character comparison settings and affects sorting. The locale cannot be changed after the database is created. - Click Create.