Creating a PostgreSQL cluster for 1C:Enterprise
Managed Service for PostgreSQL allows you to create fault-tolerant PostgreSQL clusters optimized for 1C:Enterprise
. For this, the service supports PostgreSQL versions 11-1c, 12-1c, 13-1c, and 14-1c with all the necessary extensions installed and connection pooler configuration changed.
Warning
You can only connect 1C:Enterprise
to clusters running version 11-1c, 12-1c, 13-1c, and 14-1c.
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.
Create a Managed Service for PostgreSQL cluster
Create a Managed Service for PostgreSQL cluster of any suitable configuration with the following settings:
-
Name:
postgresql-1c
. -
Environment:
PRODUCTION
. -
Version:
12-1c
. -
Host class: At least
s2.small
. -
Storage size: At least 10 GB.
-
Database:
- DB name:
postgresql-1c
. - Username:
user-1c
. - Password: The password you will use to access the cluster.
- DB name:
-
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 don't have Terraform, install it.
-
Download the file with provider settings. Place it in a separate working directory and specify the parameter values.
-
Download the cluster configuration file postgresql-1c.tf to the same working directory.
This file describes:
- Network.
- Subnet.
- Default security group and rules required to connect to the cluster from the internet.
- Managed Service for PostgreSQL cluster for
1C:Enterprise
.
-
In
postgresql-1c.tf
, specify the password foruser-1c
that will be used to access a Managed Service for PostgreSQL cluster. -
Run the command
terraform init
in the directory with the configuration file. This command initializes the providers specified in the configuration files and lets you work with the provider resources and data sources. -
Make sure the Terraform configuration files are correct using the command:
terraform validate
If there are errors in the configuration files, Terraform will point to them.
-
Create the required infrastructure:
-
Run the command to view planned changes:
terraform plan
If the resource configuration descriptions are correct, the terminal will display a list of the resources to modify and their parameters. This is a test step. No resources are updated.
-
If you are happy with the planned changes, apply them:
-
Run the command:
terraform apply
-
Confirm the update of 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 the DB cluster may take several minutes.
1C:Enterprise
Connect the database to Add the created database as an information base to 1C:Enterprise
. When adding the database, use the following parameters:
- Secure connection:
Disabled
. - DBMS type:
PostgreSQL
. - Database server:
c-<cluster ID>.rw.mdb.yandexcloud.net port=6432
. - Database name:
postgresql-1c
. - Database user:
user-1c
. - User password:
<database user password>
. - Create database if none present: Disabled.
1C:Enterprise
support
PostgreSQL extensions for List of extensions installed in PostgreSQL 11-1c, 12-1c, 13-1c, and 14-1c clusters:
Delete the resources you created
If you no longer need these resources, delete the Managed Service for PostgreSQL cluster.
To delete the infrastructure created with Terraform:
-
In the terminal window, change to the directory containing the infrastructure plan.
-
Delete
postgresql-1c.tf
. -
Make sure the Terraform configuration files are correct using the command:
terraform validate
If there are errors in the configuration files, Terraform will point to them.
-
Confirm the update of resources.
-
Run the command to view planned changes:
terraform plan
If the resource configuration descriptions are correct, the terminal will display a list of the resources to modify and their parameters. This is a test step. No resources are updated.
-
If you are happy with the planned changes, apply them:
-
Run the command:
terraform apply
-
Confirm the update of resources.
-
Wait for the operation to complete.
-
All resources described in
postgresql-1c.tf
will be deleted. -