第5章 Pacemaker クラスターの設定
5.1. 基本的なクラスター設定のデプロイ リンクのコピーリンクがクリップボードにコピーされました!
次の基本的なクラスターセットアップでは、SAP HANA システムレプリケーションを管理するための Pacemaker クラスターセットアップを開始するための最小限の手順を説明します。
複雑な構成の設定とオプションの詳細は、複数のリンクを持つ高可用性クラスターを作成する など、RHEL HA Add-On のドキュメントを参照してください。
前提条件
- HANA システムレプリケーション環境をセットアップし、正しく動作していることを確認している。
- このクラスターのノードとなるすべてのシステムで RHEL High Availability リポジトリーを設定している。
- 計画した環境に応じて、フェンシングとクォーラムの要件を確認している。詳細は、HA クラスターの要件 を参照してください。
手順
High Availability リポジトリーから Red Hat High Availability Add-On ソフトウェアパッケージをインストールします。インストールするフェンスエージェントを選択し、すべてのクラスターノードでインストールを実行します。
以下のように、クラスターパッケージとすべてのフェンスエージェントをインストールします。あるいは、
[root]# dnf install pcs pacemaker fence-agents-all以下のように、環境に応じてクラスターパッケージと特定のフェンスエージェントのみをインストールします。
[root]# dnf install pcs pacemaker fence-agents-<model>
すべてのクラスターノードで
pcsdサービスを起動して有効にします。[root]# systemctl enable --now pcsd.serviceオプション:
firewalldサービスを実行している場合は、Red Hat High Availability Add-On に必要なポートを有効にします。すべてのクラスターノードでこれを実行します。[root]# firewall-cmd --add-service=high-availability [root]# firewall-cmd --runtime-to-permanentユーザー
haclusterのパスワードを設定します。同じパスワードを使用して各ノードでコマンドを繰り返します。[root]# passwd haclusterクラスター内の各ノードに対してユーザー
haclusterを認証します。最初のノードでこれを実行します。[root]# pcs host auth <node1> <node2> Username: hacluster Password: <node1>: Authorized <node2>: Authorized-
/etc/hostsファイルで定義されているように、FQDN の有無にかかわらずノード名を入力します。 -
プロンプトに
haclusterユーザーのパスワードを入力します。
-
名前を指定してクラスターを作成し、クラスターメンバーの名前 (例:
node1およびnode2) を完全修飾ホスト名で指定します。これにより、両方のノードにクラスター設定が伝播され、クラスターが起動します。最初のノードでこのコマンドを実行します。[root]# pcs cluster setup <cluster_name> --start <node1> <node2> No addresses specified for host 'node1', using 'node1' No addresses specified for host 'node2', using 'node2' Destroying cluster on hosts: 'node1', 'node2'... node2: Successfully destroyed cluster node1: Successfully destroyed cluster Requesting remove 'pcsd settings' from 'node1', 'node2' node1: successful removal of the file 'pcsd settings' node2: successful removal of the file 'pcsd settings' Sending 'corosync authkey', 'pacemaker authkey' to 'node1', 'node2' node1: successful distribution of the file 'corosync authkey' node1: successful distribution of the file 'pacemaker authkey' node2: successful distribution of the file 'corosync authkey' node2: successful distribution of the file 'pacemaker authkey' Sending 'corosync.conf' to 'node1', 'node2' node1: successful distribution of the file 'corosync.conf' node2: successful distribution of the file 'corosync.conf' Cluster has been successfully set up. Starting cluster on hosts: 'node1', 'node2'...システムの起動時にクラスターが自動的に起動されるようにします。これにより、
corosyncおよびpacemakerサービスが有効になります。ノードの再起動後にクラスターの起動を手動で制御する場合は、このステップをスキップしてください。1 つのノードで実行:[root]# pcs cluster enable --all node1: Cluster Enabled node2: Cluster Enabled
検証
クラスターのステータスを確認します。クラスターデーモンサービスが目的の状態にあることを確認します。
[root]# pcs status --full Cluster name: node1-node2-cluster WARNINGS: No stonith devices and stonith-enabled is not false Cluster Status: Cluster Summary: * Stack: corosync (Pacemaker is running) * Current DC: node1 (version ) - partition with quorum * Last updated: * on node1 * Last change: ** by hacluster via hacluster on node1 * 2 nodes configured * 0 resource instances configured ... PCSD Status: node1: Online node2: Online Daemon Status: corosync: active/enabled pacemaker: active/enabled pcsd: active/enabled
次のステップ
- STONITH メカニズムを有効にするためにフェンシングメソッドを設定します。Red Hat High Availability クラスターでのフェンシングの設定 を参照してください。
- クラスターのさらなる設定に進む前に、フェンシングセットアップをテストします。詳細は、How to test fence devices and fencing configuration in a Red Hat High Availability cluster? を参照してください。