1

I have 2 nodes with Postgresql 10 on Centos7, one as master and one as slave, replicating from recovery.conf

the content of recovery.conf is:

standby_mode = 'on'
primary_conninfo = 'host=10.240.49.81 port=5432 user=postgres application_name=idepgsql02n.ieca.junta-andalucia.es keepalives_idle=60 keepalives_interval=5 keepalives_count=5'
restore_command = 'cp /var/lib/pgsql/pg_archive/%f %p'
recovery_target_timeline = 'latest'

And it works perfectly.

From master i do:

su - postgres
psql -c "select client_addr,sync_state from pg_stat_replication;"

And give me back

client_addr  | sync_state 
--------------+------------
 10.240.49.82 | async
(1 row)

Now I try to replicate this "cluster" on Pacemaker

I use this configuration:

pcs cluster cib pgsql_cfg

 pcs -f pgsql_cfg property set no-quorum-policy="ignore"
 pcs -f pgsql_cfg property set stonith-enabled="false"
 pcs -f pgsql_cfg resource defaults migration-threshold="1"

 pcs -f pgsql_cfg resource create vip-master IPaddr2 \
    ip="10.240.49.83" \
    nic="ens160" \
    cidr_netmask="24" \
    op start   timeout="60s" interval="0s"  on-fail="restart" \
    op monitor timeout="60s" interval="10s" on-fail="restart" \
    op stop    timeout="60s" interval="0s"  on-fail="block"

 pcs -f pgsql_cfg resource create pgsql pgsql \
    pgctl="/usr/pgsql-10/bin/pg_ctl" \
    psql="/usr/pgsql-10/bin/psql" \
    pgdata="/var/lib/pgsql/10/data/" \
    rep_mode="sync" \
    node_list="idepgsql01n idepgsql2n" \
    restore_command="cp /var/lib/pgsql/pg_archive/%f %p" \
    primary_conninfo_opt="keepalives_idle=60 keepalives_interval=5 keepalives_count=5" \
    master_ip="10.240.49.83" \
    restart_on_promote='true' \
    op start   timeout="60s" interval="0s"  on-fail="restart" \
    op monitor timeout="60s" interval="4s" on-fail="restart" \
    op monitor timeout="60s" interval="3s"  on-fail="restart" role="Master" \
    op promote timeout="60s" interval="0s"  on-fail="restart" \
    op demote  timeout="60s" interval="0s"  on-fail="stop" \
    op stop    timeout="60s" interval="0s"  on-fail="block" \
    op notify  timeout="60s" interval="0s"

 pcs -f pgsql_cfg resource master msPostgresql pgsql \
    master-max=1 master-node-max=1 clone-max=2 clone-node-max=1 notify=true


 pcs -f pgsql_cfg constraint order start vip-master then promote msPostgresql symmetrical=false score=INFINITY


 pcs cluster cib-push pgsql_cfg --config

But I can't get that both nodes of Postgresql turn on, it shows me this at "crm_mon -Afr -1":

Stack: corosync
Current DC: idepgsql02n (version 1.1.19-8.el7_6.4-c3c624ea3d) - partition with quorum
Last updated: Thu May  9 14:32:32 2019
Last change: Thu May  9 14:32:05 2019 by root via cibadmin on idepgsql01n

2 nodes configured
3 resources configured

Online: [ idepgsql01n idepgsql02n ]

Full list of resources:

vip-master (ocf::heartbeat:IPaddr2):   Started idepgsql01n
 Master/Slave Set: msPostgresql [pgsql]
     Stopped: [ idepgsql01n idepgsql02n ]

Node Attributes:
* Node idepgsql01n:
    + master-pgsql                      : -INFINITY 
* Node idepgsql02n:
    + master-pgsql                      : -INFINITY 

Migration Summary:
* Node idepgsql01n:
   pgsql: migration-threshold=1 fail-count=1000000 last-failure='Thu May  9 14:32:17 2019'
* Node idepgsql02n:
   pgsql: migration-threshold=1 fail-count=1000000 last-failure='Thu May  9 14:32:17 2019'

Failed Actions:
* pgsql_start_0 on idepgsql01n 'unknown error' (1): call=12, status=complete, exitreason='',
    last-rc-change='Thu May  9 14:32:07 2019', queued=1ms, exec=10596ms
* pgsql_start_0 on idepgsql02n 'unknown error' (1): call=11, status=complete, exitreason='',
    last-rc-change='Thu May  9 14:32:07 2019', queued=0ms, exec=10613ms

At log of both nodes in /var/log/messages I can see this:

May 9 14:33:29 idepgsql01n pgsql(pgsql)[23839]: INFO: Don't check /var/lib/pgsql/10/data/ during probe 
May 9 14:33:29 idepgsql01n pgsql(pgsql)[23839]: INFO: PostgreSQL is down 
May 9 14:33:29 idepgsql01n crmd[22677]: notice: Result of probe operation for pgsql on idepgsql01n: 7 (not running) 
May 9 14:33:29 idepgsql01n rsyslogd: action 'action 7' resumed (module 'builtin:omfwd') [v8.24.0-34.el7 try http://www.rsyslog.com/e/2359 ] 
May 9 14:33:29 idepgsql01n rsyslogd: action 'action 7' resumed (module 'builtin:omfwd') [v8.24.0-34.el7 try http://www.rsyslog.com/e/2359 ] 
May 9 14:33:29 idepgsql01n su: (to postgres) root on none 
May 9 14:33:29 idepgsql01n pgsql(pgsql)[23886]: WARNING: Retrying(remain 5). "/usr/sbin/crm_attribute -l reboot -N idepgsql01n.ieca.junta-andalucia.es -n pgsql-master-baseline -D" failed. rc=6. stdout="". 
May 9 14:33:31 idepgsql01n pgsql(pgsql)[23886]: WARNING: Retrying(remain 4). "/usr/sbin/crm_attribute -l reboot -N idepgsql01n.ieca.junta-andalucia.es -n pgsql-master-baseline -D" failed. rc=6. stdout="". 
May 9 14:33:32 idepgsql01n pgsql(pgsql)[23886]: WARNING: Retrying(remain 3). "/usr/sbin/crm_attribute -l reboot -N idepgsql01n.ieca.junta-andalucia.es -n pgsql-master-baseline -D" failed. rc=6. stdout="". 
May 9 14:33:33 idepgsql01n pgsql(pgsql)[23886]: WARNING: Retrying(remain 2). "/usr/sbin/crm_attribute -l reboot -N idepgsql01n.ieca.junta-andalucia.es -n pgsql-master-baseline -D" failed. rc=6. stdout="". 
May 9 14:33:34 idepgsql01n pgsql(pgsql)[23886]: WARNING: Retrying(remain 1). "/usr/sbin/crm_attribute -l reboot -N idepgsql01n.ieca.junta-andalucia.es -n pgsql-master-baseline -D" failed. rc=6. stdout="". 
May 9 14:33:35 idepgsql01n pgsql(pgsql)[23886]: ERROR: giving up executing "/usr/sbin/crm_attribute -l reboot -N idepgsql01n.ieca.junta-andalucia.es -n pgsql-master-baseline -D" May 9 14:33:35 idepgsql01n su: (to postgres) root on none 
May 9 14:33:35 idepgsql01n pgsql(pgsql)[23886]: WARNING: Retrying(remain 5). "/usr/sbin/crm_attribute -l reboot -N idepgsql01n.ieca.junta-andalucia.es -n pgsql-xlog-loc -D" failed. rc=6. stdout="". 
May 9 14:33:36 idepgsql01n pgsql(pgsql)[23886]: WARNING: Retrying(remain 4). "/usr/sbin/crm_attribute -l reboot -N idepgsql01n.ieca.junta-andalucia.es -n pgsql-xlog-loc -D" failed. rc=6. stdout="". 
May 9 14:33:37 idepgsql01n pgsql(pgsql)[23886]: WARNING: Retrying(remain 3). "/usr/sbin/crm_attribute -l reboot -N idepgsql01n.ieca.junta-andalucia.es -n pgsql-xlog-loc -D" failed. rc=6. stdout="". 
May 9 14:33:38 idepgsql01n pgsql(pgsql)[23886]: WARNING: Retrying(remain 2). "/usr/sbin/crm_attribute -l reboot -N idepgsql01n.ieca.junta-andalucia.es -n pgsql-xlog-loc -D" failed. rc=6. stdout="". 
May 9 14:33:39 idepgsql01n pgsql(pgsql)[23886]: WARNING: Retrying(remain 1). "/usr/sbin/crm_attribute -l reboot -N idepgsql01n.ieca.junta-andalucia.es -n pgsql-xlog-loc -D" failed. rc=6. stdout="". 
May 9 14:33:40 idepgsql01n pgsql(pgsql)[23886]: ERROR: giving up executing "/usr/sbin/crm_attribute -l reboot -N idepgsql01n.ieca.junta-andalucia.es -n pgsql-xlog-loc -D" 
May 9 14:33:40 idepgsql01n lrmd[22674]: notice: pgsql_start_0:23886:stderr [ Could not map name=idepgsql01n.ieca.junta-andalucia.es to a UUID ] 
May 9 14:33:40 idepgsql01n lrmd[22674]: notice: pgsql_start_0:23886:stderr [ Could not map name=idepgsql01n.ieca.junta-andalucia.es to a UUID ] 
May 9 14:33:40 idepgsql01n lrmd[22674]: notice: pgsql_start_0:23886:stderr [ Could not map name=idepgsql01n.ieca.junta-andalucia.es to a UUID ] 
May 9 14:33:40 idepgsql01n lrmd[22674]: notice: pgsql_start_0:23886:stderr [ Could not map name=idepgsql01n.ieca.junta-andalucia.es to a UUID ] 
May 9 14:33:40 idepgsql01n lrmd[22674]: notice: pgsql_start_0:23886:stderr [ Could not map name=idepgsql01n.ieca.junta-andalucia.es to a UUID ] 
May 9 14:33:40 idepgsql01n lrmd[22674]: notice: pgsql_start_0:23886:stderr [ Could not map name=idepgsql01n.ieca.junta-andalucia.es to a UUID ] 
May 9 14:33:40 idepgsql01n lrmd[22674]: notice: pgsql_start_0:23886:stderr [ Could not map name=idepgsql01n.ieca.junta-andalucia.es to a UUID ] 
May 9 14:33:40 idepgsql01n lrmd[22674]: notice: pgsql_start_0:23886:stderr [ Could not map name=idepgsql01n.ieca.junta-andalucia.es to a UUID ] 
May 9 14:33:40 idepgsql01n lrmd[22674]: notice: pgsql_start_0:23886:stderr [ Could not map name=idepgsql01n.ieca.junta-andalucia.es to a UUID ] 
May 9 14:33:40 idepgsql01n lrmd[22674]: notice: pgsql_start_0:23886:stderr [ Could not map name=idepgsql01n.ieca.junta-andalucia.es to a UUID ] 
May 9 14:33:40 idepgsql01n crmd[22677]: notice: Result of start operation for pgsql on idepgsql01n: 1 (unknown error) 
May 9 14:33:40 idepgsql01n crmd[22677]: notice: idepgsql01n-pgsql_start_0:23 [ Could not map name=idepgsql01n.ieca.junta-andalucia.es to a UUID\nCould not map name=idepgsql01n.ieca.junta-andalucia.es to a UUID\nCould not map name=idepgsql01n.ieca.junta-andalucia.es to a UUID\nCould not map name=idepgsql01n.ieca.junta-andalucia.es to a UUID\nCould not map name=idepgsql01n.ieca.junta-andalucia.es to a UUID\nCould not map name=idepgsql01n.ieca.junta-andalucia.es to a UUID\nCould not map name=idepgsql01n.ieca.junta-andalucia.es to a UUID\nCould no 
May 9 14:33:40 idepgsql01n su: (to postgres) root on none 
May 9 14:33:40 idepgsql01n crmd[22677]: notice: Result of notify operation for pgsql on idepgsql01n: 0 (ok) 
May 9 14:33:40 idepgsql01n su: (to postgres) root on none 
May 9 14:33:40 idepgsql01n crmd[22677]: notice: Result of notify operation for pgsql on idepgsql01n: 0 (ok) 
May 9 14:33:40 idepgsql01n su: (to postgres) root on none 
May 9 14:33:40 idepgsql01n pgsql(pgsql)[24192]: WARNING: Retrying(remain 5). "/usr/sbin/crm_attribute -l reboot -N idepgsql01n.ieca.junta-andalucia.es -n pgsql-xlog-loc -D" failed. rc=6. stdout="". 
May 9 14:33:41 idepgsql01n pgsql(pgsql)[24192]: WARNING: Retrying(remain 4). "/usr/sbin/crm_attribute -l reboot -N idepgsql01n.ieca.junta-andalucia.es -n pgsql-xlog-loc -D" failed. rc=6. stdout="". 
May 9 14:33:42 idepgsql01n pgsql(pgsql)[24192]: WARNING: Retrying(remain 3). "/usr/sbin/crm_attribute -l reboot -N idepgsql01n.ieca.junta-andalucia.es -n pgsql-xlog-loc -D" failed. rc=6. stdout="". 
May 9 14:33:43 idepgsql01n pgsql(pgsql)[24192]: WARNING: Retrying(remain 2). "/usr/sbin/crm_attribute -l reboot -N idepgsql01n.ieca.junta-andalucia.es -n pgsql-xlog-loc -D" failed. rc=6. stdout="". 
May 9 14:33:44 idepgsql01n pgsql(pgsql)[24192]: WARNING: Retrying(remain 1). "/usr/sbin/crm_attribute -l reboot -N idepgsql01n.ieca.junta-andalucia.es -n pgsql-xlog-loc -D" failed. rc=6. stdout="". 
May 9 14:33:45 idepgsql01n pgsql(pgsql)[24192]: ERROR: giving up executing "/usr/sbin/crm_attribute -l reboot -N idepgsql01n.ieca.junta-andalucia.es -n pgsql-xlog-loc -D" 
May 9 14:33:45 idepgsql01n pgsql(pgsql)[24192]: INFO: PostgreSQL is already stopped. May 9 14:33:46 idepgsql01n lrmd[22674]: notice: pgsql_stop_0:24192:stderr [ Could not map name=idepgsql01n.ieca.junta-andalucia.es to a UUID ] 
May 9 14:33:46 idepgsql01n lrmd[22674]: notice: pgsql_stop_0:24192:stderr [ Could not map name=idepgsql01n.ieca.junta-andalucia.es to a UUID ] 
May 9 14:33:46 idepgsql01n lrmd[22674]: notice: pgsql_stop_0:24192:stderr [ Could not map name=idepgsql01n.ieca.junta-andalucia.es to a UUID ] 
May 9 14:33:46 idepgsql01n lrmd[22674]: notice: pgsql_stop_0:24192:stderr [ Could not map name=idepgsql01n.ieca.junta-andalucia.es to a UUID ] 
May 9 14:33:46 idepgsql01n lrmd[22674]: notice: pgsql_stop_0:24192:stderr [ Could not map name=idepgsql01n.ieca.junta-andalucia.es to a UUID ] 
May 9 14:33:46 idepgsql01n crmd[22677]: notice: Result of stop operation for pgsql on idepgsql01n: 0 (ok)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.