вторник, 4 сентября 2018 г.

Ubuntu server 16.04.5 1С:Предприятие 8.3.12.1595 PostgreSQL, версия 9.6.7-1.1C

Ubuntu server 16.04.5 1С:Предприятие 8.3.12.1595 PostgreSQL, версия 9.6.7-1.1C

Установка 1С 8.3.13.1472 СУБД PostgreSQL, версия 10.3-2.1C ubuntu 16.04.5
данной статье опишем установку сервера и клиента 1С 8.3.13.1472 с СУБД PostgreSQL, версия 10.3-2.1C  на ubuntu 16.04.5 на virtualbox.
Нам потребуется (все 64 бит):
1. ubuntu 16.04.5
2. 1С берем на сайте 8.3.12.1595 при наличии договора ИТС
3. PostgreSQL, версия 9.6.7-1.1C   при наличии договора ИТС 
4.  Фонты берем etersoft по кнопке получить (после бесплатной регистрации wine.local для ubuntu 16.04 64 бит)
5. Драйверы hasp берем у производителя
Качаем последний драйвер 7.81  (через wget не скачть!)

1. Устанавливаем ubuntu 16.04.5 desktop без swap файла, т.е. размечаем вручную весь диск ext4 root.
Настройки виртуальной машины - RAM (32GB)
Сеть - сетевой мост.

Проще всего пробросить в виртуальную машину лицензии 1С:Предприятия 8 посредством локального hasp.


Настройки ubuntu пользователь (привязка в скриптах) user пароль 12345, имя компьютера любое, позже мы его сменим скриптом, как и ip адрес.

После установки, Ctrl +Alt + T (окно терминала)
$ sudo apt update -y
$ sudo apt upgrade -y
$ sudo apt install mc ssh samba htop -y

Возможно sudo apt upgrade -y не пройдет из за блокировки, тогда sudo reboot и повторите с начала.

$ lsusb
Bus 001 Device 002: ID 80ee:0021 VirtualBox USB Tablet
Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

Пробросить hasp средствами VirtualBox

$ lsusb
Bus 001 Device 004: ID 0529:0001 Aladdin Knowledge Systems HASP copy protection dongle
Bus 001 Device 003: ID 0529:0001 Aladdin Knowledge Systems HASP copy protection dongle
Bus 001 Device 002: ID 80ee:0021 VirtualBox USB Tablet
Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

2. Настройка сети скриптом.
Узнаем ip и имя адаптера
$ ip a
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 08:00:27:53:b6:81 brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.169/24 brd 192.168.0.255 scope global enp0s3

Откроем firefox (в ubuntu), откроем эту страничку  и скопируем в буфер скрипт настройки сети:

$ nano network.sh

Скопируем из буфера следующий скрипт, в котором Вам нужно исправить ip, адрес шлюза и имя адаптера в соответствии со своей сетью:

