Add a replication node problem

37 views
Skip to first unread message

Alberto Rodriguez

unread,
Feb 11, 2021, 6:54:53 AMFeb 11
to repmgr

Hello everyone, it is a pleasure to write in this group for the first time. We are having problems re-cloning a replication node. 

We are using repmanager version 5.2.0 and we have a tablespace in the same path as the postgres data (/opt/postgres). 

When we launch the standby clone process and we are having the following error:


-bash-4.2$ /usr/pgsql-10/bin/repmgr -h 192.168.1.253 -U repmgr -d repmgr -f /etc/repmgr/10/repmgr.conf standby clone --verbose --force

NOTICE: using provided configuration file "/etc/repmgr/10/repmgr.conf"
WARNING: following problems with command line parameters detected:
  "config_directory" set in repmgr.conf, but --copy-external-config-files not provided
NOTICE: destination directory "/opt/postgres" provided
INFO: connecting to source node
DETAIL: connection string is: host=192.168.1.253 user=repmgr dbname=repmgr
INFO: replication slot usage not requested;  no replication slot will be set up for this standby
NOTICE: checking for available walsenders on the source node (2 required)
NOTICE: checking replication connections can be made to the source server (2 required)
INFO: sufficient replication connections could be made to the source server (2 required)
WARNING: data checksums are not enabled and "wal_log_hints" is "off"
DETAIL: pg_rewind requires "wal_log_hints" to be enabled
WARNING: directory "/opt/postgres" exists but is not empty
NOTICE: deleting existing directory "/opt/postgres"
/opt/postgres: Permission denied
NOTICE: starting backup (using pg_basebackup)...
HINT: this may take some time; consider using the -c/--fast-checkpoint option
INFO: executing:
  /usr/pgsql-10/bin/pg_basebackup -l "repmgr base backup"  -D /opt/postgres -h 192.168.1.253 -p 5432 -U repmgr -T /opt/postgres/tbs=/opt/postgres/tbs -X stream
pg_basebackup: could not create directory "/opt/postgres/tbs": File exists
pg_basebackup: removing contents of data directory "/opt/postgres"
pg_basebackup: changes to tablespace directories will not be undone
ERROR: unable to take a base backup of the primary server
HINT: data directory ("/opt/postgres") may need to be cleaned up manually


The path /opt/postgres is empty and in /etc/repmgr/10/repmgr.conf we have added this line to try to avoid the error but it remains the same:
tablespace_mapping='/opt/postgres/tbs=/opt/postgres/tbs'


The previous configuration was:

node_id=101
node_name='node1'
conninfo='host=node1 dbname=repmgr user=repmgr'
data_directory='/opt/postgres/'
config_directory='/opt/postgres'
log_file='/var/log/repmgr.log'
repmgrd_service_start_command = '/usr/pgsql-10/bin/repmgrd -d'
repmgrd_service_stop_command = 'kill `cat $(/usr/pgsql-10/bin/repmgrd --show-pid-file)`'
promote_command='/usr/pgsql-10/bin/repmgr standby promote -f /etc/repmgr/10/repmgr.conf --siblings-follow --log-to-file'
follow_command='/usr/pgsql-10/bin/repmgr standby follow -f /etc/repmgr/10/repmgr.conf --log-to-file'
failover=automatic
reconnect_attempts=3
reconnect_interval=5
ssh_options='-q -o StrictHostKeyChecking=no -o ConnectTimeout=10'
service_start_command   = 'sudo systemctl start postgresql-10.service'
service_stop_command    = 'sudo systemctl stop postgresql-10.service'
service_restart_command = 'sudo systemctl restart postgresql-10.service'
service_reload_command  = 'sudo systemctl reload postgresql-10.service'
priority=100
pg_bindir='/usr/pgsql-10/bin'
primary_visibility_consensus=true

node_id=102
node_name='node2'
conninfo='host=node2 dbname=repmgr user=repmgr'
data_directory='/opt/postgres/'
config_directory='/opt/postgres'
log_file='/var/log/repmgr.log'
repmgrd_service_start_command = '/usr/pgsql-10/bin/repmgrd -d'
repmgrd_service_stop_command = 'kill `cat $(/usr/pgsql-10/bin/repmgrd --show-pid-file)`'
promote_command='/usr/pgsql-10/bin/repmgr standby promote -f /etc/repmgr/10/repmgr.conf --siblings-follow --log-to-file'
follow_command='/usr/pgsql-10/bin/repmgr standby follow -f /etc/repmgr/10/repmgr.conf --log-to-file'
failover=automatic
reconnect_attempts=3
reconnect_interval=5
ssh_options='-q -o StrictHostKeyChecking=no -o ConnectTimeout=10'
service_start_command   = 'sudo systemctl start postgresql-10.service'
service_stop_command    = 'sudo systemctl stop postgresql-10.service'
service_restart_command = 'sudo systemctl restart postgresql-10.service'
service_reload_command  = 'sudo systemctl reload postgresql-10.service'
priority=100
pg_bindir='/usr/pgsql-10/bin'
primary_visibility_consensus=true



Thank you very much for your help and best regards.

Reply all
Reply to author
Forward
0 new messages