[Pacemaker] configuring postgresql streaming replication cluster

Takatoshi MATSUO matsuo.tak at gmail.com
Thu Jun 13 20:50:40 EDT 2013


2013/6/13 Gregg Jaskiewicz <gryzman at gmail.com>:
>
> On 13 June 2013 10:51, Takatoshi MATSUO <matsuo.tak at gmail.com> wrote:
>>
>> Hi
>>
>> > As far the logs go, anything specific I should be grepping for ?
>>
>> Please grep pgsql
>>
>> > node_list="hanode01 hanode02" \
>>
>> You need to add all node names whose replication is controlled by
>> Pacemaker.
>>
>> > pcs resource master msPostgresql pgsql master-max=1 master-node-max=1
>> > clone-max=10 clone-node-max=10 notify=true
>>
>> Why do you use clone-node-max=10 ?
>> Please use clone-node-max=1
>>
>> > pcs constraint order start master-group  then promote msPostgresql
>> > symmetrical=false score=2
>>
>> You should start master-group after promote msPostgresql.
>>
>> I am not good at pcs.
>> Please see
>> https://github.com/t-matsuo/resource-agents/wiki/Resource-Agent-for-PostgreSQL-9.1-streaming-replication
>>
> Thank you. That change however didnt seem to have helped.
> I installed crmsh, and here's the config dump in crm format:
>
>
> node hanode01
> node hanode02
> node hanode03
>
> primitive pgsql ocf:heartbeat:pgsql \
>         params pgctl="/usr/pgsql-9.2/bin/pg_ctl"
> psql="/usr/pgsql-9.2/bin/psql" pgdata="/var/lib/pgsql/9.2/data/"
> restore_command="cp /var/lib/pgsql/9.2/data/pg_archive/\%f \%p"
> start_opt="-p 5432" rep_mode="async" node_list="hanode01 hanode02"
> master_ip="10.0.1.100" stop_escalate="0" repuser="replicator"
> monitor_password="lemon31ee7" monitor_user="monitor" \
>         op start interval="0s" role="Master" timeout="60s" on-fail="block"
>
> primitive vip-master ocf:heartbeat:IPaddr2 \
>         params ip="10.0.0.100" nic="eth1:0" cidr_netmask="24"
> migration-threshold="0" \
>         op start interval="0s" timeout="60s" on-fail="block"
>
> primitive vip-rep ocf:heartbeat:IPaddr2 \
>         params ip="10.0.1.100" nic="eth2:0" cidr_netmask="24"
> migration-threshold="0" \
>         op start interval="0s" timeout="60s" on-fail="block"
>
> group master-group vip-master vip-rep
>
> ms msPostgresql pgsql \
>         meta master-max="1" master-node-max="1" clone-max="10"
> clone-node-max="1" notify="true" target-role="Master"
>
> location location-master-group-hanode01-5000 master-group 5000: hanode01
>
> order order-master-group-msPostgresql-3 3: master-group:stop
> msPostgresql:demote symmetrical=false
> order order-msPostgresql-master-group-2 2: msPostgresql:promote
> master-group:start symmetrical=false
>
> property $id="cib-bootstrap-options"     \
>         expected-quorum-votes="3" \
>         stonith-enabled="false"   \
>         no-quorum-policy="ignore"
>
> rsc_defaults $id="rsc_defaults-options" \
>         resource-stickiness="INFINITY"  \
>         migration-threshold="1"
>
>
> Attached are the logs from Today (I was changing the configuration, starting
> stoping, removing and readding things in the mean time).
>
> this is what I got after: grep pgsql /var/log/messages

Hmm.. there is no RA log.
Do you have there logs somewhere ?
---
Jun 14 09:26:21 16-sl6 pgsql(postgresql)[2372]: INFO: Set all nodes
into async mode.
Jun 14 09:26:21 16-sl6 pgsql(postgresql)[2372]: INFO: server starting
Jun 14 09:26:21 16-sl6 pgsql(postgresql)[2372]: INFO: PostgreSQL start
command sent.
Jun 14 09:26:21 16-sl6 pgsql(postgresql)[2372]: INFO: PostgreSQL is down
Jun 14 09:26:23 16-sl6 pgsql(postgresql)[2372]: WARNING: PostgreSQL
template1 isn't running. rc=0
Jun 14 09:26:23 16-sl6 pgsql(postgresql)[2372]: WARNING: Connection
error (connection to the server went bad and the session was not
interactive) occurred while executing the psql command.
Jun 14 09:26:24 16-sl6 pgsql(postgresql)[2372]: INFO: PostgreSQL is started.
Jun 14 09:26:24 16-sl6 pgsql(postgresql)[2372]: INFO: Changing
postgresql-status on 16-sl6 : STOP->HS:alone.
---
I can get them using pacemaker 1.1.10rc3 and resource-agents-3.9.5 and
latest pgsql RA
https://github.com/ClusterLabs/resource-agents/blob/59fd57d2df5e61e3874225743a61731c019074e8/heartbeat/pgsql


Which version do you use ?
CentOS 6.4 has no pgsql RA supporting replication ?

Thanks,
Takatoshi




More information about the Pacemaker mailing list