PostgreSQL - Problema con Postgresql y pacemaker

 
Vista:

Problema con Postgresql y pacemaker

Publicado por alexldemise (1 intervención) el 09/05/2019 14:38:32
Tengo 2 nodos de Posgresql 10 en centos 7, uno como master y otro como esclavo, replicado desde recovery.conf

El contenido del recovry.conf es:

1
2
3
4
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'


Y está funcionando correctamente.

Desde el master si hago

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

me devuelve corerctamente

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


Ahora intento pasar este "cluster" a Pacemaker

Uso la siguiente configuración:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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




Pero no consigo ue se levanten los nodos de postgresql, me aparece lo siguiente si ejecuto 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


--------------------------------------------------------------------------------------------------

En el log de los nodos en /var/log/messages me aparece lo siguiente en ambos nodos:




-------------------------------------------------------------------------------------------------

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)


-------------------------------------------------------------------------------------------------------


¿Alguien sabe lo que puede estar sucediendo?
Además, al fallar, me intenta crear el archivo /var/lib/pgsql/10/data/recovery.conf en el nodo1

Un saludo y muchs gracias de antemano.
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder