Платформа 8.3 → Ручной запуск второй копии сервера 1С на linux ubuntu 16.04
27.2. Создание службы сервера «1С:Предприятия»
Установка с нуля (ранее 1с не был установлен на стандартных портах)
Установка 1С
$ mkdir ~/test
$ cd ~/test
$ ls
deb64_8_3_15_1656.tar.gz
$ mkdir -p /tmp/1ctmp
$ cd /tmp/1ctmp
$ cp /home/user/test/deb64_8_3_15_1656.tar.gz /tmp/1ctmp
$ tar xvzf deb64_8_3_15_1656.tar.gz
$ mkdir /tmp/1ctmp/tmp
$ dpkg-deb -x 1c-enterprise83-common_8.3.15-1656_amd64.deb /tmp/1ctmp/tmp
$ dpkg-deb -x 1c-enterprise83-server_8.3.15-1656_amd64.deb /tmp/1ctmp/tmp
$ sudo mkdir /opt/1C
$ sudo mv tmp/opt/1C/v8.3/ /opt/1C/v8.3.15.1656/
$ sudo groupadd grp1cv8
$ sudo useradd -g grp1cv8 -m -d /home/usr1cv8 usr1cv8
$ sudo chown -R usr1cv8:grp1cv8 /opt/1C
#$ sudo echo -e "pass\npass\n" | sudo passwd usr1cv8
#$ sudo usermod -aG sudo usr1cv8
$ sudo apt install imagemagick -y
$ sudo apt install libfreetype6 libgsf-1-common unixodbc glib2.0
#ubuntu
$ sudo apt install -y xfonts-utils cabextract
$ sudo apt install ttf-mscorefonts-installer -y
#$ sudo dpkg -i fonts-ttf-ms_1.0-eter4ubuntu_all.deb
$ sudo fc-cache -fv
$ sudo apt install -y libc6-i386
$ cd ~/test
$ wget http://download.etersoft.ru/pub/Etersoft/HASP/last/x86_64/Ubuntu/18.04/haspd-modules_7.90-eter2ubuntu_amd64.deb
$ wget http://download.etersoft.ru/pub/Etersoft/HASP/last/x86_64/Ubuntu/18.04/haspd_7.90-eter2ubuntu_amd64.deb
$ sudo dpkg -i *.deb
#$ sudo apt-get install -f -y
$ sudo service haspd start
$ sudo service haspd status
#$ sudo reboot
$ sudo nano /etc/systemd/system/srv1cv83-15.1656.service
#
# srv1cv83-15.1656.service
#
[Unit]
Description=1C:Enterprise Server
Wants=network.target
After=network.target
[Service]
#MemoryAccounting=true
#MemoryLimit=15G
Type=simple
Environment=LANG=ru_RU.UTF-8
Environment=TZ=Europe/Moscow
Environment=PORT=1540
Environment=REGPORT=1541
Environment=RANGE=1560:1690
Environment=DATADIR=/home/usr1cv8/.v8.3.15.1656/1C/1Cv83
PrivateTmp=yes
ExecStart=/opt/1C/v8.3.15.1656/x86_64/ragent -d $DATADIR -port $PORT -regport $REGPORT -range $RANGE
# -seclev 0 -debug
Restart=always
RestartSec=3
User=usr1cv8
[Install]
WantedBy=multi-user.target
Сохранить.
Команды:
$ sudo systemctl daemon-reload # запускать после изменений файла
$ sudo systemctl start srv1cv83-15.1656.service
$ sudo systemctl status srv1cv83-15.1656.service
$ sudo systemctl enable srv1cv83-15.1656.service
#
#$ sudo systemctl stop srv1cv83-15.1656.service
#$ sudo systemctl restart srv1cv83-15.1656.service
#$ sudo systemctl status srv1cv83-15.1656.service
$ sudo systemctl status srv1cv83-15.1656.service
$ ss -tlnp | grep :15
LISTEN 0 128 *:1560 *:*
LISTEN 0 128 *:1540 *:*
LISTEN 0 128 *:1541 *:*
LISTEN 0 128 :::1560 :::*
LISTEN 0 128 :::1540 :::*
LISTEN 0 128 :::1541 :::*
Для программной лицензии (прявязанной к hasp)
в /var/1C/licenses
Положить лицензию
$ sudo mv 20190207114003.lic /var/1C/licenses
или вставить hasp
Запуск службы сервера администрирования RAS
$ sudo nano /etc/systemd/system/srv1cv83-15.1656-ras.service
Вставить:
[Unit]
Description=1C:Enterprise Remote Administration Service
After=network.target remote-fs.target nss-lookup.target
Requires=srv1cv83-15.1656.service
[Service]
Type=simple
ExecStart=/opt/1C/v8.3.15.1656/x86_64/ras cluster localhost:1540 --port=1545
KillSignal=SIGINT
PrivateTmp=true
Restart=on-failure
RestartSec=5
User=usr1cv8
Group=grp1cv8
[Install]
WantedBy=multi-user.target
Сохранить.
#$ sudo systemctl daemon-reload
$ sudo systemctl start srv1cv83-15.1656-ras.service
$ sudo systemctl status srv1cv83-15.1656-ras.service
$ sudo systemctl enable srv1cv83-15.1656-ras.service
$ systemctl list-unit-files | grep srv1cv83
srv1cv83-15.1656-ras.service enabled
srv1cv83-15.1656.service enabled
Удаление сервиса
$ sudo systemctl stop srv1cv83-15.1656-ras.service
$ sudo systemctl disable srv1cv83-15.1656-ras.service
$ sudo rm /etc/systemd/system/srv1cv83-15.1656-ras.service
$ sudo systemctl daemon-reload
$ sudo systemctl reset-failed
Установка дополнительной 8.3.15.1656
~/test$ ls
deb64_8_3_15_1656.tar.gz
$ mkdir -p /tmp/1ctmp
$ cd /tmp/1ctmp
$ cp /home/user/test/deb64_8_3_15_1656.tar.gz /tmp/1ctmp
$ tar xvzf deb64_8_3_15_1656.tar.gz
$ mkdir /tmp/1ctmp/tmp
$ dpkg-deb -x 1c-enterprise83-common_8.3.15-1656_amd64.deb tmp
$ dpkg-deb -x 1c-enterprise83-server_8.3.15-1656_amd64.deb tmp
$ sudo mv tmp/opt/1C/v8.3/ /opt/1C/v8.3.15.1656/
$ sudo nano /etc/systemd/system/srv1cv83-15.1656.service
#
# srv1cv83-15.1656.service
#
[Unit]
Description=1C:Enterprise Server
Wants=network.target
After=network.target
[Service]
#MemoryAccounting=true
#MemoryLimit=15G
Type=simple
Environment=LANG=ru_RU.UTF-8
Environment=TZ=Europe/Moscow
Environment=PORT=1740
Environment=REGPORT=1741
Environment=RANGE=1760:1890
Environment=DATADIR=/home/usr1cv8/.v8.3.15.1656/1C/1Cv83
PrivateTmp=yes
ExecStart=/opt/1C/v8.3.15.1656/x86_64/ragent -d $DATADIR -port $PORT -regport $REGPORT -range $RANGE
# -seclev 0 -debug
Restart=always
RestartSec=3
User=usr1cv8
[Install]
WantedBy=multi-user.target
Сохранить.
Команды:
$ sudo systemctl daemon-reload # запускать после изменений файла
$ sudo systemctl start srv1cv83-15.1656.service
$ sudo systemctl status srv1cv83-15.1656.service
$ sudo systemctl enable srv1cv83-15.1656.service
#
$ sudo systemctl stop srv1cv83-15.1656.service
$ sudo systemctl restart srv1cv83-15.1656.service
$ sudo systemctl status srv1cv83-15.1656.service
Если хочется при этом отказаться от оригинального скрипта:$ sudo systemctl disable srv1cv83 # отключить автоматический запуск
$ sudo systemctl mask srv1cv83 # запретить запуск вообще
Удаление сервиса
$ sudo systemctl stop srv1cv83-15.1656.service
$ sudo systemctl disable srv1cv83-15.1656.service
$ sudo rm /etc/systemd/system/srv1cv83-15.1656.service
$ sudo systemctl daemon-reload
$ sudo systemctl reset-failed
Запуск службы сервера администрирования RAS
$ sudo nano /etc/systemd/system/srv1cv83-15.1656-ras.service
Вставить:
[Unit]
Description=1C:Enterprise Remote Administration Service
After=network.target remote-fs.target nss-lookup.target
Requires=srv1cv83-15.1656.service
[Service]
Type=simple
ExecStart=/opt/1C/v8.3.15.1656/x86_64/ras cluster localhost:1740 --port=1745
KillSignal=SIGINT
PrivateTmp=true
Restart=on-failure
RestartSec=5
User=usr1cv8
Group=grp1cv8
[Install]
WantedBy=multi-user.target
Сохранить.
#$ sudo systemctl daemon-reload
$ sudo systemctl enable srv1cv83-15.1656-ras.service
$ sudo systemctl start srv1cv83-15.1656-ras.service
$ sudo systemctl status srv1cv83-15.1656-ras.service
$ systemctl list-unit-files | grep srv1cv83
srv1cv83-15.1656-ras.service enabled
srv1cv83-15.1656.service enabled
sudo systemctl stop [servicename]
sudo systemctl disable [servicename]
sudo rm /etc/systemd/system/[servicename]
sudo rm /etc/systemd/system/[servicename] symlinks that might be related
sudo systemctl daemon-reload
sudo systemctl reset-failed
$ sudo systemctl restart srv1cv83-15.1656-ras.service
$ sudo systemctl status srv1cv83-15.1656-ras.service
$ sudo su - usr1cv8 -c "/opt/1C/v8.3.15.1656/x86_64/rac cluster localhost:1545 list"
$ sudo systemctl restart srv1cv83-15.1565-ras.service
$ sudo systemctl status srv1cv83-15.1565-ras.service
$ sudo su - usr1cv8 -c "/opt/1C/v8.3.15.1565/x86_64/rac cluster localhost:1745 list"
$ sudo nano /etc/systemd/system/srv1cv83-15.1565-ras.service
Пример исправления сервиса selhoz-8.3.15.1830.service
Посмотреть:
sudo systemctl status selhoz-8.3.15.1830.service
sudo systemctl stop selhoz-8.3.15.1830.service
sudo systemctl disable selhoz-8.3.15.1830.service
sudo nano /etc/systemd/system/selhoz-8.3.15.1830.service
исправить порты в на всякий случай в двух местах!!!
sudo systemctl daemon-reload
sudo systemctl enable selhoz-8.3.15.1830.service
sudo systemctl start selhoz-8.3.15.1830.service
sudo systemctl status selhoz-8.3.15.1830.service
27.2. Создание службы сервера «1С:Предприятия»
Установка с нуля (ранее 1с не был установлен на стандартных портах)
Установка 1С
$ mkdir ~/test
$ cd ~/test
$ ls
deb64_8_3_15_1656.tar.gz
$ mkdir -p /tmp/1ctmp
$ cd /tmp/1ctmp
$ cp /home/user/test/deb64_8_3_15_1656.tar.gz /tmp/1ctmp
$ tar xvzf deb64_8_3_15_1656.tar.gz
$ mkdir /tmp/1ctmp/tmp
$ dpkg-deb -x 1c-enterprise83-common_8.3.15-1656_amd64.deb /tmp/1ctmp/tmp
$ dpkg-deb -x 1c-enterprise83-server_8.3.15-1656_amd64.deb /tmp/1ctmp/tmp
$ sudo mkdir /opt/1C
$ sudo mv tmp/opt/1C/v8.3/ /opt/1C/v8.3.15.1656/
$ sudo groupadd grp1cv8
$ sudo useradd -g grp1cv8 -m -d /home/usr1cv8 usr1cv8
$ sudo chown -R usr1cv8:grp1cv8 /opt/1C
#$ sudo echo -e "pass\npass\n" | sudo passwd usr1cv8
#$ sudo usermod -aG sudo usr1cv8
$ sudo apt install imagemagick -y
$ sudo apt install libfreetype6 libgsf-1-common unixodbc glib2.0
#ubuntu
$ sudo apt install -y xfonts-utils cabextract
$ sudo apt install ttf-mscorefonts-installer -y
#$ sudo dpkg -i fonts-ttf-ms_1.0-eter4ubuntu_all.deb
$ sudo fc-cache -fv
$ sudo apt install -y libc6-i386
$ cd ~/test
$ wget http://download.etersoft.ru/pub/Etersoft/HASP/last/x86_64/Ubuntu/18.04/haspd-modules_7.90-eter2ubuntu_amd64.deb
$ wget http://download.etersoft.ru/pub/Etersoft/HASP/last/x86_64/Ubuntu/18.04/haspd_7.90-eter2ubuntu_amd64.deb
$ sudo dpkg -i *.deb
#$ sudo apt-get install -f -y
$ sudo service haspd start
$ sudo service haspd status
#$ sudo reboot
$ sudo nano /etc/systemd/system/srv1cv83-15.1656.service
#
# srv1cv83-15.1656.service
#
[Unit]
Description=1C:Enterprise Server
Wants=network.target
After=network.target
[Service]
#MemoryAccounting=true
#MemoryLimit=15G
Type=simple
Environment=LANG=ru_RU.UTF-8
Environment=TZ=Europe/Moscow
Environment=PORT=1540
Environment=REGPORT=1541
Environment=RANGE=1560:1690
Environment=DATADIR=/home/usr1cv8/.v8.3.15.1656/1C/1Cv83
PrivateTmp=yes
ExecStart=/opt/1C/v8.3.15.1656/x86_64/ragent -d $DATADIR -port $PORT -regport $REGPORT -range $RANGE
# -seclev 0 -debug
Restart=always
RestartSec=3
User=usr1cv8
[Install]
WantedBy=multi-user.target
Сохранить.
Команды:
$ sudo systemctl daemon-reload # запускать после изменений файла
$ sudo systemctl start srv1cv83-15.1656.service
$ sudo systemctl status srv1cv83-15.1656.service
$ sudo systemctl enable srv1cv83-15.1656.service
#
#$ sudo systemctl stop srv1cv83-15.1656.service
#$ sudo systemctl restart srv1cv83-15.1656.service
#$ sudo systemctl status srv1cv83-15.1656.service
$ sudo systemctl status srv1cv83-15.1656.service
$ ss -tlnp | grep :15
LISTEN 0 128 *:1560 *:*
LISTEN 0 128 *:1540 *:*
LISTEN 0 128 *:1541 *:*
LISTEN 0 128 :::1560 :::*
LISTEN 0 128 :::1540 :::*
LISTEN 0 128 :::1541 :::*
Для программной лицензии (прявязанной к hasp)
в /var/1C/licenses
Положить лицензию
$ sudo mv 20190207114003.lic /var/1C/licenses
или вставить hasp
Запуск службы сервера администрирования RAS
$ sudo nano /etc/systemd/system/srv1cv83-15.1656-ras.service
Вставить:
[Unit]
Description=1C:Enterprise Remote Administration Service
After=network.target remote-fs.target nss-lookup.target
Requires=srv1cv83-15.1656.service
[Service]
Type=simple
ExecStart=/opt/1C/v8.3.15.1656/x86_64/ras cluster localhost:1540 --port=1545
KillSignal=SIGINT
PrivateTmp=true
Restart=on-failure
RestartSec=5
User=usr1cv8
Group=grp1cv8
[Install]
WantedBy=multi-user.target
Сохранить.
#$ sudo systemctl daemon-reload
$ sudo systemctl start srv1cv83-15.1656-ras.service
$ sudo systemctl status srv1cv83-15.1656-ras.service
$ sudo systemctl enable srv1cv83-15.1656-ras.service
$ systemctl list-unit-files | grep srv1cv83
srv1cv83-15.1656-ras.service enabled
srv1cv83-15.1656.service enabled
Удаление сервиса
$ sudo systemctl stop srv1cv83-15.1656-ras.service
$ sudo systemctl disable srv1cv83-15.1656-ras.service
$ sudo rm /etc/systemd/system/srv1cv83-15.1656-ras.service
$ sudo systemctl daemon-reload
$ sudo systemctl reset-failed
Установка дополнительной 8.3.15.1656
~/test$ ls
deb64_8_3_15_1656.tar.gz
$ mkdir -p /tmp/1ctmp
$ cd /tmp/1ctmp
$ cp /home/user/test/deb64_8_3_15_1656.tar.gz /tmp/1ctmp
$ tar xvzf deb64_8_3_15_1656.tar.gz
$ mkdir /tmp/1ctmp/tmp
$ dpkg-deb -x 1c-enterprise83-common_8.3.15-1656_amd64.deb tmp
$ dpkg-deb -x 1c-enterprise83-server_8.3.15-1656_amd64.deb tmp
$ sudo mv tmp/opt/1C/v8.3/ /opt/1C/v8.3.15.1656/
$ sudo nano /etc/systemd/system/srv1cv83-15.1656.service
#
# srv1cv83-15.1656.service
#
[Unit]
Description=1C:Enterprise Server
Wants=network.target
After=network.target
[Service]
#MemoryAccounting=true
#MemoryLimit=15G
Type=simple
Environment=LANG=ru_RU.UTF-8
Environment=TZ=Europe/Moscow
Environment=PORT=1740
Environment=REGPORT=1741
Environment=RANGE=1760:1890
Environment=DATADIR=/home/usr1cv8/.v8.3.15.1656/1C/1Cv83
PrivateTmp=yes
ExecStart=/opt/1C/v8.3.15.1656/x86_64/ragent -d $DATADIR -port $PORT -regport $REGPORT -range $RANGE
# -seclev 0 -debug
Restart=always
RestartSec=3
User=usr1cv8
[Install]
WantedBy=multi-user.target
Сохранить.
Команды:
$ sudo systemctl daemon-reload # запускать после изменений файла
$ sudo systemctl start srv1cv83-15.1656.service
$ sudo systemctl status srv1cv83-15.1656.service
$ sudo systemctl enable srv1cv83-15.1656.service
#
$ sudo systemctl stop srv1cv83-15.1656.service
$ sudo systemctl restart srv1cv83-15.1656.service
$ sudo systemctl status srv1cv83-15.1656.service
Если хочется при этом отказаться от оригинального скрипта:$ sudo systemctl disable srv1cv83 # отключить автоматический запуск
$ sudo systemctl mask srv1cv83 # запретить запуск вообще
Удаление сервиса
$ sudo systemctl stop srv1cv83-15.1656.service
$ sudo systemctl disable srv1cv83-15.1656.service
$ sudo rm /etc/systemd/system/srv1cv83-15.1656.service
$ sudo systemctl daemon-reload
$ sudo systemctl reset-failed
Запуск службы сервера администрирования RAS
$ sudo nano /etc/systemd/system/srv1cv83-15.1656-ras.service
Вставить:
[Unit]
Description=1C:Enterprise Remote Administration Service
After=network.target remote-fs.target nss-lookup.target
Requires=srv1cv83-15.1656.service
[Service]
Type=simple
ExecStart=/opt/1C/v8.3.15.1656/x86_64/ras cluster localhost:1740 --port=1745
KillSignal=SIGINT
PrivateTmp=true
Restart=on-failure
RestartSec=5
User=usr1cv8
Group=grp1cv8
[Install]
WantedBy=multi-user.target
Сохранить.
#$ sudo systemctl daemon-reload
$ sudo systemctl enable srv1cv83-15.1656-ras.service
$ sudo systemctl start srv1cv83-15.1656-ras.service
$ sudo systemctl status srv1cv83-15.1656-ras.service
$ systemctl list-unit-files | grep srv1cv83
srv1cv83-15.1656-ras.service enabled
srv1cv83-15.1656.service enabled
sudo systemctl stop [servicename]
sudo systemctl disable [servicename]
sudo rm /etc/systemd/system/[servicename]
sudo rm /etc/systemd/system/[servicename] symlinks that might be related
sudo systemctl daemon-reload
sudo systemctl reset-failed
$ sudo systemctl restart srv1cv83-15.1656-ras.service
$ sudo systemctl status srv1cv83-15.1656-ras.service
$ sudo su - usr1cv8 -c "/opt/1C/v8.3.15.1656/x86_64/rac cluster localhost:1545 list"
$ sudo systemctl restart srv1cv83-15.1565-ras.service
$ sudo systemctl status srv1cv83-15.1565-ras.service
$ sudo su - usr1cv8 -c "/opt/1C/v8.3.15.1565/x86_64/rac cluster localhost:1745 list"
$ sudo nano /etc/systemd/system/srv1cv83-15.1565-ras.service
Пример исправления сервиса selhoz-8.3.15.1830.service
Посмотреть:
sudo systemctl status selhoz-8.3.15.1830.service
sudo systemctl stop selhoz-8.3.15.1830.service
sudo systemctl disable selhoz-8.3.15.1830.service
sudo nano /etc/systemd/system/selhoz-8.3.15.1830.service
исправить порты в на всякий случай в двух местах!!!
sudo systemctl daemon-reload
sudo systemctl enable selhoz-8.3.15.1830.service
sudo systemctl start selhoz-8.3.15.1830.service
sudo systemctl status selhoz-8.3.15.1830.service
Комментариев нет:
Отправить комментарий