[Linux-ha-jp] nginxをsystemctl stop するとFOさせたい

Back to archive index
renay****@ybb***** renay****@ybb*****
2020年 7月 26日 (日) 05:27:18 JST


開発次郎さん
おはようございます。山内です。

うまくいったようで、何よりです。
また、何かありましたら、MLの方へご相談ください。

以上です。



----- Original Message -----
>From: 開発次郎 <jiro.****@gmail*****>
>To: renay****@ybb*****; linux****@lists***** 
>Date: 2020/7/25, Sat 17:48
>Subject: Re: [Linux-ha-jp] nginxをsystemctl stop するとFOさせたい
> 
>
>山内さん、早速のアドバイスありがとうございました。
>お陰様で解決しました。
>
>
>以下設定後、
># pcs resource create virtual_ip ocf:heartbeat:IPaddr2 ip=192.168.1.15 cidr_netmask=24 op monitor interval=30s
># pcs resource create webserver systemd:nginx op monitor timeout="5s" interval="5s"
># pcs constraint colocation add webserver virtual_ip INFINITY
># pcs constraint order virtual_ip then webserver
># pcs property set stonith-enabled=false
># pcs property set no-quorum-policy=ignore
># pcs resource defaults migration-threshold=1  ### これを追加しました。
># pcs cluster stop --all
># pcs cluster start --all
>
>
>
># systemctl stop nginx
>で片側へFOしてくれました。
>助かりました。
>
>
>□環境[user001 @ server1 ~]$ cat /etc/centos-release
>CentOS Linux release 7.4.1708 (Core)
>[user001 @ server1 ~]$ uname -a
>Linux server1 3.10.0-693.el7.x86_64 #1 SMP Tue Aug 22 21:09:27 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
>[user001 @ server1 ~]$ pcs --version
>0.9.158
>[user001 @ server1 ~]$ yum list installed | grep pacemaker
>pacemaker.x86_64                       1.1.16-12.el7                   @anaconda
>pacemaker-cli.x86_64                   1.1.16-12.el7                   @anaconda
>pacemaker-cluster-libs.x86_64          1.1.16-12.el7                   @anaconda
>pacemaker-doc.x86_64                   1.1.16-12.el7                   @anaconda
>pacemaker-libs.x86_64                  1.1.16-12.el7                   @anaconda
>[user001 @ server1 ~]$ yum list installed | grep corosync
>corosync.x86_64                        2.4.0-9.el7                     @anaconda
>
>corosynclib.x86_64                     2.4.0-9.el7                     @anaconda
>
>
>以上
>
>2020年7月25日(土) 8:32 <renay****@ybb*****>:
>
>開発次郎さん
>>
>>こんにちは、山内です。
>>
>>pacemakerなどのバージョンが不明ですが、該当nginxリソースのmetaパラメータか、リソースのdefaultパラメータのmigration-thresholdを1に設定してみてください。
>> - https://access.redhat.com/documentation/ja-jp/red_hat_enterprise_linux/7/html/high_availability_add-on_reference/s1-failure_migration-haar
>>
>>実際には他の構成リソースの故障を1回以上許容する場合などには、個別に設定することをお勧めします。
>>
>>---以下は、postfixでsystemdリソースを起動、故障からFOした結果です。---
>>①起動後
>>[root @ rh76-01 ~]# crm_mon -rfA1
>>Stack: corosync
>>Current DC: rh76-02 (version 1.1.22-1a80025) - partition with quorum
>>Last updated: Sat Jul 25 08:26:34 2020
>>Last change: Sat Jul 25 08:26:21 2020 by root via cibadmin on rh76-01
>>
>>2 nodes configured
>>1 resource instance configured
>>
>>Online: [ rh76-01 rh76-02 ]
>>
>>Full list of resources:
>>
>> prmPostfix     (systemd:postfix):      Started rh76-01
>>
>>Node Attributes:
>>* Node rh76-01:
>>* Node rh76-02:
>>
>>Migration Summary:
>>* Node rh76-01:
>>* Node rh76-02:
>>
>>②systemctl stop postfix.service実行後
>>[root @ rh76-01 ~]# crm_mon -rfA1
>>Stack: corosync
>>Current DC: rh76-02 (version 1.1.22-1a80025) - partition with quorum
>>Last updated: Sat Jul 25 08:26:35 2020
>>Last change: Sat Jul 25 08:26:21 2020 by root via cibadmin on rh76-01
>>
>>2 nodes configured
>>1 resource instance configured
>>
>>Online: [ rh76-01 rh76-02 ]
>>
>>Full list of resources:
>>
>> prmPostfix     (systemd:postfix):      FAILED rh76-01
>>
>>Node Attributes:
>>* Node rh76-01:
>>* Node rh76-02:
>>
>>Migration Summary:
>>* Node rh76-01:
>>   prmPostfix: migration-threshold=1 fail-count=1 last-failure='Sat Jul 25 08:26:34 2020'
>>* Node rh76-02:
>>
>>Failed Resource Actions:
>>* prmPostfix_monitor_10000 on rh76-01 'not running' (7): call=7, status=complete, exitreason='',
>>    last-rc-change='Sat Jul 25 08:26:34 2020', queued=0ms, exec=0ms
>>
>>③FO後
>>[root @ rh76-01 ~]# crm_mon -rfA1
>>Stack: corosync
>>Current DC: rh76-02 (version 1.1.22-1a80025) - partition with quorum
>>Last updated: Sat Jul 25 08:26:39 2020
>>Last change: Sat Jul 25 08:26:21 2020 by root via cibadmin on rh76-01
>>
>>2 nodes configured
>>1 resource instance configured
>>
>>Online: [ rh76-01 rh76-02 ]
>>
>>Full list of resources:
>>
>> prmPostfix     (systemd:postfix):      Started rh76-02
>>
>>Node Attributes:
>>* Node rh76-01:
>>* Node rh76-02:
>>
>>Migration Summary:
>>* Node rh76-01:
>>   prmPostfix: migration-threshold=1 fail-count=1 last-failure='Sat Jul 25 08:26:34 2020'
>>* Node rh76-02:
>>
>>Failed Resource Actions:
>>* prmPostfix_monitor_10000 on rh76-01 'not running' (7): call=7, status=complete, exitreason='',
>>    last-rc-change='Sat Jul 25 08:26:34 2020', queued=0ms, exec=0ms
>>
>>
>>以上、よろしくお願いいたします。
>>
>>
>
>



Linux-ha-japan メーリングリストの案内
Back to archive index