#!/bin/bash
# настройка ip и hostname
#----------------------------------------------------------------------
_hostname="ufo"
# real computer
#_iface="enp0s31f6"
# kvm iface
#_iface="ens3"
# virtualbox iface
_iface="enp0s3"
#_iface="enp1s0"
_address="192.168.0.101"
_gateway="192.168.0.1"
_netmask="255.255.255.0"
_nameserver="8.8.8.8"
#----------------------------------------------------------------------
#add a swap file to an Ubuntu 16.04
sudo fallocate -l 1G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
sudo cp /etc/fstab /etc/fstab.bak
sudo echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
# отключим сетевой менеджер
#sudo systemctl stop NetworkManager.service
#sudo systemctl disable NetworkManager.service
# настроим статический ip
sudo cat > /tmp/interfaces <<EOF
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
#auto $_iface
#iface $_iface inet dhcp
iface $_iface inet static
address $_address
netmask $_netmask
gateway $_gateway
dns-nameservers $_nameserver
auto $_iface
EOF
sudo cp /tmp/interfaces /etc/network
#sudo rm /etc/resolv.conf
#sudo /bin/su -c "echo 'nameserver $_nameserver' > /etc/resolv.conf"
# изменим hostname и ip
sudo cat > /tmp/hosts <<EOF
127.0.0.1       localhost
#$_address       $_hostname
127.0.0.1       $_hostname
EOF
sudo cp /tmp/hosts /etc
# изменим hostname
sudo hostname $_hostname
sudo /bin/su -c "echo $_hostname > /etc/hostname"
# отключим ip6
sudo /bin/su -c "echo 'net.ipv6.conf.all.disable_ipv6 = 1' >> /etc/sysctl.conf"
sudo /bin/su -c "echo 'net.ipv6.conf.default.disable_ipv6 = 1' >> /etc/sysctl.conf"
sudo /bin/su -c "echo 'net.ipv6.conf.lo.disable_ipv6 = 1' >> /etc/sysctl.conf"
#sudo /bin/su -c "echo 'net.ipv4.ip_forward = 1' >> /etc/sysctl.conf"
sudo /bin/su -c "echo 'vm.swappiness=0' >> /etc/sysctl.conf"
#sudo /bin/su -c "echo 'vm.vfs_cache_pressure = 50' >> /etc/sysctl.conf"
sudo sysctl -p
# перезагрузим сеть
sudo systemctl restart networking.service
#sudo systemctl start networking.service
#sudo systemctl enable networking.service
# Настройка sudo journalctl -b sudo journalctl -b -1 sudo journalctl --list-boots
sudo sed -i 's/#Storage=auto/Storage=persistent/' /etc/systemd/journald.conf
# Отключение уведомлений службы Apport (/var/crash)
sudo sed -i 's/enabled=1/enabled=0/' /etc/default/apport
# Настройка ftp пользователь: test пароль: test
sudo apt install pure-ftpd -y
sudo groupadd ftpgroup
sudo usermod -aG ftpgroup user
sudo ln -s /etc/pure-ftpd/conf/PureDB /etc/pure-ftpd/auth/50pure
sudo mkdir /home/user/test
sudo chown -R user:ftpgroup /home/user/test
#sudo pure-pw useradd test -u user -d /home/user/test
# Заведем пользователя ftp test с паролем test
sudo echo -e "test\ntest\n" | sudo pure-pw useradd test -u user -d /home/user/test
sudo pure-pw mkdb
sudo service pure-ftpd restart
# ubuntu
# Отключим службу ondemand
# (для разгона cpu)
# cat /proc/cpuinfo | grep MHz
# systemctl status ondemand
sudo systemctl stop ondemand
sudo systemctl disable ondemand
# shutdown -r now

Сохраним файл network.sh

------------------------------------------
Сделаем исполняем
$ chmod +x network.sh

Выполним:

$ ./network.sh
------------------------------------------
или так:
$  sudo sh network.sh
------------------------------------------

Перезагрузимся

$ sudo reboot

3. Установка PostgreSQL, версия 9.6.7-1.1C и 1c скриптом:

После перезагрузки по сети можно подключиться любым ftp клиентом к ftp серверу на нашей виртуальной машине (по ip или или имени ) пользователь test пароль test и загрузить файлы установки:

Файлы необходимые для установки (предварительно нужно скачать по указанным в начале статьи ссылкам):
postgresql_9.6.7_1.1C_amd64_deb.tar.bz2
postgresql_9.6.7_1.1C_amd64_addon_deb.tar.bz2
1c-enterprise83-common_8.3.12-1595_amd64.deb
1c-enterprise83-server_8.3.12-1595_amd64.deb
fonts-ttf-ms_1.0-eter4ubuntu_all.deb
aksusbd_7.81-1_amd64.deb

Исправим bug
Several regex warnings when installing latest postgres update

sudo nano /usr/sbin/pam_getenv
строка 78 заменить
$val =~ s/(?<!\\)\${([^}]+)}/$ENV{$1}||""/eg;
на
$val =~ s/(?<!\\)\$\{([^}]+)\}/$ENV{$1}||""/eg;


Откроем firefox (в ubuntu), откроем эту страничку  и скопируем в буфер скрипт установки СУБД PostgreSQL версия 9.6.5-4.1С и 1c:

$ nano install_post967.sh

Скопируем из буфера следующий скрипт:

