На Debian PostgreSQL от 1с не устанавливается, установим PostgreSQL 9.6.6 от postgrespro.ru
$ sudo dpkg-reconfigure locales
Данная команда вызывает утилиту при помощи которой следует выбрать локали en_US ISO-8859-1, en_US.UTF-8 и ru_RU.UTF-8
$ sudo dpkg-reconfigure locales
[sudo] пароль для user:
Generating locales (this might take a while)...
en_US.ISO-8859-1... done
en_US.UTF-8... done
ru_RU.UTF-8... done
Generation complete.
$ nano install_post966_deb.sh
Скопируем из буфера следующий скрипт:
#!/bin/sh
sudo sh -c 'echo "deb http://1c.postgrespro.ru/deb/ $(lsb_release -cs) main" > /etc/apt/sources.list.d/postgrespro-1c.list'
wget --no-verbose -O - http://1c.postgrespro.ru/keys/GPG-KEY-POSTGRESPRO-1C | sudo apt-key add - && sudo apt-get update
sudo apt-get install -y postgresql-pro-1c-9.6
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
# установка 1с
mkdir -p /tmp/1ctmp
cd /tmp/1ctmp
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 dpkg -i fonts-ttf-ms_1.0-eter4ubuntu_all.deb
#sudo apt -f -y install
#debian
cp /home/user/test/fonts-ttf-ms_1.0-eter4debian_all.deb /tmp/1ctmp
sudo dpkg -i fonts-ttf-ms_1.0-eter4debian_all.deb
sudo apt -f -y install
cp /home/user/test/server.deb64.tar.gz /tmp/1ctmp
cp /home/user/test/client.deb64.tar.gz /tmp/1ctmp
tar xvzf server.deb64.tar.gz
tar xvzf client.deb64.tar.gz
sudo dpkg -i 1c*.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 service srv1cv83 status
sudo apt install -y libc6-i386
mkdir /tmp/hasp
cd /tmp/hasp
cp /home/user/test/haspd_7.60-eter1debian_amd64.deb /tmp/hasp
cp /home/user/test/haspd-modules_7.60-eter1debian_amd64.deb /tmp/hasp
#cp /home/user/test/haspd_7.40-eter10ubuntu_amd64.deb /tmp/hasp
#cp /home/user/test/haspd-modules_7.40-eter10ubuntu_amd64.deb /tmp/hasp
#wget http://download.etersoft.ru/pub/Etersoft/HASP/last/x86_64/Debian/8/haspd_7.60-eter1debian_amd64.deb
#wget http://download.etersoft.ru/pub/Etersoft/HASP/last/x86_64/Ubuntu/16.04/haspd_7.40-eter10ubuntu_amd64.deb
#wget http://download.etersoft.ru/pub/Etersoft/HASP/last/x86_64/Debian/8/haspd-modules_7.60-eter1debian_amd64.deb
#wget http://download.etersoft.ru/pub/Etersoft/HASP/last/x86_64/Ubuntu/16.04/haspd-modules_7.40-eter10ubuntu_amd64.deb
sudo dpkg -i *.deb
sudo apt-get install -f -y
sudo service haspd start
#sudo service haspd status
#sudo shutdown -r now
Сохраним файл install_post966_deb.sh
Сделаем исполняем
$ chmod +x install_post966_deb.sh
Выполним:
$ ./install_post966_deb.sh
Хотя скрипт все правильно делает, рассмотрим, как проверить запуск серверов PostgreSQL и 1С.
$ sudo systemctl status postgresql.service
$ sudo ss -tunpl | grep 5432
$ sudo systemctl status srv1cv83.service
или так:
$ sudo service srv1cv83 status
$ sudo ss -tlnp | grep :15
Копировать postgresql.conf
$ sudo cp /etc/postgresql/9.6/main/postgresql.conf /etc/postgresql/9.6/main/postgresql.conf.bak
Восстановить postgresql.conf
$ sudo cp /etc/postgresql/9.6/main/postgresql.conf.bak /etc/postgresql/9.6/main/postgresql.conf
Редактировать postgresql.conf
$ sudo cp /etc/postgresql/9.6/main/postgresql.conf /etc/postgresql/9.6/main/postgresql.conf.bak-1
$ 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 = 100 # (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)
dynamic_shared_memory_type = posix # the default is the first option
log_timezone = 'W-SU'cluster_name = '9.6/main' # added to process titles if nonempty
stats_temp_directory = '/var/run/postgresql/9.6-main.pg_stat_tmp'
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'
#----------------------------------------------------------------------effective_cache_size = '12288MB'
work_mem = '32MB'
shared_buffers = '12288MB'
maintenance_work_mem = '512MB'
temp_buffers = '32MB'
#temp_tablespaces = 'user_temp'
max_files_per_process = '24576'
autovacuum_max_workers = '4'
autovacuum_analyze_scale_factor = '0.01'
autovacuum_vacuum_scale_factor = '0.02'
random_page_cost = '1.5'
log_statement = 'none'
#----------------------------------------------------------------------
log_filename = 'postgresql-%Y-%m-%d.log'
log_rotation_size = '0'
log_timezone = 'W-SU'
log_truncate_on_rotation = 'on'
logging_collector = 'on'
shared_preload_libraries = 'online_analyze, plantuner, auto_explain'
online_analyze.enable = off
online_analyze.verbose = off
online_analyze.table_type = 'temporary'
online_analyze.scale_factor = 0.3
online_analyze.min_interval = 10000
online_analyze.threshold = 500
online_analyze.local_tracking = on
cpu_operator_cost = 0.0005
plantuner.fix_empty_table = on
autovacuum_naptime = '20' # s
#autovacuum_analyze_threshold = 20
bgwriter_delay = '10' # ms
bgwriter_lru_maxpages = '800'
bgwriter_lru_multiplier = '8'
# storage specific
effective_io_concurrency = '2'
random_page_cost = '2'
checkpoint_completion_target = 0.9
#checkpoint_segments = '128'
max_connections = '1000'
synchronous_commit = 'off'
commit_delay = '1000'
# 1C specific
escape_string_warning = 'off'
standard_conforming_strings = 'off'
max_locks_per_transaction = '256'
#work_mem = 65536
# pgbadger
log_directory = 'pg_log'
#log_directory = '/var/log/pgsql'
#log_filename = 'postgresql.log'
log_min_duration_statement = 0s
log_autovacuum_min_duration = 0
log_line_prefix = '%t [%p]: [%l-1] user=%u,db=%d,app=%a,client=%h '
log_checkpoints = on
log_connections = on
log_disconnections = on
log_lock_waits = on
log_temp_files = 0
# backup
max_wal_senders = 4
wal_level = hot_standby
wal_keep_segments = 1024
#----------------------------------------------------------------------
Сохранить.
$ sudo reboot
$ sudo dpkg-reconfigure locales
Данная команда вызывает утилиту при помощи которой следует выбрать локали en_US ISO-8859-1, en_US.UTF-8 и ru_RU.UTF-8
[sudo] пароль для user:
Generating locales (this might take a while)...
en_US.ISO-8859-1... done
en_US.UTF-8... done
ru_RU.UTF-8... done
Generation complete.
$ nano install_post966_deb.sh
Скопируем из буфера следующий скрипт:
#!/bin/sh
sudo sh -c 'echo "deb http://1c.postgrespro.ru/deb/ $(lsb_release -cs) main" > /etc/apt/sources.list.d/postgrespro-1c.list'
wget --no-verbose -O - http://1c.postgrespro.ru/keys/GPG-KEY-POSTGRESPRO-1C | sudo apt-key add - && sudo apt-get update
sudo apt-get install -y postgresql-pro-1c-9.6
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
# установка 1с
mkdir -p /tmp/1ctmp
cd /tmp/1ctmp
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 dpkg -i fonts-ttf-ms_1.0-eter4ubuntu_all.deb
#sudo apt -f -y install
#debian
cp /home/user/test/fonts-ttf-ms_1.0-eter4debian_all.deb /tmp/1ctmp
sudo dpkg -i fonts-ttf-ms_1.0-eter4debian_all.deb
sudo apt -f -y install
cp /home/user/test/server.deb64.tar.gz /tmp/1ctmp
cp /home/user/test/client.deb64.tar.gz /tmp/1ctmp
tar xvzf server.deb64.tar.gz
tar xvzf client.deb64.tar.gz
sudo dpkg -i 1c*.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 service srv1cv83 status
sudo apt install -y libc6-i386
mkdir /tmp/hasp
cd /tmp/hasp
cp /home/user/test/haspd_7.60-eter1debian_amd64.deb /tmp/hasp
cp /home/user/test/haspd-modules_7.60-eter1debian_amd64.deb /tmp/hasp
#cp /home/user/test/haspd_7.40-eter10ubuntu_amd64.deb /tmp/hasp
#cp /home/user/test/haspd-modules_7.40-eter10ubuntu_amd64.deb /tmp/hasp
#wget http://download.etersoft.ru/pub/Etersoft/HASP/last/x86_64/Debian/8/haspd_7.60-eter1debian_amd64.deb
#wget http://download.etersoft.ru/pub/Etersoft/HASP/last/x86_64/Ubuntu/16.04/haspd_7.40-eter10ubuntu_amd64.deb
#wget http://download.etersoft.ru/pub/Etersoft/HASP/last/x86_64/Debian/8/haspd-modules_7.60-eter1debian_amd64.deb
#wget http://download.etersoft.ru/pub/Etersoft/HASP/last/x86_64/Ubuntu/16.04/haspd-modules_7.40-eter10ubuntu_amd64.deb
sudo dpkg -i *.deb
sudo apt-get install -f -y
sudo service haspd start
#sudo service haspd status
#sudo shutdown -r now
Сохраним файл install_post966_deb.sh
Сделаем исполняем
$ chmod +x install_post966_deb.sh
Выполним:
$ ./install_post966_deb.sh
Хотя скрипт все правильно делает, рассмотрим, как проверить запуск серверов PostgreSQL и 1С.
$ sudo systemctl status postgresql.service
$ sudo ss -tunpl | grep 5432
$ sudo systemctl status srv1cv83.service
или так:
$ sudo service srv1cv83 status
$ sudo ss -tlnp | grep :15
Копировать postgresql.conf
$ sudo cp /etc/postgresql/9.6/main/postgresql.conf /etc/postgresql/9.6/main/postgresql.conf.bak
Восстановить postgresql.conf
$ sudo cp /etc/postgresql/9.6/main/postgresql.conf.bak /etc/postgresql/9.6/main/postgresql.conf
Редактировать postgresql.conf
$ sudo cp /etc/postgresql/9.6/main/postgresql.conf /etc/postgresql/9.6/main/postgresql.conf.bak-1
$ 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 = 100 # (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)
dynamic_shared_memory_type = posix # the default is the first option
log_timezone = 'W-SU'cluster_name = '9.6/main' # added to process titles if nonempty
stats_temp_directory = '/var/run/postgresql/9.6-main.pg_stat_tmp'
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'
#----------------------------------------------------------------------effective_cache_size = '12288MB'
work_mem = '32MB'
shared_buffers = '12288MB'
maintenance_work_mem = '512MB'
temp_buffers = '32MB'
#temp_tablespaces = 'user_temp'
max_files_per_process = '24576'
autovacuum_max_workers = '4'
autovacuum_analyze_scale_factor = '0.01'
autovacuum_vacuum_scale_factor = '0.02'
random_page_cost = '1.5'
log_statement = 'none'
#----------------------------------------------------------------------
log_filename = 'postgresql-%Y-%m-%d.log'
log_rotation_size = '0'
log_timezone = 'W-SU'
log_truncate_on_rotation = 'on'
logging_collector = 'on'
shared_preload_libraries = 'online_analyze, plantuner, auto_explain'
online_analyze.enable = off
online_analyze.verbose = off
online_analyze.table_type = 'temporary'
online_analyze.scale_factor = 0.3
online_analyze.min_interval = 10000
online_analyze.threshold = 500
online_analyze.local_tracking = on
cpu_operator_cost = 0.0005
plantuner.fix_empty_table = on
autovacuum_naptime = '20' # s
#autovacuum_analyze_threshold = 20
bgwriter_delay = '10' # ms
bgwriter_lru_maxpages = '800'
bgwriter_lru_multiplier = '8'
# storage specific
effective_io_concurrency = '2'
random_page_cost = '2'
checkpoint_completion_target = 0.9
#checkpoint_segments = '128'
max_connections = '1000'
synchronous_commit = 'off'
commit_delay = '1000'
# 1C specific
escape_string_warning = 'off'
standard_conforming_strings = 'off'
max_locks_per_transaction = '256'
#work_mem = 65536
# pgbadger
log_directory = 'pg_log'
#log_directory = '/var/log/pgsql'
#log_filename = 'postgresql.log'
log_min_duration_statement = 0s
log_autovacuum_min_duration = 0
log_line_prefix = '%t [%p]: [%l-1] user=%u,db=%d,app=%a,client=%h '
log_checkpoints = on
log_connections = on
log_disconnections = on
log_lock_waits = on
log_temp_files = 0
# backup
max_wal_senders = 4
wal_level = hot_standby
wal_keep_segments = 1024
#----------------------------------------------------------------------
Сохранить.
$ sudo reboot
Комментариев нет:
Отправить комментарий