Creating a PostgreSQL cluster for 1C:Enterprise
Managed Service for PostgreSQL allows creating fault-tolerant PostgreSQL clusters optimized for 1C:Enterprise. To this end, the service supports PostgreSQL versions 13-1c, 14-1c, 15-1c, and 16-1c with all the required extensions installed and the connection pooler configuration modified.
Warning
You can only connect 1C:Enterprise to 13-1c, 14-1c, 15-1c, and 16-1c clusters.
Select your host class based on the number of users in your 1C:Enterprise installation. The s2.small hosts can accommodate up to 50 users at a time. We recommend using the s2.medium class if 50 or more users are going to access the database. Choose the storage size based on your expected data scope and allow for possible growth in your data volumes.
Required paid resources
The support cost includes:
- Managed Service for PostgreSQL cluster fee: Using computing resources allocated to hosts and disk space (see Managed Service for PostgreSQL pricing).
- Fee for using public IP addresses if public access is enabled for cluster hosts (see Virtual Private Cloud pricing).
Create a Managed Service for PostgreSQL cluster
Create a Managed Service for PostgreSQL cluster of any suitable configuration with the following settings:
- Environment:
PRODUCTION
. - Version: PostgreSQL version for 1C:Enterprise. The names of such versions end with
-1c
. - Host class:
s2.small
or higher. - Hosts: Add at least two more hosts in different availability zones. This provides the fault tolerance of the cluster. The database is automatically replicated. For more information, see Replication in Managed Service for PostgreSQL.
-
If you do not have Terraform yet, install it.
-
Get the authentication credentials. You can add them to environment variables or specify them later in the provider configuration file.
-
Configure and initialize a provider. There is no need to create a provider configuration file manually, you can download it
. -
Place the configuration file in a separate working directory and specify the parameter values. If you did not add the authentication credentials to environment variables, specify them in the configuration file.
-
Download the postgresql-1c.tf
configuration file to the same working directory.This file describes:
- Network.
- Subnet.
- Security group and rule enabling cluster connections.
- Managed Service for PostgreSQL cluster for 1C:Enterprise with a database and a user.
-
Specify the infrastructure settings in the
postgresql-1c.tf
configuration file underlocals
:cluster_name
: Cluster name.pg_version
: PostgreSQL version for 1C:Enterprise. The names of such versions end with-1c
.db_name
: Database name.username
andpassword
: Name and user password of the database owner.
-
Make sure the Terraform configuration files are correct using this command:
terraform validate
Terraform will show any errors found in your configuration files.
-
Create the required infrastructure:
-
Run this command to view the planned changes:
terraform plan
If you described the configuration correctly, the terminal will display a list of the resources to update and their parameters. This is a verification step that does not apply changes to your resources.
-
If everything looks correct, apply the changes:
-
Run this command:
terraform apply
-
Confirm updating the resources.
-
Wait for the operation to complete.
-
All the required resources will be created in the specified folder. You can check resource availability and their settings in the management console
. -
Creating a DB cluster may take a few minutes.
Connect the database to 1C:Enterprise
Add the created database as an information base to 1C:Enterprise. When adding the database, use the following parameters:
- Server cluster: Name of the 1C:Enterprise server to create the information base on.
- Information base name in cluster: Name of the information base to create on the 1C:Enterprise server.
- Secure connection: Disabled.
- DBMS type:
PostgreSQL
. - Database server:
c-<cluster_ID>.rw.mdb.yandexcloud.net port=6432
. - Database name: Name of the database you specified when creating the Managed Service for PostgreSQL cluster.
- Database user: Username of the database owner.
- User password: Password of the database owner.
- Create database if none present: Disabled.
PostgreSQL extensions to support 1C:Enterprise
List of extensions installed in PostgreSQL 13-1c, 14-1c, 15-1c, and 16-1c clusters:
Delete the resources you created
Delete the resources you no longer need to avoid paying for them:
-
In the terminal window, go to the directory containing the infrastructure plan.
Warning
Make sure the directory has no Terraform manifests with the resources you want to keep. Terraform deletes all resources that were created using the manifests in the current directory.
-
Delete resources:
-
Run this command:
terraform destroy
-
Confirm deleting the resources and wait for the operation to complete.
All the resources described in the Terraform manifests will be deleted.
-