#!/bin/sh
sudo apt install libicu55  libtcl8.6 -y
sudo apt-get install postgresql-common -y #sudo cp /usr/share/hunspell/ru_RU.aff  /usr/share/hunspell/ru_RU.aff.copy
#sudo sed -e '1s/^\xef\xbb\xbf//' /usr/share/hunspell/ru_RU.aff
mkdir -p /tmp/post
cp /home/user/test/postgresql_9.6.7_1.1C_amd64_deb.tar.bz2 /tmp/post/
cp /home/user/test/postgresql_9.6.7_1.1C_amd64_addon_deb.tar.bz2 /tmp/post/
cd /tmp/post
tar -xvf postgresql_9.6.7_1.1C_amd64_deb.tar.bz2
cd  postgresql-9.6.7-1.1C_amd64_deb
sudo dpkg -i *.deb
cd /tmp/post/
tar -xvf postgresql_9.6.7_1.1C_amd64_addon_deb.tar.bz2
cd postgresql-9.6.7-1.1C_amd64_addon_deb
sudo dpkg -i *.deb
sudo apt install -f
sudo -u postgres psql -U postgres -c "alter user postgres with password 'pass';"
sudo cp /etc/postgresql/9.6/main/postgresql.conf /etc/postgresql/9.6/main/postgresql.conf.bak
#Делаем проверки
#sudo systemctl status postgresql.service
#ss -tunpl | grep 5432

# установка 1с
mkdir -p /tmp/1ctmp
cd /tmp/1ctmp
sudo apt install imagemagick -y
sudo apt install -y unixodbc libgsf-1-114 libglib2.0
#ubuntu
#sudo apt install ttf-mscorefonts-installer -y
#debian
#wget  http://ftp.ru.debian.org/debian/pool/contrib/m/msttcorefonts/ttf-mscorefonts-installer_3.6_all.deb
#sudo  apt install -y xfonts-utils cabextract
#sudo dpkg -i ttf-mscorefonts-installer_3.6_all.deb
# фонты от Etersoft
#ubuntu
cp /home/user/test/fonts-ttf-ms_1.0-eter4ubuntu_all.deb /tmp/1ctmp
sudo  apt install -y cabextract
sudo dpkg -i fonts-ttf-ms_1.0-eter4ubuntu_all.deb
#sudo apt -f -y install
#debian
#cp /home/user/Загрузки/fonts-ttf-ms_1.0-eter4debian_all.deb /tmp/1ctmp
#sudo dpkg -i fonts-ttf-ms_1.0-eter4debian_all.deb
cp /home/user/test/1c-enterprise83-common_8.3.12-1595_amd64.deb /tmp/1ctmp/
cp /home/user/test/1c-enterprise83-server_8.3.12-1595_amd64.deb /tmp/1ctmp/
#tar xvzf deb64.tar.gz
#tar xvzf client.deb64.tar.gz
#sudo dpkg -i 1c*.deb
sudo dpkg -i 1c-enterprise83-common_8.3.12-1595_amd64.deb
sudo dpkg -i 1c-enterprise83-server_8.3.12-1595_amd64.deb
#sudo apt -f -y install
sudo chown -R usr1cv8:grp1cv8 /opt/1C
sudo echo -e "pass\npass\n" | sudo passwd usr1cv8
#sudo service srv1cv83 start
sudo systemctl start srv1cv83.service
sudo systemctl status srv1cv83.service
#sudo service srv1cv83 status
#ss -tlnp | grep :15
mkdir /tmp/hasp
cd /tmp/hasp
cp /home/user/test/aksusbd_7.81-1_amd64.deb  /tmp/hasp
sudo dpkg -i aksusbd_7.81-1_amd64.deb

#sudo dpkg -i *.deb
#sudo apt-get install -f -y

#sudo systemctl status aksusbd.service
#sudo systemctl status hasplmd.service

Сохраним файл
Сделаем исполняем
$ chmod +x  install_post103_2.sh

Выполним:

$ ./install_post967.sh

или
$ sudo sh install_post967.sh

Не встал скриптом imagemagick?
Без строчки ниже будет ругаться при входе в 1с
$ sudo apt-get install imagemagick  -y

$ sudo reboot

$ sudo systemctl status postgresql.service
● postgresql.service - PostgreSQL RDBMS
   Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; vendor preset: enabled)
   Active: active (exited) since Ср 2018-03-14 16:45:43 MSK; 7min ago
  Process: 1430 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
 Main PID: 1430 (code=exited, status=0/SUCCESS)
    Tasks: 0
   Memory: 0B
      CPU: 0
   CGroup: /system.slice/postgresql.service

