Технологические вопросы крупных внедрений
30.11.2022
Внимание! Материал данной статьи устарел. Рекомендуется использовать статью.
Минимальный размер оперативной памяти – 4 Гб.
Для выбора версии сервера рекомендуем воспользоваться таблицей
Версия 1С:Сервера взаимодействия |
Версия платформы 1С:Предприятие |
---|---|
7.0.25 | 8.3.16 |
6.0.47 | 8.3.15 |
5.0.43 | 8.3.14 |
4.0.73 | 8.3.13 |
Установочный образ:
https://mirror.yandex.ru/centos/7.7.1908/isos/x86_64/CentOS-7-x86_64-DVD-1908.iso
$ sudo yum install -y java-1.8.0-openjdk
Сервер взаимодействия:
https://releases.1c".ru/version_file?nick="CollaborationSystem&ver=7.0.25&path=CollaborationSystem\7_0_25_\1ce_cs_server_7.0.25_1.x86_64.rpm
Hazelcast:
https://releases.1c".ru/version_file?nick="CollaborationSystem&ver=7.0.25&path=CollaborationSystem\7_0_25_\1ce_cs_hazelcast_3.9.4_1.x86_64.rpm
Elasticsearch:
https://releases.1c".ru/version_file?nick="CollaborationSystem&ver=7.0.25&path=CollaborationSystem\7_0_25_\1ce_cs_elasticsearch_5.6.12_12.x86_64.rpm
Ring:
https://releases.1c".ru/version_file?nick="CollaborationSystem&ver=7.0.25&path=CollaborationSystem\7_0_25_\1c_enterprise_ring_0.8.2_1.x86_64.rpm
PostgreSQL:
https://releases.1c.ru/version_file?nick=AddCompPostgre&ver=11.5-19.1C&path=AddCompPostgre\11_5_19_1C\postgresql_11.5_19.1C_x86_64_rpm.tar.bz2
https://releases.1c.ru/additional_file?nick=AddCompPostgre&path=AddCompPostgre\Extrafiles\centos_7.7.1908.x64.tar.gz
$ tar xvzf centos_7.7.1908.x64.tar.gz
$ tar xvjf postgresql_11.5_19.1C_x86_64_rpm.tar.bz2
$ su -l
# export JAVA_HOME="/usr/"lib/jvm/java-1.8.0-openjdk-1.8.0.242.b08-0.el7_7.x86_64/jre
# rpm -ihv 1ce_cs_elasticsearch_5.6.12_12.x86_64.rpm 1ce_cs_server_7.0.25_1.x86_64.rpm 1ce_cs_hazelcast_3.9.4_1.x86_64.rpm 1c_enterprise_ring_0.8.2_1.x86_64.rpm
# rpm -ihv libicu-50.2-3.el7.x86_64.rpm libxslt-1.1.28-5.el7.x86_64.rpm
# rpm -ihv postgresql11-1c-11.5-19.el7.x86_64.rpm postgresql11-1c-libs-11.5-19.el7.x86_64.rpm postgresql11-1c-contrib-11.5-19.el7.x86_64.rpm postgresql11-1c-server-11.5-19.el7.x86_64.rpm
# passwd postgres
# su postgres
$ /usr/pgsql-11/bin/initdb -D /var/lib/pgsql/11/data
$ psql
postgres="# CREATE DATABASE cs_db;
postgres=# \c cs_db
postgres=# CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
postgres=# \q
$ exit
# systemctl enable postgresql-11
# systemctl start postgresql-11
# useradd cs_user
# mkdir -p /var/cs/cs_instance
# chown cs_user:cs_user /var/cs/cs_instance
# /opt/1C/1CE/x86_64/ring/ring cs instance create --dir /var/cs/cs_instance --owner cs_user
# /opt/1C/1CE/x86_64/ring/ring cs --instance cs_instance service create --username cs_user --java-home $JAVA_HOME --stopped
# useradd hc_user
# mkdir -p /var/cs/hc_instance
# chown hc_user:hc_user /var/cs/hc_instance
# /opt/1C/1CE/x86_64/ring/ring hazelcast instance create --dir /var/cs/hc_instance --owner hc_user
# /opt/1C/1CE/x86_64/ring/ring hazelcast --instance hc_instance service create --username hc_user --java-home $JAVA_HOME --stopped
# useradd elastic_user
# mkdir -p /var/cs/elastic_instance
# chown elastic_user:elastic_user /var/cs/elastic_instance
# /opt/1C/1CE/x86_64/ring/ring elasticsearch instance create --dir /var/cs/elastic_instance --owner elastic_user
# /opt/1C/1CE/x86_64/ring/ring elasticsearch --instance elastic_instance service create --username elastic_user --java-home $JAVA_HOME --stopped
# /opt/1C/1CE/x86_64/ring/ring cs --instance cs_instance jdbc set-params --url jdbc:postgresql://localhost:5432/cs_db?currentSchema=public
# /opt/1C/1CE/x86_64/ring/ring cs --instance cs_instance jdbc set-params --username postgres
# /opt/1C/1CE/x86_64/ring/ring cs --instance cs_instance jdbc set-params --password postgres
# /opt/1C/1CE/x86_64/ring/ring cs --instance cs_instance jdbc-privileged set-params --url jdbc:postgresql://localhost:5432/cs_db?currentSchema=public
# /opt/1C/1CE/x86_64/ring/ring cs --instance cs_instance jdbc-privileged set-params --username postgres
# /opt/1C/1CE/x86_64/ring/ring cs --instance cs_instance jdbc-privileged set-params --password postgres
# /opt/1C/1CE/x86_64/ring/ring cs --instance cs_instance websocket set-params --hostname <cs_host>
# /opt/1C/1CE/x86_64/ring/ring cs --instance cs_instance websocket set-params --port 8087
<cs_host>
Запуск
# /opt/1C/1CE/x86_64/ring/ring hazelcast --instance hc_instance service start
# /opt/1C/1CE/x86_64/ring/ring elasticsearch --instance elastic_instance service start
# /opt/1C/1CE/x86_64/ring/ring cs --instance cs_instance service start
# curl http://localhost:8087/rs/health
{"status":"UP","mainDbOk":true,"allShardsOk":true,"hazelcast":{"available":true,"members":["127.0.0.1:5701"]},"elasticsearchOk":true,"mediaClusterOk":false,"mediaServers":{},"pushOk":false,"services":{"available":true,"unsatisfied":[]}}
/var/cs/cs_instance/logs/
/var/cs/hc_instance/logs/
/var/cs/elastic_instance/logs/
# curl -Sf -X POST -H "Content-Type: application/json" -d "{ \"url\" : \"jdbc:postgresql://localhost:5432/cs_db\", \"username\" : \"postgres\", \"password\" : \"postgres\", \"enabled\" : true }" -u admin:admin http://localhost:8087/admin/bucket_server
{"id":"b844212d-9744-4cb0-9e2a-8377185d8222","url":"jdbc:postgresql://localhost:5432/cs_db","username":"postgres","password":"postgres","lastUsedAt":null,"enabled":true,"deleted":false}
# firewall-cmd --zone="public --add-port=8087/tcp" --permanent
# firewall-cmd --reload
Для обмена файлами в системе взаимодействия необходимо подключиться на сервере взаимодействия к хранилищу файлов.Хранилище должно поддерживать протокол S3 (V2 или V4).
Можно развернуть собственное хранилище:
Или подключиться к существующим:
Необходимо выбрать только один вариант использования хранилища файлов:
$ sudo mkdir -p /opt/minio
$ sudo chown user:user /opt/minio
$ sudo mkdir -p /var/minio
$ sudo chown user:user /var/minio
$ cd /opt/minio
$ wget https://dl.min.io/server/minio/release/linux-amd64/minio
$ sudo chmod +x minio
$ sudo firewall-cmd --zone="public --add-port=9000/tcp" --permanent
$ sudo firewall-cmd --reload
$ sudo vi /etc/default/minio
MINIO_VOLUMES=""/var/minio/&"quot;
MINIO_ACCESS_KEY="<"span >minio
MINIO_SECRET_KEY="<"span >minio123
$ sudo vi /etc/systemd/system/minio.service
[Unit]
Description="MinIO
Documentation=https://docs.min.io
Wants=network-online.target
After=network-online.target
AssertFileIsExecutable=/opt/minio/minio
[Service]
WorkingDirectory=/usr/local/
User=user
Group=user
EnvironmentFile=/etc/default/minio
ExecStartPre=/bin/bash -c "if [ -z \"${MINIO_VOLUMES}\" ]; then echo \"Variable MINIO_VOLUMES not set in /etc/default/minio\"; exit 1; fi"
ExecStart=/opt/minio/minio server $MINIO_OPTS $MINIO_VOLUMES
Restart=always
LimitNOFILE=65536
TimeoutStopSec=infinity
SendSIGKILL=no
[Install]
WantedBy=multi-user.target
$ sudo systemctl enable minio.service
$ sudo systemctl start minio.service
http://IP-адрес-сервера-хранилища:9000
Для добавления хранилища файлов в базу сервера взаимодействия:
$ su postgres
$ vi /tmp/create_bucket.sql
INSERT INTO public.storage_server(id, type, base_url, container_url, container_name, region, access_key_id, secret_key, signature_version, is_deleted, upload_limit, download_limit, file_size_limit, created_at, updated_at, cdn_url, cdn_key_id, cdn_secret_key, state, cdn_enabled, path_style_access_enabled, bytes_to_keep, days_to_keep, pricing_url)
VALUES(
uuid_generate_v4(), 'AMAZON', 'http://ИМЯ СЕРВЕРА ИЛИ IP:9000','http://ИМЯ СЕРВЕРА ИЛИ IP:9000/${container_name}',
'cs-bucket',
'',
'minio',
'minio123',
'V2', false, 1073741824, 1073741824, 104857600, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL, NULL, 'ACTIVE', false, true, 0, 0, NULL);
$ psql -U postgres --dbname=cs_db --file=/tmp/create_bucket.sql
Если вы планируете работать в web-клиенте, то необходимо настроить CORS:
<?xml quot; encoding=""UTF-8&"quot;?>
<CORSConfiguration xmlns=""http://s3.amazonaws.com/doc/2006-03-01/&"quot;>
<CORSRule>
<AllowedOrigin>*</AllowedOrigin>
<AllowedMethod>GET</AllowedMethod>
<AllowedMethod>POST</AllowedMethod>
<AllowedMethod>DELETE</AllowedMethod>
<AllowedHeader>*</AllowedHeader>
</CORSRule>
</CORSConfiguration>
Для добавления хранилища файлов в базу сервера взаимодействия:
$ su postgres
$ vi /tmp/create_bucket.sql
INSERT INTO public.storage_server(id, type, base_url, container_url, container_name, region, access_key_id, secret_key, signature_version, is_deleted, upload_limit, download_limit, file_size_limit, created_at, updated_at, cdn_url, cdn_key_id, cdn_secret_key, state, cdn_enabled, path_style_access_enabled, bytes_to_keep, days_to_keep, pricing_url)
VALUES(
uuid_generate_v4(), 'AMAZON', 'https://s3.amazonaws.com','https://${container_name}.s3.${region}.amazonaws.com',
'Имя хранилища',
'eu-west-1',
'Access Key ID',
'Secret Access Key',
'V4', false, 1073741824, 1073741824, 104857600, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL, NULL, 'ACTIVE', false, true, 0, 0, NULL);
$ psql -U postgres --dbname="cs_db --file=/tmp/create_bucket.sql
Для подключения информационной базы необходимо использовать обработку:
https://releases.1c.ru/version_file?nick=CollaborationSystem&ver=7.0.25&path=CollaborationSystem\7_0_25_\CollaborationSystemRegister.epf