From: Jehan-Guillaume de Rorthais <jgdr@dalibo.com>
To: 范国腾 <fanguoteng@highgo.com>
Cc: Cluster Labs - All topics related to open-source clustering welcomed <users@clusterlabs.org>
Cc: Adrien Nayrat <adrien.nayrat@anayrat.info>
Cc: Andrew Edenburn <andrew.edenburn@gm.com>
Cc: pgsql-general@postgresql.org <pgsql-general@postgresql.org>
Subject: Re: [ClusterLabs] 答复: 答复: Postgres PAF setup
Date: Wed, 25 Apr 2018 10:32:32 +0200
Message-ID: <20180425103232.00dc77e8@firost> (raw)
In-Reply-To: <cc7208c7ae80408db54bd3ea9695be0c@EX01.highgo.com>
References: <e3c27cb8039544c9af6849df2c494e95@gm.com>
<21a601ab-d103-d17e-7d2d-ad7d960d5bd1@anayrat.info>
<7d6efeaed9624171b1ead214651ceea9@EX01.highgo.com>
<ed645a9c-1706-f512-46cd-ce61d9c9927d@anayrat.info>
<cc7208c7ae80408db54bd3ea9695be0c@EX01.highgo.com>
You should definitely not patch the PAF source code without opening an issue on
github and discuss your changes. As Adrien explained, your changes could
greatly end up with an instance corruption or data loss.
On Wed, 25 Apr 2018 07:45:55 +0000
范国腾 <fanguoteng@highgo.com> wrote:
...
> Is there any way to make the cluster recover if the postgres was not properly
> stopped, such as the lab power off or the OS reboot?
Os graceful reboot is supposed to be a clean shutdown, you should not have
trouble with PostgreSQL.
For real failure scenarios, you must:
* put your cluster in maintenance mode
* fix your PostgreSQL setup and replication
* make sure PostgreSQL is replicating correctly
* make sure to keep the master where the cluster is waiting for it if needed
* make sure to stop your postgresql instances if the cluster is considering it
is stopped
* switch off maintenance mode
* you might need to start your resource if the cluster kept it stopped.
You can find documentation here and in other pages around:
https://clusterlabs.github.io/PAF/administration.html> -----邮件原件-----
> 发件人: Adrien Nayrat [mailto:adrien.nayrat@anayrat.info]
> 发送时间: 2018年4月25日 15:29
> 收件人: Cluster Labs - All topics related to open-source clustering welcomed
> <users@clusterlabs.org>; 范国腾 <fanguoteng@highgo.com>; Andrew Edenburn
> <andrew.edenburn@gm.com>; pgsql-general@postgresql.org 主题: Re:
> [ClusterLabs] 答复: Postgres PAF setup
>
> On 04/25/2018 02:31 AM, 范国腾 wrote:
> > I have meet the similar issue when the postgres is not stopped normally.
> >
> > You could run pg_controldata to check if your postgres status is
> > shutdown/shutdown in recovery.
> >
> > I change the /usr/lib/ocf/resource.d/heartbeat/pgsqlms to avoid this
> > problem:
> >
> > elsif ( $pgisready_rc == 2 ) {
> > # The instance is not listening.
> > # We check the process status using pg_ctl status and check # if it
> > was propertly shut down using pg_controldata.
> > ocf_log( 'debug', 'pgsql_monitor: instance "%s" is not listening',
> > $OCF_RESOURCE_INSTANCE );
> > # return _confirm_stopped(); # remove this line
> > return $OCF_NOT_RUNNING;
> > }
>
> Hello,
>
> It is a bad idea. The goal of _confirm_stopped is to check if the instance
> was properly stopped. If it wasn't you could corrupt your instance.
>
> _confirm_stopped return $OCF_NOT_RUNNING only if the instance was properly
> shutdown : elsif ( $controldata_rc == $OCF_NOT_RUNNING ) {
> # The controldata state is consistent, the instance was probably
> # propertly shut down.
> ocf_log( 'debug',
> '_confirm_stopped: instance "%s" controldata indicates that the
> instance was propertly shut down', $OCF_RESOURCE_INSTANCE );
> return $OCF_NOT_RUNNING;
> }
>
> Regards,
>
>
> --
> Adrien NAYRAT
>
>
> _______________________________________________
> Users mailing list: Users@clusterlabs.org
> https://lists.clusterlabs.org/mailman/listinfo/users
>
> Project Home: http://www.clusterlabs.org
> Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
> Bugs: http://bugs.clusterlabs.org
--
Jehan-Guillaume de Rorthais
Dalibo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: jgdr@dalibo.com, fanguoteng@highgo.com, users@clusterlabs.org, adrien.nayrat@anayrat.info, andrew.edenburn@gm.com
Subject: Re: [ClusterLabs] 答复: 答复: Postgres PAF setup
In-Reply-To: <20180425103232.00dc77e8@firost>
References: <e3c27cb8039544c9af6849df2c494e95@gm.com> <21a601ab-d103-d17e-7d2d-ad7d960d5bd1@anayrat.info> <7d6efeaed9624171b1ead214651ceea9@EX01.highgo.com> <ed645a9c-1706-f512-46cd-ce61d9c9927d@anayrat.info> <cc7208c7ae80408db54bd3ea9695be0c@EX01.highgo.com> <20180425103232.00dc77e8@firost>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox