В общем я на пороге репликации, а точнее пока разбираюсь с восстановлением из WAL.
Файлы WAL у меня в нужный каталог посыпались. Ну естественно когда я что то в базу пишу. Что тоже приятно, хоть что то понятно.
Сейчас я хочу создать «контрольную точку» и мучаю pg_basebackup.
root@PostgreSQL:/home/maintainer# pg_basebackup -h localhost -U dbadmin -p 5433 -w -D /Backup/WAL/test_basebackup/
pg_basebackup: не удалось подключиться к серверу: ВАЖНО:  в pg_hba.conf нет записи, разрешающей подключение для репликации с компьютера "::1" для пользователя "dbadmin", SSL вкл.
ВАЖНО:  в pg_hba.conf нет записи, разрешающей подключение для репликации с компьютера "::1" для пользователя "dbadmin", SSL выкл.
Ковыряние pg_hda.conf приводило лишь к невозможности запуска сервера. Привожу то что было до начала экспериментов:
root@PostgreSQL:/home/maintainer# tail -n 30 /etc/postgresql/9.6/1CFresh/pg_hba.conf
# DO NOT DISABLE!
# If you change this first entry you will need to make sure that the
# database superuser can access the database using some other method.
# Noninteractive access to all databases is required during automatic
# maintenance (custom daily cronjobs, replication, and similar tasks).
#
# Database administrative login by Unix domain socket
local   all             postgres                                peer
local   all             dbadmin                                 peer map=root_map
# TYPE  DATABASE        USER            ADDRESS                 METHOD
# "local" is for Unix domain socket connections only
local   all             all                                     peer
# IPv4 local connections:
#host    all             all             127.0.0.1/32            md5
host    all             all             0.0.0.0/0            md5
# IPv6 local connections:
host    all             all             ::1/128                 md5
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local   replication     postgres                                peer
#host    replication     dbadmin          0.0.0.0/0              peer map=root_map
#host    replication     postgres        127.0.0.1/32            md5
#host    replication     postgres        ::1/128                 md5
Точнее я закоментил строку «host replication dbadmin 0.0.0.0/0 peer map=root_map»
root@PostgreSQL:/home/maintainer# tail -n 30 /etc/postgresql/9.6/1CFresh/pg_ident.conf
# (The uppercase quantities must be replaced by actual values.)
#
# MAPNAME is the (otherwise freely chosen) map name that was used in
# pg_hba.conf.  SYSTEM-USERNAME is the detected user name of the
# client.  PG-USERNAME is the requested PostgreSQL user name.  The
# existence of a record specifies that SYSTEM-USERNAME may connect as
# PG-USERNAME.
#
# If SYSTEM-USERNAME starts with a slash (/), it will be treated as a
# regular expression.  Optionally this can contain a capture (a
# parenthesized subexpression).  The substring matching the capture
# will be substituted for \1 (backslash-one) if present in
# PG-USERNAME.
#
# Multiple maps may be specified in this file and used by pg_hba.conf.
#
# No map names are defined in the default configuration.  If all
# system user names and PostgreSQL user names are the same, you don't
# need anything in this file.
#
# This file is read on server startup and when the postmaster receives
# a SIGHUP signal.  If you edit the file on a running system, you have
# to SIGHUP the postmaster for the changes to take effect.  You can
# use "pg_ctl reload" to do that.
# Put your actual configuration here
# ----------------------------------
# MAPNAME       SYSTEM-USERNAME         PG-USERNAME
root_map        root                    dbadmin
В общем помогите понять, обещаю зазубрить, просто не факт что я сейчас разберусь, а потом оно будет пригождаться. Но думаю если пойму, то в следующий раз разберусь скорее.
Спасибо.


