Creating a cluster of 1C:Enterprise Linux servers with Managed Service for PostgreSQL
- Before you start
- Prepare the infrastructure
- Create a VM for the 1C:Enterprise server
- Create a VM for the license server
- Create a cluster Managed Service for PostgreSQL
- Set up a Samba server
- Install the 1C:Enterprise server
- Set up a Samba server for the license server
- Install the 1C:Enterprise server for the license server
- Set up a server cluster
- Set up the infobase
- Connect to the infobase
- Delete the created resources
Yandex.Cloud lets you create PostgreSQL clusters optimized for 1C:Enterprise. To configure the use of 1C:Enterprise, you need to create a working server, a license server, and a Managed Service for PostgreSQL cluster. For 1C servers to run correctly, you should disable security services on them. Therefore the cluster will be accessed via an encrypted OpenVPN server connection, while the 1C servers will have no access to the internet. The 1C servers will be running CentOS 8. The 1C cluster will be configured using the Windows administration console.
Note
To use 1C:Enterprise, you need a license. For more information about licenses and their installation, see the 1C:Enterprise website.
To configure 1C:Enterprise servers:
- Before you start.
- Prepare the infrastructure.
- Create a VM for the 1C:Enterprise server.
- Create a VM for the license server.
- Create a Managed Service for PostgreSQL cluster.
- Set up a Samba server.
- Install the 1C:Enterprise server.
- Set up a Samba server for the license server.
- Install the 1C:Enterprise server for the license server.
- Set up a server cluster.
- Set up an infobase.
- Connect to the infobase.
If you no longer need the created resources, delete them.
Before you start
Before deploying the server, you need to sign up for Yandex.Cloud and create a billing account:
- Go to the management console. Then log in to Yandex.Cloud or sign up if don't already have an account.
- On the billing page, make sure you linked a billing account, and it has the
ACTIVE
orTRIAL_ACTIVE
status. If you don't have a billing account, create one.
If you have an active billing account, you can create or select a folder to run your VM in from the Yandex.Cloud page.
Learn more about clouds and folders.
Required paid resources
The infrastructure support cost for 1C-Enterprise in Yandex.Cloud includes:
- A fee for the disks and continuously running VMs (see Yandex Compute Cloud pricing).
- A fee for the continuously running Managed Service for PostgreSQL cluster (see pricing for Yandex Managed Service for PostgreSQL).
- A fee for using a dynamic or static external IP address (see Yandex Virtual Private Cloud pricing).
Prepare the infrastructure
- Make sure that you install the 1C:Enterprise client to check the performance of the infobase and the 1C administration console to manage the server cluster on your computer.
- Make sure you have a VM running in your cloud with OpenVPN configured for a secure connection to the 1C servers.
Note
You can download the necessary distributions from the 1C:Enterprise website.
Create a VM for the 1C:Enterprise server
To create a VM:
-
On the folder page in the management console, click Create resource and select Virtual machine.
-
In the Name field, enter the VM name:
server-1c
. -
Select the availability zone to host the VM in.
-
Under Images from Cloud Marketplace, click Select. Select a public CentOS 8 image.
-
Under Computing resources:
- Choose a platform.
- Specify the number of vCPUs and amount of RAM:
- vCPU: 4.
- Guaranteed vCPU share: 100%.
- RAM: 4 GB.
-
In the Network settings section, select the network and subnet to connect the VM to. If you don't have a network or subnet, create them right on the VM creation page.
-
In the Public address field, leave the value No address. The VM will be accessed via the OpenVPN server.
-
Specify data required for accessing the VM:
-
Enter the username in the Login field.
-
In the SSH key field, paste the contents of the public key file.
You need to create a key pair for the SSH connection yourself. Learn how to connect to VMs via SSH.
-
-
Click Create VM.
Creating the VM may take several minutes.
Create a VM for the license server
Install the 1C:Enterprise license on a separate server. This way changes to the configuration of other servers won't affect the installed license.
To create a VM:
-
On the folder page in the management console, click Create resource and select Virtual machine.
-
In the Name field, enter the VM name:
licensing-server-1c
. -
Select the availability zone to host the VM in.
-
Under Images from Cloud Marketplace, click Select. Select a public CentOS 8 image.
-
Under Computing resources:
- Choose a platform.
- Specify the number of vCPUs and amount of RAM:
- vCPU: 4.
- Guaranteed vCPU share: 100%.
- RAM: 4 GB.
-
In the Network settings section, select the network and subnet to connect the VM to. The VM should be created in the same subnet as the OpenVPN server.
-
In the Public address field, leave the value No address. The VM will be accessed via the OpenVPN server.
-
Specify data required for accessing the VM:
- Enter the username in the Login field.
- In the SSH key field, paste the contents of the public key file.
-
Click Create VM.
Creating the VM may take several minutes.
Create a cluster Managed Service for PostgreSQL
Yandex.Cloud lets you create Managed Service for PostgreSQL clusters optimized for 1C:Enterprise. Cluster settings may vary depending on your project requirements.
To create a Managed Service for PostgreSQL cluster optimized for 1C:
-
On the folder page in the management console, click Create resource and select Managed Service for PostgreSQL cluster.
-
In the Name field, enter the cluster name:
1c-pg
. -
In the Version list, select
10-1c
. -
Under Host class, select s2.small.
-
Under Storage size, enter local-ssd and 100 GB.
-
Under Database, enter:
- DB name:
1c-database
. - Username:
user1
. - Password: The password you'll use to access the database.
- Network: The network where the cluster will reside.
- Sorting locale:
ru_RU.UTF-8
. - Character set locale:
ru_RU.UTF-8
.
- DB name:
-
Under Hosts, select different availability zones for your hosts to ensure their fault tolerance.
-
Click Create cluster.
Creating the DB cluster may take several minutes.
Set up a Samba server
Connect to the server-1c
VM via SSH.
-
Install Samba, the necessary dependencies, and the
nano
text editor:$ sudo yum install nano samba samba-client samba-common, net-utils
-
Disable IPv6 to avoid server conflicts. To do this, open the file
/etc/sysctl.conf
:$ sudo nano /etc/sysctl.conf
-
Add the following lines to the file:
net.ip6.conf.all.disable_ipv6 = 1 net.ip6.conf.default.disable_ipv6 = 1
-
Add the following lines to the file
/etc/sysconfig/network
:NETWORKING_IPv6=no HOSTNAME=server-1c
-
Configure a shared directory. Open the Samba configuration file:
$ sudo nano /etc/samba/smb.conf
-
Make the file look like:
[global] workgroup = WORKGROUP server string = Samba Server%v netbios name = centos security = user map to guest = bad user dns proxy = no passdb backend = tdbsam printing = cups printcap name = cups load printers = yes cups iptions = raw security = user [files] path = /1c-files browsable = yes writable = yes guest ok = yes read only = no
-
Create a shared directory and grant access rights to it:
$ sudo mkdir /1c-files $ sudo chmod -R 777 /1c-files
-
Disable the firewall:
$ sudo systemctl stop firewalld $ sudo systemctl disable firewalld
-
Disable SELinux. Run
sudo nano /etc/sysconfig/selinux
to open the SELinux configuration file and edit theSELINUX
parameter:SELINUX=disabled
-
Add the Samba server service to the startup script and restart it:
$ sudo systemctl enable smb.service Created symlink from /etc/systemd/system/multi-user.target.wants/smb.service to /usr/lib/systemd/system/smb.service. $ sudo systemctl restart smb.service
Install the 1C:Enterprise server
Install the 1C:Enterprise server on the VM:
-
Upload the distribution archive to your VM's
1c-files
directory. -
Unpack the distribution and run the installation:
$ sudo tar –xvf /1c-files/<archive name> $ sudo yum localinstall /1c-files/*.rpm
-
Start the 1C server:
$ sudo systemctl start srv1cv83
-
Make sure the 1C:Enterprise server service is running:
$ systemctl status srv1cv83 ● srv1cv83.service - SYSV: Starts and stops the 1C:Enterprise daemons Loaded: loaded (/etc/rc.d/init.d/srv1cv83; bad; vendor preset: disabled) Active: active (exited) since Tue 2020-02-04 14:40:43 UTC; 4 days ago Docs: man:systemd-sysv-generator(8) Process: 27364 ExecStart=/etc/rc.d/init.d/srv1cv83 start (code=exited, status=0/SUCCESS)
Set up a Samba server for the license server
Connect to the server-1c
VM via SSH.
-
Install Samba, the necessary dependencies, and the
nano
text editor:$ sudo yum install nano samba samba-client samba-common, net-utils
-
Disable IPv6 to avoid server conflicts. To do this, open the file
/etc/sysctl.conf
:$ sudo nano /etc/sysctl.conf
-
Add the following lines to the file:
net.ip6.conf.all.disable_ipv6 = 1 net.ip6.conf.default.disable_ipv6 = 1
-
Run
sudo nano /etc/sysconfig/network
to add the following lines to the/etc/sysconfig/network
file:NETWORKING_IPv6=no HOSTNAME=server-1c
-
Configure a shared directory. To do this, open the Samba configuration file:
$ sudo nano /etc/samba/smb.conf
-
Make the file look like:
[global] workgroup = WORKGROUP server string = Samba Server%v netbios name = centos security = user map to guest = bad user dns proxy = no passdb backend = tdbsam printing = cups printcap name = cups load printers = yes cups iptions = raw security = user [files] path = /1c-files browsable = yes writable = yes guest ok = yes read only = no
-
Create a shared directory and grant access rights to it:
$ sudo mkdir /1c-files $ sudo chmod -R 777 /1c-files
-
Disable the firewall:
$ sudo systemctl stop firewalld $ sudo systemctl disable firewalld
-
Disable SELinux. Run
sudo nano /etc/sysconfig/selinux
to open the SELinux configuration file and edit theSELINUX
parameter:SELINUX=disabled
-
Add the Samba server service to the startup script and restart it:
$ sudo systemctl enable smb.service Created symlink from /etc/systemd/system/multi-user.target.wants/smb.service to /usr/lib/systemd/system/smb.service. $ sudo systemctl restart smb.service
Install the 1C:Enterprise server for the license server
Install the 1C:Enterprise server on the VM:
-
Upload the distribution archive to your VM's
1c-files
directory. -
Unpack the distribution and run the installation:
$ sudo tar –xvf /1c-files/<archive name> $ sudo yum localinstall /1c-files/*.rpm
-
Start the 1C server:
$ sudo systemctl start srv1cv83
-
Make sure the 1C:Enterprise server service is running:
$ systemctl status srv1cv83 ● srv1cv83.service - SYSV: Starts and stops the 1C:Enterprise daemons Loaded: loaded (/etc/rc.d/init.d/srv1cv83; bad; vendor preset: disabled) Active: active (exited) since Tue 2020-02-04 14:40:43 UTC; 4 days ago Docs: man:systemd-sysv-generator(8) Process: 27364 ExecStart=/etc/rc.d/init.d/srv1cv83 start (code=exited, status=0/SUCCESS)
Set up a server cluster
Before getting started, configure the server roles and add the infobase to the cluster.
- Run the 1C administration console on your computer.
- Add the 1C:Enterprise central server Open the context menu of the server list, select New and 1C:Enterprise central server 8.3.
- In the Name field, enter
server-1c
and click OK. You'll see the local cluster in the tree on the left. - Add the working server to the cluster. Open the Working servers context menu, choose New and Working server. In the Computer field of the window that opens, enter
licensing-server-1c
. This server will be used to issue licenses to other servers. - In the Requirements of functionality purpose section of the
licensing-server-1c
, open the context menu and select New and Requirement of functionality purpose.- In the Requirement object list, select Any requirement object.
- In the Requirement type list, select Do not assign.
- Leave the other parameters as they are and click OK.
- Apply requirements for assigning functionality to the cluster: open the cluster's context menu and select Apply requirements of functionality purpose (full).
- Add another requirement for assigning functionality to the
licensing-server-1c
with the following parameters:- In the Requirement object list, select Licensing service.
- In the Requirement type list, select Assign.
- Leave the other parameters as they are and click OK.
- Apply requirements for assigning functionality to the cluster: open the cluster's context menu and select Apply requirements of functionality purpose (full).
- Add a requirement for assigning functionality to the
server-1c
with the following parameters:- In the Requirement object list, select Client connection.
- In the Requirement type list, select Assign.
- Leave the other parameters as they are and click OK.
- Add another requirement for assigning functionality to the
server-1c
with the following parameters:- In the Requirement object list, select Licensing service.
- In the Requirement type list, select Do not assign.
- Leave the other parameters as they are and click OK.
- Apply requirements for assigning functionality to the cluster: open the cluster's context menu and select Apply requirements of functionality purpose (full).
Set up the infobase
-
In the administration console, open the Infobases context menu, select New and Infobase.
-
In the window that opens, set the parameters:
- Name: The name of the database in the Managed Service for PostgreSQL cluster,
1c-database
. - Secure connection: continuously.
- Database server: Your DB host address and port, such as
rc1a-cwxzr4yimhzgn5pp.mdb.yandexcloud.net port=6432
. - DBMS type: PostgreSQL.
- Database: The DB name,
1c-database
. - Database server user:
user1
. - Database user password: The user password that you set when creating the cluster.
- Allow license issuing by 1C:Enterprise server: Yes.
- Language (Country): English (United States).
- Create database if none present: Disabled.
- Lock execution of scheduled jobs: Disabled.
Click OK.
- Name: The name of the database in the Managed Service for PostgreSQL cluster,
Connect to the infobase
-
Connect to the OpenVPN server using the client.
-
Run the 1C:Enterprise client.
-
Click Add.
-
Select Add an existing infobase to the list and click Next.
-
Enter the infobase name, select On 1C:Enterprise server, and specify the following settings:
- Server cluster:
server-1c.ru-central1.internal
. - Infobase name:
1c
.
Click Next.
- Server cluster:
-
Click Ready.
The infobase should appear on the list of infobases. You can now start configuring and using the database.
Delete the created resources
To stop paying for the deployed infrastructure, delete the server-1c
and licensing-server-1c
VMs and the 1c-pg
cluster.
If you reserved a public static IP address, delete it.