мар 14 16:45:43 kamin systemd[1]: Starting PostgreSQL RDBMS...
мар 14 16:45:43 kamin systemd[1]: Started PostgreSQL RDBMS.
user@kamin:~$

$ ss -tunpl | grep 5432
tcp    LISTEN     0      128       *:5432                  *:*                   users:(("postgres",pid=1269,fd=6))
  
#$ sudo systemctl start postgresql.service
#$ sudo systemctl restart postgresql.service
#$ sudo systemctl stop postgresql.service

$ sudo systemctl status srv1cv83.service
● srv1cv83.service - LSB: Starts and stops the 1C:Enterprise daemons
   Loaded: loaded (/etc/init.d/srv1cv83; bad; vendor preset: enabled)
   Active: active (exited) since Ср 2018-03-14 16:45:46 MSK; 11min ago
     Docs: man:systemd-sysv-generator(8)
  Process: 1215 ExecStart=/etc/init.d/srv1cv83 start (code=exited, status=0/SUCCESS)
    Tasks: 0
   Memory: 0B
      CPU: 0

мар 14 16:45:41 kamin systemd[1]: Starting LSB: Starts and stops the 1C:Enterprise daemons...
мар 14 16:45:41 kamin su[1267]: Successful su for usr1cv8 by root
мар 14 16:45:41 kamin su[1267]: + ??? root:usr1cv8
мар 14 16:45:41 kamin su[1267]: pam_unix(su:session): session opened for user usr1cv8 by (uid=0)
мар 14 16:45:46 kamin srv1cv83[1215]: Starting 1C:Enterprise 8.3 server: OK
мар 14 16:45:46 kamin systemd[1]: Started LSB: Starts and stops the 1C:Enterprise daemons.




$ ss -tlnp | grep :15
LISTEN     0      128          *:1560                     *:*                   users:(("rphost",pid=1402,fd=23))
LISTEN     0      128          *:1540                     *:*                   users:(("rphost",pid=1402,fd=15),("ragent",pid=1305,fd=15))
LISTEN     0      128          *:1541                     *:*                   users:(("rmngr",pid=1325,fd=12))
LISTEN     0      128         :::1560                    :::*                   users:(("rphost",pid=1402,fd=22))
LISTEN     0      128         :::1540                    :::*                   users:(("rphost",pid=1402,fd=14),("ragent",pid=1305,fd=14))
LISTEN     0      128         :::1541                    :::*                   users:(("rmngr",pid=1325,fd=11))

#sudo service aksusbd status
$ sudo systemctl status aksusbd.service
● aksusbd.service - Sentinel LDK Runtime Environment (aksusbd daemon)
   Loaded: loaded (/etc/systemd/system/aksusbd.service; enabled; vendor preset: enabled)
   Active: active (running) since Пт 2018-08-31 19:02:54 MSK; 5min ago
  Process: 856 ExecStart=/usr/sbin/aksusbd_x86_64 (code=exited, status=0/SUCCESS)
 Main PID: 858 (aksusbd_x86_64)
    Tasks: 3
   Memory: 544.0K
      CPU: 2ms
   CGroup: /system.slice/aksusbd.service
           └─858 /usr/sbin/aksusbd_x86_64

