pg.ddx.io pgsql-general@postgresql.org mailing list archive
help / color / mirror / Atom feed答复: [ClusterLabs] Postgres PAF setup
2+ messages / 1 participants
[nested] [flat]
* 答复: [ClusterLabs] Postgres PAF setup
@ 2018-04-25 00:31 范国腾 <fanguoteng@highgo.com>
2018-04-25 07:45 ` 答复: [ClusterLabs] 答复: Postgres PAF setup 范国腾 <fanguoteng@highgo.com>
0 siblings, 1 reply; 2+ messages in thread
From: 范国腾 @ 2018-04-25 00:31 UTC (permalink / raw)
To: Cluster Labs - All topics related to open-source clustering welcomed <users@clusterlabs.org>; Andrew Edenburn <andrew.edenburn@gm.com>; pgsql-general
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;
}
-----邮件原件-----
发件人: Users [mailto:users-bounces@clusterlabs.org] 代表 Adrien Nayrat
发送时间: 2018年4月24日 16:16
收件人: Andrew Edenburn <andrew.edenburn@gm.com>; pgsql-general@postgresql.org; users@clusterlabs.org
主题: Re: [ClusterLabs] Postgres PAF setup
On 04/23/2018 08:09 PM, Andrew Edenburn wrote:
> I am having issues with my PAF setup. I am new to Postgres and have
> setup the cluster as seen below.
>
> I am getting this error when trying to start my cluster resources.
>
>
>
> Master/Slave Set: pgsql-ha [pgsqld]
>
> pgsqld (ocf::heartbeat:pgsqlms): FAILED dcmilphlum224
> (unmanaged)
>
> pgsqld (ocf::heartbeat:pgsqlms): FAILED dcmilphlum223
> (unmanaged)
>
> pgsql-master-ip (ocf::heartbeat:IPaddr2): Started
> dcmilphlum223
>
>
>
> Failed Actions:
>
> * pgsqld_stop_0 on dcmilphlum224 'unknown error' (1): call=239,
> status=complete, exitreason='Unexpected state for instance "pgsqld"
> (returned 1)',
>
> last-rc-change='Mon Apr 23 13:11:17 2018', queued=0ms, exec=95ms
>
> * pgsqld_stop_0 on dcmilphlum223 'unknown error' (1): call=248,
> status=complete, exitreason='Unexpected state for instance "pgsqld"
> (returned 1)',
>
> last-rc-change='Mon Apr 23 13:11:17 2018', queued=0ms, exec=89ms
>
>
>
> cleanup and clear is not fixing any issues and I am not seeing
> anything in the logs. Any help would be greatly appreciated.
>
>
Hello Andrew,
Could you enable debug logs in Pacemaker?
With Centos you have to edit PCMK_debug variable in /etc/sysconfig/pacemaker :
PCMK_debug=crmd,pengine,lrmd
This should give you more information in logs. Monitor action in PAF should report why the cluster doesn't start :
https://github.com/ClusterLabs/PAF/blob/master/script/pgsqlms#L1525
Regards,
--
Adrien NAYRAT
^ permalink raw reply [nested|flat] 2+ messages in thread
* 答复: [ClusterLabs] 答复: Postgres PAF setup
2018-04-25 00:31 答复: [ClusterLabs] Postgres PAF setup 范国腾 <fanguoteng@highgo.com>
@ 2018-04-25 07:45 ` 范国腾 <fanguoteng@highgo.com>
0 siblings, 0 replies; 2+ messages in thread
From: 范国腾 @ 2018-04-25 07:45 UTC (permalink / raw)
To: Adrien Nayrat <adrien.nayrat@anayrat.info>; Cluster Labs - All topics related to open-source clustering welcomed <users@clusterlabs.org>; Andrew Edenburn <andrew.edenburn@gm.com>; pgsql-general
Adrien,
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?
Thanks
-----邮件原件-----
发件人: 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
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2018-04-25 07:45 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-04-25 00:31 答复: [ClusterLabs] Postgres PAF setup 范国腾 <fanguoteng@highgo.com>
2018-04-25 07:45 ` 答复: [ClusterLabs] 答复: Postgres PAF setup 范国腾 <fanguoteng@highgo.com>
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