答复: [ClusterLabs] 答复: Postgres PAF setup

Поиск
Список
Период
Сортировка
От 范国腾
Тема 答复: [ClusterLabs] 答复: Postgres PAF setup
Дата
Msg-id cc7208c7ae80408db54bd3ea9695be0c@EX01.highgo.com
обсуждение исходный текст
Ответ на Re: [ClusterLabs] 答复: Postgres PAF setup  (Adrien Nayrat <adrien.nayrat@anayrat.info>)
Ответы Re: [ClusterLabs] 答复: 答复: Postgres PAFsetup  (Jehan-Guillaume de Rorthais <jgdr@dalibo.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
OSreboot?
 

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
corruptyour 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



В списке pgsql-general по дате отправления:

Предыдущее
От: Adrien Nayrat
Дата:
Сообщение: Re: [ClusterLabs] 答复: Postgres PAF setup
Следующее
От: Jehan-Guillaume de Rorthais
Дата:
Сообщение: Re: [ClusterLabs] 答复: 答复: Postgres PAFsetup