Продукт: PostgreSQL 1C 10.6
Платформа: x86_64
Пакет: postgrespro-1c-10-server_10.6-1.xenial_amd64.deb
Установка
$ sudo apt-get update -y
$ sudo apt-get install -y wget gnupg2 || sudo apt-get install -y gnupg
$ wget -O - http://repo.postgrespro.ru/keys/GPG-KEY-POSTGRESPRO | sudo apt-key add -
$ sudo su -c "echo deb http://repo.postgrespro.ru/1c-archive/pg1c-10.6/ubuntu xenial main > /etc/apt/sources.list.d/postgrespro-1c.list"
$ sudo apt-get update -y
$ sudo apt-get install -y postgrespro-1c-10-server postgrespro-1c-10-contrib
$ sudo /opt/pgpro/1c-10/bin/pg-wrapper links update
$ sudo /opt/pgpro/1c-10/bin/pg-setup initdb
--data-checksums$ sudo /opt/pgpro/1c-10/bin/pg-setup service enable
$ sudo service postgrespro-1c-10 start
$ ss -tunpl | grep 5432
tcp LISTEN 0 128 127.0.0.1:5432 *:*
$ sudo -u postgres psql -U postgres -c "alter user postgres with password 'pass';"
ALTER ROLE
-------------------------------------------------------------
Установка pg_probackup
$ sudo su -c "echo 'deb [arch=amd64] http://repo.postgrespro.ru/pg_probackup/deb/
$(lsb_release -cs) main-$(lsb_release -cs)' >
/etc/apt/sources.list.d/pg_probackup.list"
$ sudo su -c "wget -O - http://repo.postgrespro.ru/pg_probackup/keys/GPG-KEY-PG_PROBACKUP | apt-key add -"
$ sudo apt-get update
$ sudo apt-get install pg-probackup-10
Инициализация каталога резервных копий
$ sudo mkdir /backup
$ sudo pg_probackup-10 init -B /backup
INFO: Backup catalog '/backup' successfully inited
$ sudo chown -R postgres:postgres /backup
$ dpkg -L pg-probackup-10
...
/usr/bin/pg_probackup-10
...
Определение копируемого экземпляра
$ sudo /bin/su postgres -c "pg_probackup-10 add-instance -B /backup -D
/var/lib/pgpro/1c-10/data
--instance data"
$ sudo mkdir /var/run/postgresql/
$ sudo chown -R postgres:postgres /var/run/postgresql/
$ sudo
netstat -lnp --protocol=unix | grep postgres
unix 2 [ ACC ] STREAM LISTENING 19011 1267/postgres /tmp/.s.PGSQL.5432
$ sudo nano /var/lib/pgpro/1c-10/data/postgresql.conf
Добавить:
max_wal_senders = 10
wal_level = replica
unix_socket_directories='/var/run/postgresql'
# Для настройки архивного резервного копирования разкомментировать:
# archive_mode = on
# archive_command = 'pg_probackup-10 archive-push -B /backup --instance main --wal-file-path %p --wal-file-name %f'
Сохранить.
$ sudo service postgrespro-1c-10 stop
$ sudo service postgrespro-1c-10 start
$ sudo netstat -lnp --protocol=unix | grep postgres
unix 2 [ ACC ] STREAM LISTENING 76271 13451/postgres /var/run/postgresql/.s.PGSQL.5432
Создание полной автономной резервной копии:
$ sudo /bin/su postgres -c "pg_probackup-10 backup -h u1604 -B /backup --instance data -b FULL --stream
--compress
"
[sudo] пароль для user:
INFO: Backup start, pg_probackup version: 2.0.26, backup ID: PNSKJ2, backup mode: full, instance: data, stream: true, remote: false
INFO: Start transfering data files
INFO: Data files are transfered
INFO: wait for pg_stop_backup()
INFO: pg_stop backup() successfully executed
INFO: Validating backup PNSKJ2
INFO: Backup PNSKJ2 data files are valid
INFO: Backup PNSKJ2 completed
Просмотр:
$ sudo /bin/su postgres -c "pg_probackup-10 show -B /backup"
Проверка backup:
$ sudo /bin/su postgres -c "pg_probackup-10 validate -B /backup"
Комментариев нет:
Отправить комментарий