авг 31 19:02:54 ufo systemd[1]: Starting Sentinel LDK Runtime Environment (aksusbd daemon)...
авг 31 19:02:54 ufo aksusbd[858]: loaded, daemon version: 7.81.1.80357, key API (USB) version: 3.88 (parallel driver not avail
авг 31 19:02:54 ufo systemd[1]: Started Sentinel LDK Runtime Environment (aksusbd daemon).

sudo netstat -anp | grep hasp
tcp        0      0 0.0.0.0:1947            0.0.0.0:*               LISTEN      1437/hasplmd_x86_64
udp    35328      0 0.0.0.0:1947            0.0.0.0:*                           1437/hasplmd_x86_64
udp        0      0 0.0.0.0:44815           0.0.0.0:*                           1437/hasplmd_x86_64
unix  2      [ ]         DGRAM                    21064    1437/hasplmd_x86_64

$ ss -tlnp | grep :1947
LISTEN     0      128          *:1947                     *:*



$ sudo netstat -anp | grep aksusbd
unix  2      [ ACC ]     STREAM     LISTENING     16184    1152/aksusbd_x86_64 /tmp/.aksusb
unix  2      [ ]         DGRAM                    16182    1152/aksusbd_x86_64

      
$ sudo poweroff

Здесь полезно сделать "консервы".
До подключения базы 1с легко менять ip адрес и название сервера.
Сделаем выгрузку post97.ova

Перезагрузимся, если не делали выгрузку или просто загрузим виртуалку.


Можно подключать базу 1С postgres пароль pass
(вместо astra имя своего сервера)



Подготовка:
#$ sudo mkdir /backup
$ sudo chmod -R 777 /backup
$ sudo apt-get -y install pigz


Бэкап с архивированием:
$ sudo su - postgres
$ pg_dump demo | pigz > /backup/demo.sql.gz

или от root


# Бэкапим базу данных demo и сразу сжимаем
$ cd /backup/
$ sudo /bin/su postgres -c "/usr/bin/pg_dump demo | pigz > /backup/demo.sql.gz"

Разархивирование с сохранением архива
$ sudo su - postgres
$ unpigz -c /home/user/test/backup/demo.sql.gz > /home/user/test/backup/demo.sql


Создадим базу demotest (если еще не создана)
$ sudo su - postgres
$ createdb --username postgres -T template0 demotest

Восстановим в базу demotest:
$ psql -l
$ unpigz -c /home/user/test/backup/demo.sql.gz > /home/user/test/backup/demo.sql
$ psql demotest < /home/user/test/backup/demo.sql

Подключимся к базе средствами 1С:




Базу demotest можно оставить для регулярного тестирования бэкапов.

Убьем базу demotest:
sudo su - postgres
$ dropdb demotest
$ psql -l

Для 32 Gb RAM иначе не запустится!!!

sudo cp  /etc/postgresql/9.6/main/postgresql.conf /etc/postgresql/9.6/main/postgresql.conf.bak1 
sudo nano  /etc/postgresql/9.6/main/postgresql.conf

Заменить:

#------------------------------------------------------------------------------
data_directory = '/var/lib/postgresql/9.6/main'        # use data in another directory
hba_file = '/etc/postgresql/9.6/main/pg_hba.conf'    # host-based authentication file
ident_file = '/etc/postgresql/9.6/main/pg_ident.conf'    # ident configuration file
external_pid_file = '/var/run/postgresql/9.6-main.pid'            # write an extra PID file
listen_addresses = '*'        # what IP address(es) to listen on;
port = 5432                # (change requires restart)
max_connections = 1000            # (change requires restart)
unix_socket_directories = '/var/run/postgresql'    # comma-separated list of directories
ssl = false                # (change requires restart)
ssl_cert_file = '/etc/ssl/certs/ssl-cert-snakeoil.pem'        # (change requires restart)
ssl_key_file = '/etc/ssl/private/ssl-cert-snakeoil.key'        # (change requires restart)
#------------------------------------------------------------------------------
# RESOURCE USAGE (except WAL)
#------------------------------------------------------------------------------
#shared_buffers = 128MB            # min 128kB
shared_buffers = 12288MB
#temp_buffers = 8MB                     # min 800kB
temp_buffers = 32MB
#work_mem = 4MB                         # min 64kB
work_mem = 32MB
#maintenance_work_mem = 64MB            # min 1MB
maintenance_work_mem = 512MB
dynamic_shared_memory_type = posix    # the default is the first option
#max_files_per_process = 1000           # min 25
max_files_per_process = 24576
#shared_preload_libraries = 'online_analyze, plantuner'    # (change requires restart)
shared_preload_libraries = 'online_analyze, plantuner, auto_explain'
# - Background Writer -

#bgwriter_delay = 200ms                 # 10-10000ms between rounds
bgwriter_delay = 10ms
#bgwriter_delay = 20ms
#bgwriter_lru_maxpages = 100            # 0-1000 max buffers written/round
bgwriter_lru_maxpages = 800
#bgwriter_lru_multiplier = 2.0          # 0-10.0 multiplier on buffers scanned/round
bgwriter_lru_multiplier = 8.0

# - Asynchronous Behavior -

#effective_io_concurrency = 1           # 1-1000; 0 disables prefetching
effective_io_concurrency =  2
#------------------------------------------------------------------------------
# WRITE AHEAD LOG
#------------------------------------------------------------------------------
#wal_level = minimal                    # minimal, replica, or logical
wal_level = hot_standby
fsync = on                             # flush data to disk for crash safety
#synchronous_commit = on                # synchronization level;
synchronous_commit = off
#commit_delay = 0                       # range 0-100000, in microseconds
commit_delay = 1000
#checkpoint_completion_target = 0.5     # checkpoint target duration, 0.0 - 1.0
checkpoint_completion_target = 0.9

#------------------------------------------------------------------------------
# REPLICATION
#------------------------------------------------------------------------------
#max_wal_senders = 0            # max number of walsender processes
max_wal_senders = 4
#wal_keep_segments = 0          # in logfile segments, 16MB each; 0 disables
wal_keep_segments = 1024
#------------------------------------------------------------------------------
# QUERY TUNING
#------------------------------------------------------------------------------
# - Planner Cost Constants -
#random_page_cost = 4.0                 # same scale as above
random_page_cost =  2.0
#random_page_cost = 1.5
#cpu_operator_cost = 0.0025             # same scale as above
cpu_operator_cost = 0.0005
#effective_cache_size = 4GB
effective_cache_size = 12288MB

from_collapse_limit = 20
join_collapse_limit = 20        # 1 disables collapsing of explicit
                    # JOIN clauses
#------------------------------------------------------------------------------
# ERROR REPORTING AND LOGGING
#------------------------------------------------------------------------------

log_destination = 'stderr'        # Valid values are combinations of
logging_collector = on        # Enable capturing of stderr and csvlog
log_directory = 'pg_log'        # directory where log files are written,
#log_filename = 'postgresql-%a.log'    # log file name pattern,
log_filename = 'postgresql-%Y-%m-%d.log'
log_truncate_on_rotation = on        # If on, an existing log file with the
log_rotation_age = 1d            # Automatic rotation of logfiles will
log_rotation_size = 0        # Automatic rotation of logfiles will
#log_min_duration_statement = -1        # -1 is disabled, 0 logs all statements
log_min_duration_statement = 0

# - What to Log -
#log_checkpoints = off
log_checkpoints = on
#log_connections = off
log_connections = on
#log_disconnections = off
log_disconnections = on
#log_line_prefix = '%t [%p-%l] %q%u@%d '                        # special values:
log_line_prefix = '%t [%p]: [%l-1] user=%u,db=%d,app=%a,client=%h '
#log_lock_waits = off                   # log lock waits >= deadlock_timeout
log_lock_waits = on
log_statement = 'none'                  # none, ddl, mod, all
#log_temp_files = -1                    # log temporary files equal or larger
log_temp_files = 0
log_timezone = 'W-SU'
#------------------------------------------------------------------------------
# RUNTIME STATISTICS
#------------------------------------------------------------------------------
stats_temp_directory = '/var/run/postgresql/9.6-main.pg_stat_tmp'

#------------------------------------------------------------------------------
# AUTOVACUUM PARAMETERS
#------------------------------------------------------------------------------

autovacuum = on            # Enable autovacuum subprocess?  'on'
#log_autovacuum_min_duration = -1       # -1 disables, 0 logs all actions and
log_autovacuum_min_duration = 0
#autovacuum_max_workers = 3             # max number of autovacuum subprocesses
autovacuum_max_workers =  4
#autovacuum_naptime = 1min              # time between autovacuum runs
autovacuum_naptime = 20s
#autovacuum_vacuum_scale_factor = 0.2   # fraction of table size before vacuum
autovacuum_vacuum_scale_factor = 0.02
#autovacuum_analyze_scale_factor = 0.1  # fraction of table size before analyze
autovacuum_analyze_scale_factor = 0.01
#------------------------------------------------------------------------------
# CLIENT CONNECTION DEFAULTS
#------------------------------------------------------------------------------

datestyle = 'iso, dmy'
timezone = 'W-SU'
lc_messages = 'ru_RU.UTF-8'            # locale for system error message
lc_monetary = 'ru_RU.UTF-8'            # locale for monetary formatting
lc_numeric = 'ru_RU.UTF-8'            # locale for number formatting
lc_time = 'ru_RU.UTF-8'                # locale for time formatting
default_text_search_config = 'pg_catalog.russian'
#------------------------------------------------------------------------------
# LOCK MANAGEMENT
#------------------------------------------------------------------------------
#max_locks_per_transaction = 150        # min 10
max_locks_per_transaction =  256
#------------------------------------------------------------------------------
# VERSION/PLATFORM COMPATIBILITY
#------------------------------------------------------------------------------
# - Previous PostgreSQL Versions -
#escape_string_warning = on
escape_string_warning = off
#standard_conforming_strings = on
standard_conforming_strings = off
#------------------------------------------------------------------------------
# ERROR HANDLING
#------------------------------------------------------------------------------

#------------------------------------------------------------------------------
# CONFIG FILE INCLUDES
#------------------------------------------------------------------------------

#------------------------------------------------------------------------------
# CUSTOMIZED OPTIONS
#------------------------------------------------------------------------------

#online_analyze.threshold = 50
online_analyze.threshold = 500
#online_analyze.scale_factor = 0.1
online_analyze.scale_factor = 0.3
online_analyze.enable = off
online_analyze.verbose = off
online_analyze.local_tracking = on
online_analyze.min_interval = 10000
online_analyze.table_type = 'temporary'
plantuner.fix_empty_table = on
#------------------------------------------------------------------------------

Сохранить.

$ sudo systemctl restart postgresql.service
$ sudo systemctl restart srv1cv83.service 
.
$ nano changeip.sh

Скопируем из буфера следующий скрипт, в котором Вам нужно исправить ip и адрес шлюза в соответствии со своей сетью:

#!/bin/bash
# настройка ip и hostname
#----------------------------------------------------------------------
_hostname="kamin"
# real computer
#_iface="enp0s31f6"
# kvm iface
#_iface="ens3"
# virtualbox iface
#_iface="enp0s3"
_iface="enp1s0"
_address="192.168.1.90"
_gateway="192.168.1.1"
_netmask="255.255.255.0"
_nameserver="8.8.8.8"
#----------------------------------------------------------------------
# настроим статический ip
sudo cat > /tmp/interfaces <<EOF
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
#auto $_iface
#iface $_iface inet dhcp
iface $_iface inet static
address $_address
netmask $_netmask
gateway $_gateway
dns-nameservers $_nameserver
auto $_iface
EOF
sudo cp /tmp/interfaces /etc/network
#sudo rm /etc/resolv.conf
#sudo /bin/su -c "echo 'nameserver $_nameserver' > /etc/resolv.conf"
# изменим hostname и ip
sudo cat > /tmp/hosts <<EOF
127.0.0.1       localhost
127.0.0.1       $_hostname
EOF
sudo cp /tmp/hosts /etc
# изменим hostname
sudo hostname $_hostname
sudo /bin/su -c "echo $_hostname > /etc/hostname"
# перезагрузим сеть
sudo systemctl restart networking.service

Сохраним файл changeip.sh

Сделаем исполняем
$ chmod +x changeip.sh

Выполним:

$ ./changeip.sh

или

$ sudo sh changeip.sh

Ubuntu 16.04 Включение автоматической генерации дампов 1c 
Настройка технологического журнала 
Можно так:
 
$ sudo su - usr1cv8
$ mkdir /home/usr1cv8/.1cv8/1C/1cv8/conf/ 
$ nano /home/usr1cv8/.1cv8/1C/1cv8/conf/logcfg.xml 
  
$ mkdir /home/usr1cv8/log
$ chown -R usr1cv8:grp1cv8 /home/usr1cv8/log 
$ nano /home/usr1cv8/.1cv8/1C/1cv8/conf/logcfg.xml 
 
<?xml version="1.0" encoding="UTF-8"?>
<config xmlns="http://v8.1c.ru/v8/tech-log">
        <log location="/home/usr1cv8/log" history="96">
                <event>
                        <eq property="name" value="DBPOSTGRS"/>
                </event>
                <event>
                        <eq property="name" value="SDBL"/>
                </event>
                <event>
                        <eq property="name" value="EXCP"/>
                </event>
                <property name="all"/>
        </log>
</config>
 
Сохранить 
 
# chown -R usr1cv8:grp1cv8 /home/usr1cv8/.1cv8/1C/1cv8/conf/
 
# service srv1cv83 restart
 
$ sudo systemctl restart srv1cv83.service

Комментариев нет:

Отправить комментарий