6.2. Pacemaker コマンド
6.2.1. クラスターの起動と停止
すべてのノードでクラスターを起動するには、次のコマンドを実行します。
# pcs cluster start -all
再起動後、サービスが有効になっている場合にのみ、クラスターが自動的に起動します。このコマンドは、クラスターが起動したかどうか、およびデーモンの自動起動が有効になっているかどうかを確認するのに役立ちます。
# pcs cluster status
クラスターの自動起動は次の方法で有効にできます。
# pcs cluster enable --all
その他のオプションは以下のとおりです。
- クラスターを停止する
- ノードをスタンバイ状態にする
-
クラスターを
maintenance-mode
にする
詳細は、pcs cluster
のヘルプを参照してください。
# pcs cluster stop --all # pcs cluster help
6.2.2. クラスターを maintenance-mode
にする
変更を加えるときに Pacemaker クラスターによる干渉を避けるには、クラスターを maintenance-mode
にすることで、クラスターを "フリーズ" できます。
# pcs property set maintenance-mode=true
maintenance-mode
を確認する簡単な方法は、リソースが unmanaged かどうかを確認することです。
# pcs resource * Clone Set: SAPHanaTopology_RH2_02-clone [SAPHanaTopology_RH2_02] (unmanaged): * SAPHanaTopology_RH2_02 (ocf:heartbeat:SAPHanaTopology): Started clusternode1 (unmanaged) * SAPHanaTopology_RH2_02 (ocf:heartbeat:SAPHanaTopology): Started clusternode2 (unmanaged) * Clone Set: SAPHana_RH2_02-clone [SAPHana_RH2_02] (promotable, unmanaged): * SAPHana_RH2_02 (ocf:heartbeat:SAPHana): Unpromoted clusternode1 (unmanaged) * SAPHana_RH2_02 (ocf:heartbeat:SAPHana): Promoted clusternode2 (unmanaged) * vip_RH2_02_MASTER (ocf:heartbeat:IPaddr2): Started clusternode2 (unmanaged)
maintenance-mode
のクラスターは、リソースステータスの変更を更新しません。その間に、クラスターリソースを更新してリソース状態を検出します。
# pcs resource refresh
これにより、何か問題がある場合にその問題が示され、maintenance-mode
が終了するとすぐに、クラスターによる修復アクションが実行されます。
次のコマンドを実行して maintenance-mode
を解除します。
# pcs property set maintenance-mode=false
これで、クラスターが引き続き動作します。設定に問題があった場合、クラスターはその問題にすぐに対処します。
6.2.3. クラスターのステータスの確認
以下に、クラスターのステータスを確認するいくつかの方法を示します。
クラスターが実行中かどうかを確認します。
# pcs cluster status
クラスターとすべてのリソースを確認します。
# pcs status
クラスター、すべてのリソース、およびすべてのノード属性を確認します。
# pcs status --full
リソースのみを確認します。
# pcs resource status --full
Stonith
の履歴を確認します。# pcs stonith history
場所の制約を確認します。
# pcs constraint location
フェンシングを設定してテストする必要があります。可能な限り自動化されたソリューションを実現するには、クラスターを常にアクティブにする必要があります。そうすることで、再起動後にクラスターが自動的に起動できるようになります。実稼働環境では、再起動を無効にすると、クラッシュ後などに手動で介入できるようになります。デーモンのステータスも確認してください。
以下に例を示します。
# pcs status --full Cluster name: cluster1 Status of pacemakerd: 'Pacemaker is running' (last updated 2023-06-22 17:56:01 +02:00) Cluster Summary: * Stack: corosync * Current DC: clusternode2 (2) (version 2.1.5-7.el9-a3f44794f94) - partition with quorum * Last updated: Thu Jun 22 17:56:01 2023 * Last change: Thu Jun 22 17:53:34 2023 by root via crm_attribute on clusternode1 * 2 nodes configured * 6 resource instances configured Node List: * Node clusternode1 (1): online, feature set 3.16.2 * Node clusternode2 (2): online, feature set 3.16.2 Full List of Resources: * h7fence (stonith:fence_rhevm): Started clusternode2 * Clone Set: SAPHanaTopology_RH2_02-clone [SAPHanaTopology_RH2_02]: * SAPHanaTopology_RH2_02 (ocf:heartbeat:SAPHanaTopology): Started clusternode1 * SAPHanaTopology_RH2_02 (ocf:heartbeat:SAPHanaTopology): Started clusternode2 * Clone Set: SAPHana_RH2_02-clone [SAPHana_RH2_02] (promotable): * SAPHana_RH2_02 (ocf:heartbeat:SAPHana): Promoted clusternode1 * SAPHana_RH2_02 (ocf:heartbeat:SAPHana): Unpromoted clusternode2 * vip_RH2_02_MASTER (ocf:heartbeat:IPaddr2): Started clusternode1 Node Attributes: * Node: clusternode1 (1): * hana_rh2_clone_state : PROMOTED * hana_rh2_op_mode : logreplay * hana_rh2_remoteHost : clusternode2 * hana_rh2_roles : 4:P:master1:master:worker:master * hana_rh2_site : DC1 * hana_rh2_sra : - * hana_rh2_srah : - * hana_rh2_srmode : syncmem * hana_rh2_sync_state : PRIM * hana_rh2_version : 2.00.059.02 * hana_rh2_vhost : clusternode1 * lpa_rh2_lpt : 1687449214 * master-SAPHana_RH2_02 : 150 * Node: clusternode2 (2): * hana_rh2_clone_state : DEMOTED * hana_rh2_op_mode : logreplay * hana_rh2_remoteHost : clusternode1 * hana_rh2_roles : 4:S:master1:master:worker:master * hana_rh2_site : DC2 * hana_rh2_sra : - * hana_rh2_srah : - * hana_rh2_srmode : syncmem * hana_rh2_sync_state : SOK * hana_rh2_version : 2.00.059.02 * hana_rh2_vhost : clusternode2 * lpa_rh2_lpt : 30 * master-SAPHana_RH2_02 : 100 Migration Summary: Tickets: PCSD Status: clusternode1: Online clusternode2: Online Daemon Status: corosync: active/enabled pacemaker: active/enabled pcsd: active/enabled
6.2.4. リソースの状態の確認
pcs resource
を使用して、すべてのリソースのステータスを確認します。これにより、リソースのリストと現在のステータスが出力されます。
以下に例を示します。
# pcs resource * Clone Set: SAPHanaTopology_RH2_02-clone [SAPHanaTopology_RH2_02]: * Started: [ clusternode1 clusternode2 ] * Clone Set: SAPHana_RH2_02-clone [SAPHana_RH2_02] (promotable): * Promoted: [ clusternode1 ] * Unpromoted: [ clusternode2 ] * vip_RH2_02_MASTER (ocf:heartbeat:IPaddr2): Started clusternode1
6.2.5. リソース設定の確認
次のコマンドで、現在のリソース設定が表示されます。
# pcs resource config Resource: vip_RH2_02_MASTER (class=ocf provider=heartbeat type=IPaddr2) Attributes: vip_RH2_02_MASTER-instance_attributes ip=192.168.5.136 Operations: monitor: vip_RH2_02_MASTER-monitor-interval-10s interval=10s timeout=20s start: vip_RH2_02_MASTER-start-interval-0s interval=0s timeout=20s stop: vip_RH2_02_MASTER-stop-interval-0s interval=0s timeout=20s Clone: SAPHanaTopology_RH2_02-clone Meta Attributes: SAPHanaTopology_RH2_02-clone-meta_attributes clone-max=2 clone-node-max=1 interleave=true Resource: SAPHanaTopology_RH2_02 (class=ocf provider=heartbeat type=SAPHanaTopology) Attributes: SAPHanaTopology_RH2_02-instance_attributes InstanceNumber=02 SID=RH2 Operations: methods: SAPHanaTopology_RH2_02-methods-interval-0s interval=0s timeout=5 monitor: SAPHanaTopology_RH2_02-monitor-interval-10 interval=10 timeout=600 reload: SAPHanaTopology_RH2_02-reload-interval-0s interval=0s timeout=5 start: SAPHanaTopology_RH2_02-start-interval-0s interval=0s timeout=600 stop: SAPHanaTopology_RH2_02-stop-interval-0s interval=0s timeout=600 Clone: SAPHana_RH2_02-clone Meta Attributes: SAPHana_RH2_02-clone-meta_attributes clone-max=2 clone-node-max=1 interleave=true notify=true promotable=true Resource: SAPHana_RH2_02 (class=ocf provider=heartbeat type=SAPHana) Attributes: SAPHana_RH2_02-instance_attributes AUTOMATED_REGISTER=true DUPLICATE_PRIMARY_TIMEOUT=300 HANA_CALL_TIMEOUT=10 InstanceNumber=02 PREFER_SITE_TAKEOVER=true SID=RH2 Operations: demote: SAPHana_RH2_02-demote-interval-0s interval=0s timeout=3600 methods: SAPHana_RH2_02-methods-interval-0s interval=0s timeout=5 monitor: SAPHana_RH2_02-monitor-interval-251 interval=251 timeout=700 role=Unpromoted monitor: SAPHana_RH2_02-monitor-interval-249 interval=249 timeout=700 role=Promoted promote: SAPHana_RH2_02-promote-interval-0s interval=0s timeout=3600 reload: SAPHana_RH2_02-reload-interval-0s interval=0s timeout=5 start: SAPHana_RH2_02-start-interval-0s interval=0s timeout=3200 stop: SAPHana_RH2_02-stop-interval-0s interval=0s timeout=3100
これには、インストールおよび設定されたリソースエージェントの設定に使用されるすべてのパラメーターがリスト表示されます。
6.2.6. SAPHana リソースオプションの AUTOMATED_REGISTER=true
このオプションを SAPHana リソースで使用すると、Pacemaker はセカンダリーデータベースを自動的に再登録します。
最初のテストではこのオプションを使用することを推奨します。AUTOMATED_REGISTER=false
を使用した場合、管理者はセカンダリーノードを手動で再登録する必要があります。
6.2.7. リソースの処理
リソース管理には複数のオプションがあります。詳細は、利用可能なヘルプを参照してください。
# pcs resource help
使用されているリソースエージェントをリスト表示します。
# pcs resource config | grep "type=" | awk -F"type=" '{ print $2 }' | sed -e "s/)//g"
出力例:
IPaddr2 SAPHanaTopology SAPHana
特定のリソースエージェントの説明と設定パラメーターを表示します。
# pcs resource describe <resource agent>
例 (出力なし):
# pcs resource describe IPaddr2
リソースエージェント IPaddr2
の例 (出力付き):
Assumed agent name 'ocf:heartbeat:IPaddr2' (deduced from 'IPaddr2') ocf:heartbeat:IPaddr2 - Manages virtual IPv4 and IPv6 addresses (Linux specific version) This Linux-specific resource manages IP alias IP addresses. It can add an IP alias, or remove one. In addition, it can implement Cluster Alias IP functionality if invoked as a clone resource. If used as a clone, "shared address with a trivial, stateless (autonomous) load-balancing/mutual exclusion on ingress" mode gets applied (as opposed to "assume resource uniqueness" mode otherwise). For that, Linux firewall (kernel and userspace) is assumed, and since recent distributions are ambivalent in plain "iptables" command to particular back-end resolution, "iptables-legacy" (when present) gets prioritized so as to avoid incompatibilities (note that respective ipt_CLUSTERIP firewall extension in use here is, at the same time, marked deprecated, yet said "legacy" layer can make it workable, literally, to this day) with "netfilter" one (as in "iptables-nft"). In that case, you should explicitly set clone-node-max >= 2, and/or clone-max < number of nodes. In case of node failure, clone instances need to be re- allocated on surviving nodes. This would not be possible if there is already an instance on those nodes, and clone-node-max=1 (which is the default). When the specified IP address gets assigned to a respective interface, the resource agent sends unsolicited ARP (Address Resolution Protocol, IPv4) or NA (Neighbor Advertisement, IPv6) packets to inform neighboring machines about the change. This functionality is controlled for both IPv4 and IPv6 by shared 'arp_*' parameters. Resource options: ip (required) (unique): The IPv4 (dotted quad notation) or IPv6 address (colon hexadecimal notation) example IPv4 "192.168.1.1". example IPv6 "2001:db8:DC28:0:0:FC57:D4C8:1FFF". nic: The base network interface on which the IP address will be brought online. If left empty, the script will try and determine this from the routing table. Do NOT specify an alias interface in the form eth0:1 or anything here; rather, specify the base interface only. If you want a label, see the iflabel parameter. Prerequisite: There must be at least one static IP address, which is not managed by the cluster, assigned to the network interface. If you can not assign any static IP address on the interface, modify this kernel parameter: sysctl -w net.ipv4.conf.all.promote_secondaries=1 # (or per device) cidr_netmask: The netmask for the interface in CIDR format (e.g., 24 and not 255.255.255.0) If unspecified, the script will also try to determine this from the routing table. broadcast: Broadcast address associated with the IP. It is possible to use the special symbols '+' and '-' instead of the broadcast address. In this case, the broadcast address is derived by setting/resetting the host bits of the interface prefix. iflabel: You can specify an additional label for your IP address here. This label is appended to your interface name. The kernel allows alphanumeric labels up to a maximum length of 15 characters including the interface name and colon (e.g. eth0:foobar1234) A label can be specified in nic parameter but it is deprecated. If a label is specified in nic name, this parameter has no effect. lvs_support: Enable support for LVS Direct Routing configurations. In case a IP address is stopped, only move it to the loopback device to allow the local node to continue to service requests, but no longer advertise it on the network. Notes for IPv6: It is not necessary to enable this option on IPv6. Instead, enable 'lvs_ipv6_addrlabel' option for LVS-DR usage on IPv6. lvs_ipv6_addrlabel: Enable adding IPv6 address label so IPv6 traffic originating from the address's interface does not use this address as the source. This is necessary for LVS-DR health checks to realservers to work. Without it, the most recently added IPv6 address (probably the address added by IPaddr2) will be used as the source address for IPv6 traffic from that interface and since that address exists on loopback on the realservers, the realserver response to pings/connections will never leave its loopback. See RFC3484 for the detail of the source address selection. See also 'lvs_ipv6_addrlabel_value' parameter. lvs_ipv6_addrlabel_value: Specify IPv6 address label value used when 'lvs_ipv6_addrlabel' is enabled. The value should be an unused label in the policy table which is shown by 'ip addrlabel list' command. You would rarely need to change this parameter. mac: Set the interface MAC address explicitly. Currently only used in case of the Cluster IP Alias. Leave empty to chose automatically. clusterip_hash: Specify the hashing algorithm used for the Cluster IP functionality. unique_clone_address: If true, add the clone ID to the supplied value of IP to create a unique address to manage arp_interval: Specify the interval between unsolicited ARP (IPv4) or NA (IPv6) packets in milliseconds. This parameter is deprecated and used for the backward compatibility only. It is effective only for the send_arp binary which is built with libnet, and send_ua for IPv6. It has no effect for other arp_sender. arp_count: Number of unsolicited ARP (IPv4) or NA (IPv6) packets to send at resource initialization. arp_count_refresh: For IPv4, number of unsolicited ARP packets to send during resource monitoring. Doing so helps mitigate issues of stuck ARP caches resulting from split-brain situations. arp_bg: Whether or not to send the ARP (IPv4) or NA (IPv6) packets in the background. The default is true for IPv4 and false for IPv6. arp_sender: For IPv4, the program to send ARP packets with on start. Available options are: - send_arp: default - ipoibarping: default for infiniband interfaces if ipoibarping is available - iputils_arping: use arping in iputils package - libnet_arping: use another variant of arping based on libnet send_arp_opts: For IPv4, extra options to pass to the arp_sender program. Available options are vary depending on which arp_sender is used. A typical use case is specifying '-A' for iputils_arping to use ARP REPLY instead of ARP REQUEST as Gratuitous ARPs. flush_routes: Flush the routing table on stop. This is for applications which use the cluster IP address and which run on the same physical host that the IP address lives on. The Linux kernel may force that application to take a shortcut to the local loopback interface, instead of the interface the address is really bound to. Under those circumstances, an application may, somewhat unexpectedly, continue to use connections for some time even after the IP address is deconfigured. Set this parameter in order to immediately disable said shortcut when the IP address goes away. run_arping: For IPv4, whether or not to run arping for collision detection check. nodad: For IPv6, do not perform Duplicate Address Detection when adding the address. noprefixroute: Use noprefixroute flag (see 'man ip-address'). preferred_lft: For IPv6, set the preferred lifetime of the IP address. This can be used to ensure that the created IP address will not be used as a source address for routing. Expects a value as specified in section 5.5.4 of RFC 4862. network_namespace: Specifies the network namespace to operate within. The namespace must already exist, and the interface to be used must be within the namespace. Default operations: start: interval=0s timeout=20s stop: interval=0s timeout=20s monitor: interval=10s timeout=20s
クラスターが停止すると、すべてのリソースも停止します。クラスターが maintenance-mode
になると、すべてのリソースは現在のステータスのままになりますが、監視または管理されなくなります。
6.2.8. maintenance mode のクラスタープロパティーの処理
定義されているすべてのプロパティーをリスト表示します。
[root@clusternode1] pcs property Cluster Properties: cluster-infrastructure: corosync cluster-name: cluster1 concurrent-fencing: true dc-version: 2.1.5-7.el9-a3f44794f94 hana_rh2_site_srHook_DC1: PRIM hana_rh2_site_srHook_DC2: SFAIL have-watchdog: false last-lrm-refresh: 1688548036 maintenance-mode: true priority-fencing-delay: 10s stonith-enabled: true stonith-timeout: 900
データベースを再設定するには、設定が完了するまで変更を無視するようにクラスターに指示する必要があります。以下を使用してクラスターを maintenance-mode
にできます。
# pcs property set maintenance-mode=true
maintenance-mode
を確認します。
# pcs resource * Clone Set: SAPHanaTopology_RH2_02-clone [SAPHanaTopology_RH2_02] (unmanaged): * SAPHanaTopology_RH2_02 (ocf:heartbeat:SAPHanaTopology): Started clusternode1 (unmanaged) * SAPHanaTopology_RH2_02 (ocf:heartbeat:SAPHanaTopology): Started clusternode2 (unmanaged) * Clone Set: SAPHana_RH2_02-clone [SAPHana_RH2_02] (promotable, unmanaged): * SAPHana_RH2_02 (ocf:heartbeat:SAPHana): Promoted clusternode1 (unmanaged) * SAPHana_RH2_02 (ocf:heartbeat:SAPHana): Unpromoted clusternode2 (unmanaged) * vip_RH2_02_MASTER (ocf:heartbeat:IPaddr2): Started clusternode1 (unmanaged)
すべてのリソースが "unmanaged" であることを確認します。
[root@clusternode1]# pcs status Cluster name: cluster1 Status of pacemakerd: 'Pacemaker is running' (last updated 2023-06-27 16:02:15 +02:00) Cluster Summary: * Stack: corosync * Current DC: clusternode2 (version 2.1.5-7.el9-a3f44794f94) - partition with quorum * Last updated: Tue Jun 27 16:02:16 2023 * Last change: Tue Jun 27 16:02:14 2023 by root via cibadmin on clusternode1 * 2 nodes configured * 6 resource instances configured *** Resource management is DISABLED *** The cluster will not attempt to start, stop or recover services Node List: * Online: [ clusternode1 clusternode2 ] Full List of Resources: * h7fence (stonith:fence_rhevm): Started clusternode2 (unmanaged) * Clone Set: SAPHanaTopology_RH2_02-clone [SAPHanaTopology_RH2_02] (unmanaged): * SAPHanaTopology_RH2_02 (ocf:heartbeat:SAPHanaTopology): Started clusternode1 (unmanaged) * SAPHanaTopology_RH2_02 (ocf:heartbeat:SAPHanaTopology): Started clusternode2 (unmanaged) * Clone Set: SAPHana_RH2_02-clone [SAPHana_RH2_02] (promotable, unmanaged): * SAPHana_RH2_02 (ocf:heartbeat:SAPHana): Promoted clusternode1 (unmanaged) * SAPHana_RH2_02 (ocf:heartbeat:SAPHana): Unpromoted clusternode2 (unmanaged) * vip_RH2_02_MASTER (ocf:heartbeat:IPaddr2): Started clusternode1 (unmanaged) Daemon Status: corosync: active/enabled pacemaker: active/enabled pcsd: active/enabled
maintenance-mode
の設定を解除すると、リソースは managed に戻ります。
# pcs property set maintenance-mode=false
6.2.9. move を使用した SAPHana リソースのフェイルオーバー
SAP HANA データベースをフェイルオーバーする簡単な例は、pcs resource move
コマンドを使用することです。以下に示すように、クローンリソース名を使用してリソースを移動する必要があります。
# pcs resource move <SAPHana-clone-resource>
この例では、クローンリソースは SAPHana_RH2_02-clone
です。
[root@clusternode1]# pcs resource * Clone Set: SAPHanaTopology_RH2_02-clone [SAPHanaTopology_RH2_02]: * Started: [ clusternode1 clusternode2 ] * Clone Set: SAPHana_RH2_02-clone [SAPHana_RH2_02] (promotable): * Promoted: [ clusternode1 ] * Unpromoted: [ clusternode2 ] * vip_RH2_02_MASTER (ocf:heartbeat:IPaddr2): Started clusternode1
リソースを移動します。
# pcs resource move SAPHana_RH2_02-clone Location constraint to move resource 'SAPHana_RH2_02-clone' has been created Waiting for the cluster to apply configuration changes... Location constraint created to move resource 'SAPHana_RH2_02-clone' has been removed Waiting for the cluster to apply configuration changes... resource 'SAPHana_RH2_02-clone' is promoted on node 'clusternode2'; unpromoted on node 'clusternode1'
制約が残っているかどうかを確認します。
# pcs constraint location
リソースをクリアすることで、フェイルオーバー中に作成された場所の制約を削除できます。以下に例を示します。
[root@clusternode1]# pcs resource clear SAPHana_RH2_02-clone
"Migration Summary" に警告やエントリーが残っているかどうかを確認します。
# pcs status --full
stonith
の履歴を確認します。
# pcs stonith history
必要に応じて、stonith の履歴をクリアします。
# pcs stonith history cleanup
Pacemaker バージョン 2.1.5 より前のバージョンを使用している場合は、Is there a way to manage constraints when running pcs resource move? を参照し、残っている制約を確認してください。
6.2.10. フェイルオーバーと同期状態の監視
すべての Pacemaker のアクティビティーは、クラスターノードの /var/log/messages
ファイルに記録されます。他にも多くのメッセージがあるため、SAP リソースエージェントに関連するメッセージを確認するのが難しい場合があります。SAP リソースエージェントに関連するメッセージのみをフィルターするコマンドエイリアスを設定できます。
エイリアスの例 tmsl
:
# alias tmsl='tail -1000f /var/log/messages | egrep -s "Setting master-rsc_SAPHana_${SAPSYSTEMNAME}_HDB${TINSTANCE}|sr_register|WAITING4LPA|PROMOTED|DEMOTED|UNDEFINED|master_walk|SWAIT|WaitforStopped|FAILED|LPT"'
tsml
の出力例:
[root@clusternode1]# tmsl Jun 22 13:59:54 clusternode1 SAPHana(SAPHana_RH2_02)[907482]: INFO: DEC: Finally get_SRHOOK()=SOK Jun 22 13:59:55 clusternode1 SAPHana(SAPHana_RH2_02)[907482]: INFO: DEC: secondary with sync status SOK ==> possible takeover node Jun 22 13:59:55 clusternode1 SAPHana(SAPHana_RH2_02)[907482]: INFO: DEC: hana_rh2_site_srHook_DC1=SWAIT Jun 22 13:59:55 clusternode1 SAPHana(SAPHana_RH2_02)[907482]: INFO: DEC: hana_rh2_site_srHook_DC1 is empty or SWAIT. Take polling attribute: hana_rh2_sync_state=SOK Jun 22 13:59:55 clusternode1 SAPHana(SAPHana_RH2_02)[907482]: INFO: DEC: Finally get_SRHOOK()=SOK Jun 22 13:59:55 clusternode1 SAPHana(SAPHana_RH2_02)[907482]: INFO: DEC: saphana_monitor_secondary: scoring_crm_master(4:S:master1:master:worker:master,SOK) Jun 22 13:59:55 clusternode1 SAPHana(SAPHana_RH2_02)[907482]: INFO: DEC: scoring_crm_master: sync(SOK) is matching syncPattern (SOK) Jun 22 14:04:06 clusternode1 SAPHana(SAPHana_RH2_02)[914625]: INFO: DEC: hana_rh2_site_srHook_DC1=SWAIT Jun 22 14:04:06 clusternode1 SAPHana(SAPHana_RH2_02)[914625]: INFO: DEC: hana_rh2_site_srHook_DC1 is empty or SWAIT. Take polling attribute: hana_rh2_sync_state=SOK Jun 22 14:04:06 clusternode1 SAPHana(SAPHana_RH2_02)[914625]: INFO: DEC: Finally get_SRHOOK()=SOK Jun 22 14:04:09 clusternode1 SAPHana(SAPHana_RH2_02)[914625]: INFO: DEC: hana_rh2_site_srHook_DC1=SWAIT Jun 22 14:04:09 clusternode1 SAPHana(SAPHana_RH2_02)[914625]: INFO: DEC: hana_rh2_site_srHook_DC1 is empty or SWAIT. Take polling attribute: hana_rh2_sync_state=SOK Jun 22 14:04:09 clusternode1 SAPHana(SAPHana_RH2_02)[914625]: INFO: DEC: Finally get_SRHOOK()=SOK Jun 22 14:04:09 clusternode1 SAPHana(SAPHana_RH2_02)[914625]: INFO: DEC: secondary with sync status SOK ==> possible takeover node Jun 22 14:04:09 clusternode1 SAPHana(SAPHana_RH2_02)[914625]: INFO: DEC: hana_rh2_site_srHook_DC1=SWAIT Jun 22 14:04:09 clusternode1 SAPHana(SAPHana_RH2_02)[914625]: INFO: DEC: hana_rh2_site_srHook_DC1 is empty or SWAIT. Take polling attribute: hana_rh2_sync_state=SOK Jun 22 14:04:09 clusternode1 SAPHana(SAPHana_RH2_02)[914625]: INFO: DEC: Finally get_SRHOOK()=SOK Jun 22 14:04:09 clusternode1 SAPHana(SAPHana_RH2_02)[914625]: INFO: DEC: saphana_monitor_secondary: scoring_crm_master(4:S:master1:master:worker:master,SOK) Jun 22 14:04:09 clusternode1 SAPHana(SAPHana_RH2_02)[914625]: INFO: DEC: scoring_crm_master: sync(SOK) is matching syncPattern (SOK) Jun 22 14:08:21 clusternode1 SAPHana(SAPHana_RH2_02)[922136]: INFO: DEC: hana_rh2_site_srHook_DC1=SWAIT Jun 22 14:08:21 clusternode1 SAPHana(SAPHana_RH2_02)[922136]: INFO: DEC: hana_rh2_site_srHook_DC1 is empty or SWAIT. Take polling attribute: hana_rh2_sync_state=SOK Jun 22 14:08:21 clusternode1 SAPHana(SAPHana_RH2_02)[922136]: INFO: DEC: Finally get_SRHOOK()=SOK Jun 22 14:08:23 clusternode1 SAPHana(SAPHana_RH2_02)[922136]: INFO: DEC: hana_rh2_site_srHook_DC1=SWAIT Jun 22 14:08:23 clusternode1 SAPHana(SAPHana_RH2_02)[922136]: INFO: DEC: hana_rh2_site_srHook_DC1 is empty or SWAIT. Take polling attribute: hana_rh2_sync_state=SOK Jun 22 14:08:23 clusternode1 SAPHana(SAPHana_RH2_02)[922136]: INFO: DEC: Finally get_SRHOOK()=SOK Jun 22 14:08:24 clusternode1 SAPHana(SAPHana_RH2_02)[922136]: INFO: DEC: secondary with sync status SOK ==> possible takeover node Jun 22 14:08:24 clusternode1 SAPHana(SAPHana_RH2_02)[922136]: INFO: DEC: hana_rh2_site_srHook_DC1=SWAIT Jun 22 14:08:24 clusternode1 SAPHana(SAPHana_RH2_02)[922136]: INFO: DEC: hana_rh2_site_srHook_DC1 is empty or SWAIT. Take polling attribute: hana_rh2_sync_state=SOK Jun 22 14:08:24 clusternode1 SAPHana(SAPHana_RH2_02)[922136]: INFO: DEC: Finally get_SRHOOK()=SOK Jun 22 14:08:24 clusternode1 SAPHana(SAPHana_RH2_02)[922136]: INFO: DEC: saphana_monitor_secondary: scoring_crm_master(4:S:master1:master:worker:master,SOK) Jun 22 14:08:24 clusternode1 SAPHana(SAPHana_RH2_02)[922136]: INFO: DEC: scoring_crm_master: sync(SOK) is matching syncPattern (SOK) Jun 22 14:12:35 clusternode1 SAPHana(SAPHana_RH2_02)[929408]: INFO: DEC: hana_rh2_site_srHook_DC1=SWAIT Jun 22 14:12:35 clusternode1 SAPHana(SAPHana_RH2_02)[929408]: INFO: DEC: hana_rh2_site_srHook_DC1 is empty or SWAIT. Take polling attribute: hana_rh2_sync_state=SOK Jun 22 14:12:36 clusternode1 SAPHana(SAPHana_RH2_02)[929408]: INFO: DEC: Finally get_SRHOOK()=SOK Jun 22 14:12:38 clusternode1 SAPHana(SAPHana_RH2_02)[929408]: INFO: DEC: hana_rh2_site_srHook_DC1=SWAIT Jun 22 14:12:38 clusternode1 SAPHana(SAPHana_RH2_02)[929408]: INFO: DEC: hana_rh2_site_srHook_DC1 is empty or SWAIT. Take polling attribute: hana_rh2_sync_state=SOK Jun 22 14:12:38 clusternode1 SAPHana(SAPHana_RH2_02)[929408]: INFO: DEC: Finally get_SRHOOK()=SOK Jun 22 14:12:38 clusternode1 SAPHana(SAPHana_RH2_02)[929408]: INFO: DEC: secondary with sync status SOK ==> possible takeover node Jun 22 14:12:39 clusternode1 SAPHana(SAPHana_RH2_02)[929408]: INFO: DEC: hana_rh2_site_srHook_DC1=SWAIT Jun 22 14:12:39 clusternode1 SAPHana(SAPHana_RH2_02)[929408]: INFO: DEC: hana_rh2_site_srHook_DC1 is empty or SWAIT. Take polling attribute: hana_rh2_sync_state=SOK Jun 22 14:12:39 clusternode1 SAPHana(SAPHana_RH2_02)[929408]: INFO: DEC: Finally get_SRHOOK()=SOK Jun 22 14:12:39 clusternode1 SAPHana(SAPHana_RH2_02)[929408]: INFO: DEC: saphana_monitor_secondary: scoring_crm_master(4:S:master1:master:worker:master,SOK) Jun 22 14:12:39 clusternode1 SAPHana(SAPHana_RH2_02)[929408]: INFO: DEC: scoring_crm_master: sync(SOK) is matching syncPattern (SOK) Jun 22 14:14:01 clusternode1 pacemaker-attrd[10150]: notice: Setting hana_rh2_clone_state[clusternode2]: PROMOTED -> DEMOTED Jun 22 14:14:02 clusternode1 pacemaker-attrd[10150]: notice: Setting hana_rh2_clone_state[clusternode2]: DEMOTED -> UNDEFINED Jun 22 14:14:19 clusternode1 pacemaker-attrd[10150]: notice: Setting hana_rh2_clone_state[clusternode1]: DEMOTED -> PROMOTED Jun 22 14:14:21 clusternode1 SAPHana(SAPHana_RH2_02)[932762]: INFO: DEC: hana_rh2_site_srHook_DC1=SWAIT Jun 22 14:14:21 clusternode1 SAPHana(SAPHana_RH2_02)[932762]: INFO: DEC: hana_rh2_site_srHook_DC1 is empty or SWAIT. Take polling attribute: hana_rh2_sync_state=SOK Jun 22 14:14:21 clusternode1 SAPHana(SAPHana_RH2_02)[932762]: INFO: DEC: Finally get_SRHOOK()=SOK Jun 22 14:15:14 clusternode1 SAPHana(SAPHana_RH2_02)[932762]: INFO: DEC: hana_rh2_site_srHook_DC1=SWAIT Jun 22 14:15:22 clusternode1 pacemaker-attrd[10150]: notice: Setting hana_rh2_sync_state[clusternode1]: SOK -> PRIM Jun 22 14:15:23 clusternode1 pacemaker-attrd[10150]: notice: Setting hana_rh2_sync_state[clusternode2]: PRIM -> SOK Jun 22 14:15:23 clusternode1 SAPHana(SAPHana_RH2_02)[934810]: INFO: ACT site=DC1, setting SOK for secondary (1) Jun 22 14:15:25 clusternode1 pacemaker-attrd[10150]: notice: Setting hana_rh2_clone_state[clusternode2]: UNDEFINED -> DEMOTED Jun 22 14:15:32 clusternode1 pacemaker-attrd[10150]: notice: Setting hana_rh2_sync_state[clusternode2]: SOK -> SFAIL Jun 22 14:19:36 clusternode1 pacemaker-attrd[10150]: notice: Setting hana_rh2_sync_state[clusternode2]: SFAIL -> SOK Jun 22 14:19:36 clusternode1 SAPHana(SAPHana_RH2_02)[942693]: INFO: ACT site=DC1, setting SOK for secondary (1) Jun 22 14:23:49 clusternode1 SAPHana(SAPHana_RH2_02)[950623]: INFO: ACT site=DC1, setting SOK for secondary (1) Jun 22 14:28:02 clusternode1 SAPHana(SAPHana_RH2_02)[958633]: INFO: ACT site=DC1, setting SOK for secondary (1) Jun 22 14:32:15 clusternode1 SAPHana(SAPHana_RH2_02)[966683]: INFO: ACT site=DC1, setting SOK for secondary (1) Jun 22 14:36:27 clusternode1 SAPHana(SAPHana_RH2_02)[974736]: INFO: ACT site=DC1, setting SOK for secondary (1) Jun 22 14:40:40 clusternode1 SAPHana(SAPHana_RH2_02)[982934]: INFO: ACT site=DC1, setting SOK for secondary (1)
フィルターを使用すると、どのようなステータス変化が発生しているかを理解しやすくなります。詳細がない場合は、メッセージファイル全体を開くと、すべての情報を確認できます。
フェイルオーバー後、リソースをクリアできます。場所の制約が残っていないことも確認してください。
6.2.11. クラスターの整合性の確認
インストール中、設定が最終的に完了する前にリソースが起動することがあります。これにより、Cluster Information Base (CIB) のエントリーが発生し、誤った動作が発生する可能性があります。これは簡単に確認でき、設定の完了後に手動で修正することもできます。
SAPHana リソースを起動すると、欠落しているエントリーが再作成されます。間違ったエントリーには pcs コマンドでは対処できないため、手動で削除する必要があります。
CIB エントリーを確認します。
# cibadmin --query
クラスターメンバーが DC1 と DC2 であり、ノード間の同期状態が SOK と報告される場合、DC3 と SFAIL のエントリーはクラスター情報ベースに存在しないはずです。
対応するエントリーを確認する例:
# cibadmin --query |grep '"DC3"' # cibadmin --query |grep '"SFAIL"'
このコマンドは、クラスター内の任意のノードで root ユーザーとして実行できます。通常、コマンドの出力は空です。設定にまだエラーがある場合、出力は次のようになります。
<nvpair id="SAPHanaSR-hana_rh1_glob_sec" name="hana_rh1_glob_sec" value="DC3"/>
これらのエントリーは、次のコマンドを使用して削除できます。
# cibadmin --delete --xml-text '<...>'
上の例のエントリーを削除するには、次のように入力する必要があります。出力には二重引用符が含まれるため、テキストを一重引用符で囲む必要があることに注意してください。
# cibadmin --delete --xml-text ' <nvpair id="SAPHanaSR-hana_rh1_glob_sec" name="hana_rh1_glob_sec" value="DC3"/>'
削除された CIB エントリーがないことを確認します。返される出力は空である必要があります。
# cibadmin --query |grep 'DC3"'
6.2.12. クラスターのクリーンアップ
フェイルオーバーテスト中に、以前のテストの制約やその他の残留物が残ることがあります。次のテストを開始する前に、クラスターからこれらをクリアする必要があります。
クラスターのステータスで障害イベントがないか確認します。
# pcs status --full
"Migration Summary" にクラスターの警告またはエントリーが表示された場合は、リソースをクリアしてクリーンアップする必要があります。
# pcs resource clear SAPHana_RH2_02-clone # pcs resource cleanup SAPHana_RH2_02-clone
出力:
Cleaned up SAPHana_RH2_02:0 on clusternode1 Cleaned up SAPHana_RH2_02:1 on clusternode2
以前のフェイルオーバーなどで使用された不要な場所の制約があるかどうかを確認します。
# pcs constraint location
既存の制約をさらに詳しく確認します。
# pcs constraint --full
リソース移動後の場所の制約の例:
Node: hana08 (score:-INFINITY) (role:Started) (id:cli-ban-SAPHana_RH2_02-clone-on-hana08)
この場所の制約をクリアします。
# pcs resource clear SAPHana_RH2_02-clone
制約が制約リストから消えていることを確認します。まだ残っている場合は、制約 ID を使用して明示的に削除します。
# pcs constraint delete cli-ban-SAPHana_RH2_02-clone-on-hana08
フェンシングを使用して複数のテストを実行する場合は、stonith
の履歴をクリアすることもできます。
# pcs stonith history cleanup
pcs コマンドはすべて root ユーザーとして実行します。残留物の検出 も参照してください。
6.2.13. その他のクラスターコマンド
さまざまなクラスターコマンドの例
# pcs status --full # crm_mon -1Arf # Provides an overview # pcs resource # Lists all resources and shows if they are running # pcs constraint --full # Lists all constraint ids which should be removed # pcs cluster start --all # This will start the cluster on all nodes # pcs cluster stop --all # This will stop the cluster on all nodes # pcs node attribute # Lists node attributes