Mailing List Archive

How to restart cluster ?
Hello!

Thank you for the answer, but this answer didn't solve my problem.
I have simple two-node cluster with virtual ip address and Postgres with
streaming replication, created with this tutorial:
http://clusterlabs.org/wiki/PgSQL_Replicated_Cluster
I have two problems to solve:
1. I need some script, which will restart cluster on user demand. This
script should stop postgres resource on both nodes and next restart them
in that way, that postgres will be work without any additional
operations (like removing lock files, cleaning resources etc).
2. I have a virtual model of this cluster working under VMWare. VMWare
is restarted from time to time, and I have no control when master or
slave will be restarted. I would like to create script, which will be
called from runlevel 6 and will safely stop postgres resource.
I tried to do it with:

crm configure property stop-all-resources=true

but after reboot I had to remove PGSQL.lock manually, and also master
node has been changed.

Do you have any idea how to do it ?

Taktoshi MATSUO wrote:
>Do you use pgsql RA with Master/Slave setting ?
>I recommend you to stop slave node's pacemaker at first
>because pgsql RA removes PGSQL.lock automatically if the node is
>master and there is no slaves.
>
>Stop procedure
> 1. stop slave node -> suppose nodeB
> 2. stop master node (PGSQL.lock file is removed) -> suppose nodeA
>
>Start procedure
> 3. start the nodeA because it has the newest data.
> 4. start the nodeB
>
>If PGSQL.lock exists, the data may be inconsistent.
>See http://www.slideshare.net/takmatsuo/2012929-pg-study-16012253
(P36, P37)

best regards
Jarek

_______________________________________________
Linux-HA mailing list
Linux-HA@lists.linux-ha.org
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems
Re: How to restart cluster ? [ In reply to ]
On 9 Jun 2014, at 7:58 pm, jarek <jarek@poczta.srv.pl> wrote:

> Hello!
>
> Thank you for the answer, but this answer didn't solve my problem.
> I have simple two-node cluster with virtual ip address and Postgres with
> streaming replication, created with this tutorial:
> http://clusterlabs.org/wiki/PgSQL_Replicated_Cluster
> I have two problems to solve:
> 1. I need some script, which will restart cluster on user demand. This
> script should stop postgres resource on both nodes and next restart them
> in that way, that postgres will be work without any additional
> operations (like removing lock files, cleaning resources etc).

This sounds like a secondary problem. Perhaps back up and explain why you need this?
Also, the RA should be cleaning up lock files when it is asked to stop.

> 2. I have a virtual model of this cluster working under VMWare. VMWare
> is restarted from time to time, and I have no control when master or
> slave will be restarted. I would like to create script, which will be
> called from runlevel 6 and will safely stop postgres resource.
> I tried to do it with:
>
> crm configure property stop-all-resources=true
>
> but after reboot I had to remove PGSQL.lock manually, and also master
> node has been changed.
>
> Do you have any idea how to do it ?
>
> Taktoshi MATSUO wrote:
>> Do you use pgsql RA with Master/Slave setting ?
>> I recommend you to stop slave node's pacemaker at first
>> because pgsql RA removes PGSQL.lock automatically if the node is
>> master and there is no slaves.
>>
>> Stop procedure
>> 1. stop slave node -> suppose nodeB
>> 2. stop master node (PGSQL.lock file is removed) -> suppose nodeA
>>
>> Start procedure
>> 3. start the nodeA because it has the newest data.
>> 4. start the nodeB
>>
>> If PGSQL.lock exists, the data may be inconsistent.
>> See http://www.slideshare.net/takmatsuo/2012929-pg-study-16012253
> (P36, P37)
>
> best regards
> Jarek
>
> _______________________________________________
> Linux-HA mailing list
> Linux-HA@lists.linux-ha.org
> http://lists.linux-ha.org/mailman/listinfo/linux-ha
> See also: http://linux-ha.org/ReportingProblems