差分
このページの2つのバージョン間の差分を表示します。
| 両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン | ||
| ja:documentation:pandorafms:complex_environments_and_optimization:06_ha [2025/08/16 07:37] – [pandora_server 設定] junichi | ja:documentation:pandorafms:complex_environments_and_optimization:06_ha [2026/06/19 23:35] (現在) – [冗長化構成(HA)] junichi | ||
|---|---|---|---|
| 行 3: | 行 3: | ||
| {{indexmenu_n> | {{indexmenu_n> | ||
| - | [[ja: | + | [[ja: |
| - | + | ||
| ===== 概要 ===== | ===== 概要 ===== | ||
| 行 129: | 行 127: | ||
| ===== ネットワーク、WMI、プラグイン、ウェブ、予測サーバのバランシングと HA ===== | ===== ネットワーク、WMI、プラグイン、ウェブ、予測サーバのバランシングと HA ===== | ||
| - | You need to install [[: | + | You need to install [[: |
| - | [[: | + | [[: |
| それぞれのサーバはプライマリとして選択できます。それぞれのサーバは、他方がダウンした場合、そのサーバに割り当てられていた全てのモジュールデータの収集を自動的に引き継ぎます。Pandora FMS サーバには、最終接続時間 (サーバの threshold x 2) を確認して、他のサーバがダウンしていることを検知する仕組が実装されています。Pandora FMS サーバが 1台でも稼働していれば、他のサーバのダウンを検出することができます。すべての Pandora FMS サーバがダウンした場合は、検出する手段はありません。 | それぞれのサーバはプライマリとして選択できます。それぞれのサーバは、他方がダウンした場合、そのサーバに割り当てられていた全てのモジュールデータの収集を自動的に引き継ぎます。Pandora FMS サーバには、最終接続時間 (サーバの threshold x 2) を確認して、他のサーバがダウンしていることを検知する仕組が実装されています。Pandora FMS サーバが 1台でも稼働していれば、他のサーバのダウンを検出することができます。すべての Pandora FMS サーバがダウンした場合は、検出する手段はありません。 | ||
| 行 445: | 行 443: | ||
| ==== バイナリレプリケーション設定 ==== | ==== バイナリレプリケーション設定 ==== | ||
| - | <WRAP center round info 60%> | + | <wrap #ks6_2_1 /> |
| - | It is recommended | + | === 要件 === |
| + | |||
| + | <wrap #ks6_2_1_1 /> | ||
| + | |||
| + | == ユーザー権限 == | ||
| + | |||
| + | The user that must perform the steps in this guide on both HA nodes is the **system root** user, so always check that the corresponding privilege escalation has been performed. | ||
| + | |||
| + | このガイドの手順を両方の HA ノードで実行する必要があるユーザは**システム root**ユーザであるため、対応する権限昇格が実行されていることを必ず確認してください。 | ||
| + | |||
| + | <wrap # | ||
| + | |||
| + | == 接続性 == | ||
| + | |||
| + | Between the nodes that will form the HA, there must be connectivity via SSH (port number '' | ||
| + | |||
| + | HA を構成するノード間には、SSH(ポート番号 '' | ||
| + | |||
| + | Likewise, it is recommended to use descriptive hostnames and DNS resolution between | ||
| + | |||
| + | 同様に、マシン間では分かりやすいホスト名と DNS 解決を使用することが推奨されます。 | ||
| + | |||
| + | <wrap #ks6_2_1_3 /> | ||
| + | |||
| + | == 共有ディレクトリ == | ||
| + | |||
| + | If you want to use two data servers and have both handle policies, collections, | ||
| + | |||
| + | 2台のデータサーバを使用し、両方でポリシー、コレクション、リモート設定を処理する場合は、すべてのデータサーバインスタンスがこれらのディレクトリを読み書きできるように、キーディレクトリを共有する必要があります。コンソールもこれらの共有ディレクトリにアクセスできる必要があります。たとえば、NFS 経由で共有する場合: | ||
| + | |||
| + | < | ||
| + | /var/spool/pandora/data_in/ | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | </ | ||
| + | |||
| + | <wrap #ks6_2_2 /> | ||
| + | |||
| + | === SSH 信頼構成 | ||
| + | |||
| + | <wrap #ks6_2_2_1 /> | ||
| + | |||
| + | == 両方のノードにて == | ||
| + | |||
| + | MOTD and Banners cleanup. | ||
| + | |||
| + | MOTD およびバナーのクリーンアップ。 | ||
| + | |||
| + | **On Rocky Linux 9**: | ||
| + | |||
| + | **Rocky Linux 9 の場合**: | ||
| + | |||
| + | <code bash> | ||
| + | [ -f / | ||
| + | cp -a / | ||
| + | sed -i -e 's/ | ||
| + | sed -i 's/ | ||
| + | systemctl restart sshd | ||
| + | </ | ||
| + | |||
| + | **On Ubuntu 22.04**: | ||
| + | |||
| + | **Ubuntu 22.04 の場合**: | ||
| + | |||
| + | <code bash> | ||
| + | cp -a / | ||
| + | sed -i 's/ | ||
| + | chmod -x /etc/update-motd.d/* | ||
| + | systemctl restart sshd | ||
| + | </ | ||
| + | |||
| + | a) RSA key generation without // | ||
| + | |||
| + | a) パスフレーズなしの RSA 鍵生成: | ||
| + | |||
| + | <code bash> | ||
| + | printf " | ||
| + | </ | ||
| + | |||
| + | b) Identity copy (Bidirectional and Reflexive): | ||
| + | |||
| + | b) アイデンティティコピー(双方向): | ||
| + | |||
| + | <code bash> | ||
| + | ssh-copy-id -p22 root@pandoraha1 | ||
| + | ssh-copy-id -p22 root@pandoraha2 | ||
| + | </ | ||
| + | |||
| + | c) Check that it does not ask for a //pass// on the SSH connection (Bidirectional and Reflexive): | ||
| + | |||
| + | c) SSH接続(双方向)で// | ||
| + | |||
| + | <code bash> | ||
| + | ssh pandoraha1 | ||
| + | ssh pandoraha2 | ||
| + | </ | ||
| + | |||
| + | <wrap #ks6_2_3 /> | ||
| + | |||
| + | === DB レプリケーション === | ||
| + | |||
| + | <wrap #ks6_2_3_1 /> | ||
| + | |||
| + | == ユーザ作成 == | ||
| + | |||
| + | <WRAP center round warning 90%> | ||
| + | |||
| + | IMPORTANT: This step is performed only on the MASTER node and before modifying the '' | ||
| </ | </ | ||
| - | <WRAP center round info 60%> | + | <WRAP center round warning 90%> |
| - | レプリケーションによって生成された //binlogs// を追加のパーティションまたは外部ディスクに保存することをお勧めします。そのサイズはデータベース用に予約されているサイズと同じである必要があります。 | + | 重要:この手順はマスターノードでのみ実行し、'' |
| </ | </ | ||
| - | Once you have installed | + | Access the MySQL console: |
| + | |||
| + | MySQL コンソールにアクセスします。 | ||
| + | |||
| + | <code bash> | ||
| + | mysql -u root -p pandora | ||
| + | # Password by default: Pandor4! | ||
| + | </ | ||
| + | |||
| + | Run the following SQL queries: | ||
| + | |||
| + | 以下の SQL クエリを実行します。 | ||
| + | |||
| + | <code sql> | ||
| + | UNINSTALL COMPONENT ' | ||
| + | CREATE USER replicationuser@' | ||
| + | GRANT REPLICATION CLIENT, REPLICATION SLAVE on *.* to replicationuser@' | ||
| + | CREATE USER root@' | ||
| + | GRANT ALL PRIVILEGES ON *.* to root@' | ||
| + | CREATE USER pandora@' | ||
| + | GRANT ALL PRIVILEGES ON pandora.* to pandora@' | ||
| + | FLUSH PRIVILEGES; | ||
| + | EXIT; | ||
| + | </ | ||
| + | |||
| + | <wrap #ks6_2_3_2 /> | ||
| + | |||
| + | == /etc/my.cnf の設定 == | ||
| + | |||
| + | **Binary replication configuration** | ||
| + | |||
| + | **バイナリレプリケーション設定** | ||
| + | |||
| + | <WRAP center round info 90%> | ||
| + | |||
| + | **It is recommended** to store the //binlogs// generated by the replication in an additional partition or external disk; its size should be the same as the one reserved for the database. See also the '' | ||
| + | |||
| + | </ | ||
| + | |||
| + | <WRAP center round info 90%> | ||
| + | |||
| + | レプリケーションによって生成された //binlogs// は、追加のパーティションまたは外部ディスクに保存することをお勧めします。そのサイズは、データベース用に予約されているサイズと同じである必要があります。'' | ||
| + | |||
| + | </ | ||
| + | |||
| + | Once the MySQL server | ||
| + | |||
| + | クラスター内のすべてのノードに MySQL サーバがインストールされたら、両方の環境で設定を行い、それらが複製されるようにします。 | ||
| - | すべてのクラスタノードに MySQL サーバをインストールしたら、両方の環境をレプリケートするように設定します。 | + | First of all, you must configure the '' |
| - | First of all, configure the configuration file '' | + | まず最初に、'' |
| - | まず、設定ファイル '' | + | **Node 1** |
| - | === ノード 1 === | + | **ノード 1** |
| - | Node 1 ''/ | + | Node 1 ''/ |
| - | ノード 1 ''/ | + | ノード 1 ''/ |
| < | < | ||
| 行 497: | 行 652: | ||
| replicate-do-db=pandora | replicate-do-db=pandora | ||
| max_binlog_size = 100M | max_binlog_size = 100M | ||
| - | binlog-format=MIXED | + | binlog-format=ROW |
| binlog_expire_logs_seconds=172800 # 2 DAYS | binlog_expire_logs_seconds=172800 # 2 DAYS | ||
| + | # | ||
| + | # | ||
| sync_source_info=1 | sync_source_info=1 | ||
| sync_binlog=1 | sync_binlog=1 | ||
| 行 520: | 行 677: | ||
| </ | </ | ||
| - | * The tokens | + | * The //tokens// following |
| - | * After the comment | + | * After the **SPECIFIC PARAMETERS FOR BINARY REPLICATION** |
| - | * The token called '' | + | * The //token// called '' |
| - | * In the '' | + | * In the '' |
| - | * **OPTIMIZATION FOR PANDORA FMS** というコメントの後の設定は、Pandora FMS 用に最適化された設定です。 | + | * **OPTIMIZATION FOR PANDORA FMS** コメントに続く // |
| - | * コメント | + | * **SPECIFIC PARAMETERS FOR BINARY REPLICATION** |
| - | * '' | + | * '' |
| - | * '' | + | * '' |
| - | <WRAP center round important | + | <WRAP center round important |
| - | It is important that the '' | + | It is important that the '' |
| </ | </ | ||
| - | <WRAP center round important | + | <WRAP center round important |
| - | '' | + | すべてのノードで |
| </ | </ | ||
| - | === ノード | + | **Node |
| - | Node 2 ''/ | + | **ノード |
| - | ノード 2 ''/ | + | Node 2 ''/ |
| + | |||
| + | ノード 2 ''/ | ||
| < | < | ||
| 行 574: | 行 733: | ||
| replicate-do-db=pandora | replicate-do-db=pandora | ||
| max_binlog_size = 100M | max_binlog_size = 100M | ||
| - | binlog-format=MIXED | + | binlog-format=ROW |
| binlog_expire_logs_seconds=172800 # 2 DAYS | binlog_expire_logs_seconds=172800 # 2 DAYS | ||
| + | # | ||
| + | # | ||
| sync_source_info=1 | sync_source_info=1 | ||
| sync_binlog=1 | sync_binlog=1 | ||
| 行 597: | 行 758: | ||
| </ | </ | ||
| - | * The tokens | + | * The //tokens// following |
| - | * After the comment | + | * After the **SPECIFIC PARAMETERS FOR BINARY REPLICATION** |
| - | * The token called '' | + | * The //token// called '' |
| - | * In the '' | + | * In the '' |
| - | * **OPTIMIZATION FOR PANDORA FMS** というコメントの後の設定は、Pandora FMS 用に最適化された設定です。 | + | * **OPTIMIZATION FOR PANDORA FMS** コメントに続く // |
| - | * コメント | + | * **SPECIFIC PARAMETERS FOR BINARY REPLICATION** |
| - | * '' | + | * '' |
| - | * '' | + | * '' |
| - | + | ||
| - | <WRAP center round important 75%> | + | |
| - | It is important that the '' | + | <WRAP center round important 90%> |
| + | |||
| + | It is important that the '' | ||
| </ | </ | ||
| - | <WRAP center round important | + | <WRAP center round important |
| - | '' | + | すべてのノードで |
| </ | </ | ||
| - | === マスターノード設定 === | + | It is necessary to restart MySQL for the changes to take effect: |
| - | Once you have the correct configuration on both nodes, start the configuration of the node //that will take the role of master server//. | + | 変更を有効にするには、MySQL を再起動する必要があります。 |
| - | 両方のノードで正しい設定ができたら、// | + | Run on both nodes |
| - | **1.-** Start the '' | + | 両方のノードで実行 |
| - | **1.-** '' | + | **On Rocky Linux 9**: |
| + | |||
| + | **Rocky Linux 9 の場合**: | ||
| <code bash> | <code bash> | ||
| - | systemctl | + | systemctl |
| - | + | ||
| </ | </ | ||
| - | **2.-** Access with the temporary **root** password that will have been generated in the log, the file ''/ | ||
| - | **2.-** ログファイル ''/ | + | **On Ubuntu Server 22.04**: |
| - | <code bash> | + | **Ubuntu Server 22.04 の場合**: |
| - | grep " | + | |
| - | + | ||
| - | + | ||
| - | </ | + | |
| - | + | ||
| - | With the password that appears, access MySQL server: | + | |
| - | + | ||
| - | 見つけたパスワードで、MySQL サーバへアクセスします: | + | |
| <code bash> | <code bash> | ||
| - | mysql -u root -p | + | systemctl restart |
| - | + | ||
| </ | </ | ||
| - | '' | + | <wrap #ks6_2_3_3 /> |
| - | '' | + | == DB の複製 == |
| - | **3.-** Change the temporary password to '' | + | Database cloning: The next step consists |
| - | **3.-** **root** ユーザのテンポラリパスワードを '' | + | データベースの複製作成:次のステップは、マスターデータベース(**MASTER**)をスレーブノード(**SLAVE**)に複製することです。これを行うには、次の手順に従ってください。 |
| - | <WRAP center round info 90%> | + | **1.-** Perform a full download (//dump//) of the **MASTER** database: |
| - | In the following instructions the authentication method '' | + | **1.-** **MASTER** データベースの完全ダウンロード(// |
| - | </ | + | **MASTER** # |
| - | <WRAP center round info 90%> | + | <file> |
| + | xtrabackup --backup --target-dir=/ | ||
| - | 以下の手順では、認証方法 '' | + | </ |
| - | </ | + | **MASTER** # |
| - | **mysql | + | <file> |
| + | xtrabackup --prepare --target-dir=/ | ||
| - | **mysql | + | </file> |
| - | **mysql >** '' | + | **2.-** Get the position of the binary //log// from the backup: |
| - | **mysql >** '' | + | **2.-** バックアップからバイナリ //log// の位置を取得します。 |
| - | **4.-** Create the binary replication user and **root** user for remote connections and cluster administration: | + | **MASTER** # '' |
| - | **4.-** バイナリレプリケーションユーザおよび、リモート接続とクラスタ管理のための **root** ユーザを作成します: | + | It will return something like the following: |
| - | **mysql >** '' | + | 以下のような結果が返されます。 |
| - | **mysql | + | <file> |
| + | binlog.000003 157 | ||
| + | </ | ||
| - | **mysql >** '' | + | //Take note of these two values as they are required for step number 6.// |
| - | **mysql >** '' | + | // |
| - | **5.-** Create Pandora FMS database: | + | Stop MySQL service on the Slave Server: |
| - | **5.-** Pandora FMS データベースを作成します: | + | スレーブサーバ上の MySQL サービスを停止します。 |
| - | **mysql >** '' | + | **On Rocky Linux 9**: |
| - | **mysql >** '' | + | **Rocky Linux 9 の場合**: |
| - | **mysql | + | <code bash> |
| + | systemctl stop mysqld | ||
| + | </code> | ||
| - | **mysql >** '' | ||
| - | <WRAP center round info 60%> | + | **On Ubuntu Server 22.04**: |
| - | For the **source** command: As long as Pandora FMS console is installed in the same server, //otherwise send this file to the master server//. | + | **Ubuntu Server 22.04 の場合**: |
| - | </WRAP> | + | <code bash> |
| + | systemctl stop mysql | ||
| + | </code> | ||
| - | <WRAP center round info 60%> | + | Delete ALL content (Delete default DB): |
| - | **source** | + | すべてのコンテンツを削除(デフォルトDBを削除): |
| - | </WRAP> | + | <code bash> |
| + | rm -rf /var/ | ||
| + | </code> | ||
| - | 6.- Create the pandora user and give the access privileges to this user: | + | To avoid problems, we will also stop the '' |
| - | **6.-** pandora ユーザを作成し、このユーザにアクセス権限を与えます: | + | 問題を回避するため、両方のノードで '' |
| - | **mysql | + | <code bash> |
| + | systemctl stop pandora_ha | ||
| + | </code> | ||
| - | **mysql >** '' | + | **3.-** Make a copy using **rsync** with the **SLAVE** server |
| - | <WRAP center round box 75%> | + | **3.-** **rsync** を使用して **SLAVE** サーバにバックアップを送信するためのコピーを作成します。 |
| - | At this point you have the master server ready to start replicating Pandora FMS database. | + | **MASTER** # '' |
| - | </ | + | **4.-** On the **SLAVE** server, configure the permissions so that the MySQL server can seamlessly |
| - | + | ||
| - | <WRAP center round box 75%> | + | |
| - | + | ||
| - | これで、Pandora FMS データベースのレプリケーションを開始するためのマスターサーバの準備が完了です。 | + | |
| - | + | ||
| - | </ | + | |
| - | + | ||
| - | === データベースの複製 === | + | |
| - | + | ||
| - | The next step is to make a clone of the master database (**MASTER**) in the slave node (**SLAVE**). To do so, follow the steps below: | + | |
| - | + | ||
| - | 次のステップは、スレーブノード (**SLAVE**) でマスターデータベース (**MASTER**) の複製を作成することです。これを行うには次の手順に従います。 | + | |
| - | + | ||
| - | **1.-** Make a complete download (dump) of the **MASTER** database: | + | |
| - | + | ||
| - | **1.-** **MASTER** データベースの完全な複製(dump)を作成します: | + | |
| - | + | ||
| - | **MASTER** # '' | + | |
| - | + | ||
| - | **MASTER** # '' | + | |
| - | + | ||
| - | **2.-** Get the position of the backup binary log: | + | |
| - | + | ||
| - | **2.-** バックアップバイナリログのポジションを取得します: | + | |
| - | + | ||
| - | **MASTER** # '' | + | |
| - | + | ||
| - | It will return something like the following: | + | |
| - | + | ||
| - | 次のような出力があります: | + | |
| - | + | ||
| - | < | + | |
| - | binlog.000003 157 | + | |
| - | + | ||
| - | </ | + | |
| - | + | ||
| - | //Take note of these two values as they are needed for point number 6.// | + | |
| - | + | ||
| - | //6 番目の手順で必要となるため、この 2つの値をメモしておきます。// | + | |
| - | + | ||
| - | **3.-** Make a copy using rsync with the **SLAVE** server to send the backup: | + | |
| - | + | ||
| - | **3.-** rsync を使って **SLAVE** サーバにバックアップのコピーを送ります: | + | |
| - | + | ||
| - | **MASTER** # '' | + | |
| - | + | ||
| - | **4.-** On the **SLAVE** server, configure the permissions so that the MySQL server can access the files sent without any problem: | + | |
| - | **4.-** | + | **4.-** |
| **SLAVE** # '' | **SLAVE** # '' | ||
| 行 788: | 行 902: | ||
| **5.-** Start the '' | **5.-** Start the '' | ||
| - | **5.-** | + | **5.-** |
| - | < | + | < |
| systemctl start mysqld | systemctl start mysqld | ||
| - | |||
| </ | </ | ||
| - | **6.-** Start the SLAVE mode on this server (use the data noted in point 2): | + | **6.-** Start the SLAVE mode on this server (use the data noted down in step 2): |
| - | **6.-** このサーバで | + | **6.-** このサーバでスレーブモードを開始します(手順2でメモしたデータを使用します)。 |
| **SLAVE** # '' | **SLAVE** # '' | ||
| 行 804: | 行 917: | ||
| **SLAVE** # **mysql >** | **SLAVE** # **mysql >** | ||
| + | |||
| < | < | ||
| - | CHANGE MASTER TO MASTER_HOST=' | + | CHANGE MASTER TO MASTER_HOST=' |
| - | | + | |
| | | ||
| | | ||
| | | ||
| - | |||
| </ | </ | ||
| 行 817: | 行 930: | ||
| **SLAVE** # **mysql >** '' | **SLAVE** # **mysql >** '' | ||
| - | Once you are done with all these steps, if you run the '' | + | Once you have finished |
| - | これらのすべての手順が完了したら、MySQL シェル内で '' | + | これらの手順をすべて完了したら、MySQL シェル内で '' |
| < | < | ||
| *************************** 1. row *************************** | *************************** 1. row *************************** | ||
| Slave_IO_State: | Slave_IO_State: | ||
| - | Master_Host: | + | Master_Host: |
| Master_User: | Master_User: | ||
| Master_Port: | Master_Port: | ||
| 行 888: | 行 1001: | ||
| </ | </ | ||
| - | At this point you can be sure that you have binary replication enabled and working correctly. | + | If MySQL 8.4 is used, the commands change slightly: |
| - | この時点で、バイナリレプリケーションが有効になり、正しく動作していることを確認できます。 | + | MySQL 8.4 の場合、コマンドは若干異なります。 |
| - | ==== pandora_server 設定 ==== | + | <code bash> |
| + | sudo mysql -u root | ||
| + | </ | ||
| - | <WRAP center round info 60%> | + | <code sql> |
| + | CHANGE REPLICATION SOURCE TO | ||
| + | SOURCE_HOST=' | ||
| + | SOURCE_USER=' | ||
| + | SOURCE_PASSWORD=' | ||
| + | SOURCE_LOG_FILE=' | ||
| + | SOURCE_LOG_POS=157 -- Update to the values retrieved on previous step | ||
| + | ; | ||
| + | </ | ||
| + | |||
| + | We start the replica and verify that everything is correct: | ||
| + | |||
| + | レプリカを起動し、すべてが正しいことを確認します。 | ||
| + | |||
| + | <code mysql> | ||
| + | STOP REPLICA; | ||
| + | |||
| + | START REPLICA; | ||
| + | SHOW REPLICA STATUS\G | ||
| + | </ | ||
| + | |||
| + | We verify that the replica is correct by running the '' | ||
| + | |||
| + | '' | ||
| + | |||
| + | < | ||
| + | Replica_IO_Running: | ||
| + | Replica_SQL_Running: | ||
| + | </ | ||
| + | |||
| + | Both must be set to '' | ||
| + | |||
| + | 両方とも '' | ||
| + | |||
| + | From this moment on, you could assume that binary replication is enabled and running correctly. | ||
| + | |||
| + | この時点から、バイナリレプリケーションが有効になり、正しく動作していると想定できます。 | ||
| + | |||
| + | <wrap #ks6_2_4 /> | ||
| + | |||
| + | === Pandora FMS 設定 === | ||
| + | |||
| + | <wrap #ks6_2_4_1 /> | ||
| + | |||
| + | == Pandora FMS サーバの調整 == | ||
| + | |||
| + | <WRAP center round info 90%> | ||
| Version 770 or later. | Version 770 or later. | ||
| 行 900: | 行 1061: | ||
| </ | </ | ||
| - | <WRAP center round info 60%> | + | <WRAP center round info 90%> |
| - | バージョン 770 以降 | + | バージョン 770 以上 |
| </ | </ | ||
| - | It is necessary to configure | + | It is necessary to configure |
| - | [[: | + | '' |
| The parameters to be added are the following: | The parameters to be added are the following: | ||
| - | 追加するパラメータは次の通りです。 | + | 追加するパラメータは以下のとおりです。 |
| - | * **ha_hosts < | + | * **ha_hosts < |
| - | Configure the '' | + | |
| - | | + | The '' |
| - | HA 環境を構成する MySQL サーバの IP アドレスまたは FQDN を指定する | + | |
| + | '' | ||
| < | < | ||
| 行 925: | 行 1086: | ||
| </ | </ | ||
| - | * **ha_dbuser** | + | * **ha_dbuser** and **ha_dbpass**: |
| - | These are the parameters where you must indicate the user and password of **root** | + | |
| - | * **ha_dbuser** | + | * **ha_dbuser** および **ha_dbpass**: |
| - | これらは、**root** | + | |
| + | These are the parameters where the **root** user and password must be indicated or, failing that, a MySQL user with the maximum privileges that will oversee performing all master - //slave// promotion operations on the nodes. Example: | ||
| + | |||
| + | これらは、**root** ユーザとパスワードを指定するパラメータです。それができない場合は、ノード上のすべてのマスター/スレーブ昇格操作の実行を監視する最大権限を持つ MySQL ユーザを指定します。例: | ||
| < | < | ||
| 行 937: | 行 1100: | ||
| </ | </ | ||
| - | * **repl_dbuser** | + | * **repl_dbuser** and **repl_dbpass**: |
| - | Parameters to define the replication user that will use the **SLAVE** | + | |
| - | * **repl_dbuser** | + | * **repl_dbuser** および **repl_dbpass**: |
| - | **SLAVE** | + | |
| + | Parameters to define the replication user that the **SLAVE** | ||
| + | |||
| + | **SLAVE** が **MASTER** に接続するために使用するレプリケーションユーザを定義するパラメータ。例: | ||
| < | < | ||
| - | repl_dbuser | + | repl_dbuser |
| repl_dbpass pandora | repl_dbpass pandora | ||
| </ | </ | ||
| - | * **ha_sshuser** | + | * **ha_sshuser** and **ha_sshport**: |
| - | Parameters to define the user/port with which it is connected by **ssh** | + | |
| - | * **ha_sshuser** および **ha_sshport** | + | * **ha_sshuser** および **ha_sshport**: |
| - | リカバリ操作を実行するために **ssh** | + | |
| + | Parameters to define the user/port with which to connect via **ssh** to the Percona/ | ||
| + | |||
| + | リカバリ操作を実行するために、**ssh** | ||
| < | < | ||
| 行 961: | 行 1128: | ||
| </ | </ | ||
| - | * **ha_resync**'' | + | * **ha_resync**'' |
| - | By default the script to perform the resynchronization of the nodes, this is located at: | + | |
| - | * **ha_resync**'' | + | By default, the //script// to resynchronize the nodes is located at: |
| - | デフォルトでは、ノードの再同期を実行するスクリプトは次の場所にありますP | + | |
| + | デフォルトでは、ノードを再同期するためのスクリプトは次の場所にあります。 | ||
| < | < | ||
| - | / | + | / |
| </ | </ | ||
| - | In the case of having a customized | + | If having a custom |
| - | スクリプトをカスタマイズしてインストールする場合は、必要に応じて **SLAVE** ノードの自動または手動同期を実行するスクリプトの場所をこのパラメータで指定します。 | + | //スクリプト// をカスタムインストールしている場合は、このパラメーターでその場所を指定してください。そうすることで、**SLAVE** ノードの自動または手動同期が必要に応じて実行されます。 |
| < | < | ||
| 行 981: | 行 1148: | ||
| </ | </ | ||
| - | * **ha_resync_log** | + | * **ha_resync_log**: |
| - | Log path where all the information related to the executions performed by the synchronization script configured in the previous token will be stored. Example: | + | |
| - | * **ha_resync_log** | + | Path of the //log// where all the information related to the executions performed by the //script// configured in the previous //token// will be saved. Example: |
| - | 前のトークンで設定された同期スクリプトの実行に関するすべての情報が格納されるログのパスです。 例: | + | |
| + | 前のトークンで設定されたスクリプトによって実行されたすべての情報を保存するログファイルのパス。例: | ||
| < | < | ||
| ha_resync_log / | ha_resync_log / | ||
| - | |||
| </ | </ | ||
| - | * **ha_connect_retries** | + | * **ha_connect_retries**: |
| - | Number of attempts it will perform on each check with each of the servers in the HA environment before making any changes to the environment. Example: | + | |
| - | * **ha_connect_retries** | + | Number of retries that it will perform in each check with each of the HA environment servers before making any changes in the environment. Example: |
| - | 環境に変更を加える前に、HA 環境内の各サーバで各チェックを試行する回数です。 例: | + | |
| + | 環境に変更を加える前に、各 HA 環境サーバでの各チェックで実行される再試行の数。例: | ||
| < | < | ||
| 行 1003: | 行 1169: | ||
| </ | </ | ||
| - | Once all these parameters are configured, you could start Pandora FMS server with the '' | + | Once all these parameters are configured, you can start the Pandora FMS server with the '' |
| - | これらのパラメータをすべて設定したら、'' | + | これらのパラメータをすべて設定したら、'' |
| - | When it knows it, it will create the '' | + | When it knows it, it will create the '' |
| - | それを認識すると、''/ | + | システムがそれを認識すると、''/ |
| - | In case the '' | + | In the event that the '' |
| - | '' | + | '' |
| - | This file will be used as an interchange | + | This file will be used as an exchange |
| - | このファイルは、**MASTER** | + | このファイルは、Pandora FMS Console とのやり取りに使用され、**MASTER** |
| - | * **restart** | + | * **restart**: |
| - | It will be indicated with a value of '' | + | |
| - | **pandora_ha** デーモンは、競合を回避しながら障害時のサービスの再起動を行うため、通常は値は '' | + | It will be indicated with a value of '' |
| + | |||
| + | **pandora_ha** //デーモン// が障害発生時にサービスを再起動する役割を担っているため、競合が発生する可能性があり、その場合は '' | ||
| < | < | ||
| 行 1029: | 行 1196: | ||
| </ | </ | ||
| + | |||
| * **ha_backup_source_dir**: | * **ha_backup_source_dir**: | ||
| 行 1034: | 行 1202: | ||
| Directory that will contain the HA backup data. Default value: ''/ | Directory that will contain the HA backup data. Default value: ''/ | ||
| - | HA バックアップデータを保存するディレクトリ。デフォルト値: | + | HA バックアップデータが格納されるディレクトリ。デフォルト値: |
| * **ha_mysql_source_dir**: | * **ha_mysql_source_dir**: | ||
| - | Directory that will contain | + | Directory that contains |
| - | MySQLデータを保存するディレクトリ。デフォルト値: | + | MySQL データが格納されているディレクトリ。デフォルト値: |
| - | <wrap #ks6_3_1 /> | + | Once the modifications are made in the configuration file, we start '' |
| - | === サーバ間の SSH 鍵共有 === | + | 設定ファイルに変更を加えたら、両方のノードで '' |
| - | An OpenSSH server must be installed and running on each host. Suppress the welcome message or banner that displays OpenSSH, run on **all** devices: | + | <code bash> |
| + | systemctl start pandora_ha | ||
| + | </ | ||
| - | OpenSSH サーバがインストールされ、各ホストで動作している必要があります。OpenSSH を表示するウェルカムメッセージまたはバナーを抑制します。**すべて** のデバイスで以下を実行します: | + | <wrap #ks6_2_4_2 /> |
| - | < | + | == Pandora FMS コンソールの調整 == |
| - | [ -f / | + | |
| - | sed -i -e ' | + | |
| - | systemctl restart sshd | + | |
| - | </ | + | The Console' |
| - | Share the SSH keys between | + | コンソールの |
| - | '' | + | < |
| + | /var/ | ||
| + | </ | ||
| - | < | + | must be configured, adding the following value: |
| - | printf " | + | |
| - | ssh-copy-id -p22 root@node1 | + | |
| - | ssh-copy-id -p22 root@node2 | + | |
| + | 以下の値を追加して設定する必要があります。 | ||
| + | |||
| + | <code php> | ||
| + | $config[" | ||
| </ | </ | ||
| - | <WRAP center round important 75%> | + | Looking as follows: |
| - | * In case you have the installation on Ubuntu Server, enable the **root** | + | 見た目は以下のようになります。 |
| - | * Then enable the SSH connection of the root user at least through shared keys " | + | |
| - | </ | + | {{ : |
| - | <WRAP center round important 75%> | + | With this, Pandora FMS will read the file |
| - | * Ubuntu Server | + | これにより、Pandora FMS はファイルを読み込みます。 |
| - | * 次に、'' | + | |
| + | < | ||
| + | / | ||
| + | </ | ||
| + | |||
| + | from where it will get the IP address to make the connection. | ||
| + | |||
| + | 接続に必要な IP アドレスはそこから取得されます。 | ||
| + | |||
| + | <wrap #ks6_2_5 /> | ||
| + | |||
| + | === Pandora FMS コンソール設定 | ||
| + | |||
| + | <WRAP center round info 90%> | ||
| + | |||
| + | Version 770 or later. | ||
| </ | </ | ||
| - | === 同期スクリプトの利用 === | + | <WRAP center round info 90%> |
| - | With Pandora FMS server a script is implemented that allows you to synchronize the **SLAVE** database in case it is out of sync. | + | バージョン 770 以上 |
| - | Pandora FMS サーバでは、同期が取れていない場合に **SLAVE** データベースを同期できるようにするスクリプトが実装されています。 | + | </ |
| - | The manual execution | + | A new parameter has been added to the '' |
| - | スクリプトの手動実行は次の通りです: | + | Pandora FMS がデフォルトで使用する交換ディレクトリのパスを示す新しいパラメータが '' |
| + | |||
| + | If configured, it will look for the file ''/ | ||
| + | |||
| + | 設定されている場合、接続に必要な IP アドレスを取得するために、ファイル ''/ | ||
| < | < | ||
| - | ./ | + | $config["remote_config" |
| </ | </ | ||
| - | For example, to make a manual synchronization from node 1 to node 2 the execution would be the following: | + | In the Pandora FMS console you can view the cluster status by accessing the Manage HA view. |
| - | 例えば、ノード1 からノード2 へ手動で同期するには、次のように実行します: | + | Pandora FMS コンソールでは、HA 管理画面にアクセスすることでクラスタの状態を確認できます。 |
| < | < | ||
| - | /usr/share/pandora_server/util/ | + | https://PANDORA_IP/pandora_console/index.php? |
| </ | </ | ||
| - | To configure the automatic recovery of the HA environment when there is any synchronization problem between **MASTER** and **SLAVE**, it is necessary to have the configuration token '' | + | {{ : |
| - | **MASTER** と **SLAVE** の間で同期の問題が発生した際に HA 環境の自動回復を設定するには、サーバ設定ファイル('' | + | The data in this view are constantly updated thanks to '' |
| - | So, whenever a [[# | + | この画面のデータは |
| - | そうすると、[[# | + | Among the available actions, you can configure a label for each node and you can perform the option to synchronize the **SLAVE** |
| - | This process will generate events in the system indicating the start, the end and if any error took place in there. | + | 利用可能なアクションの中には、各ノードのラベルを設定したり、アイコン{{: |
| - | この処理は、開始、終了、およびそこでエラーが発生したかどうかを示すイベントをシステムで生成します。 | + | This icon can have the following statuses: |
| - | <wrap #ks6_4 /> | + | このアイコンには、以下の状態があります。 |
| - | ==== Pandora FMS コンソールの設定 ==== | + | * **Green**: Normal, no operation to perform. |
| + | * **Blue**: Pending resynchronization. | ||
| + | * **Yellow**: Resynchronization is being performed. | ||
| + | * **Red**: //Error//, resynchronization failed. | ||
| - | <WRAP center round info 60%> | + | * **緑**: 正常、実行すべき操作はありません。 |
| + | * **青**: 再同期待ち。 | ||
| + | * **黄**: 再同期を実行中。 | ||
| + | * **赤**: // | ||
| - | Version 770 or later. | + | <wrap #ks6_2_6 /> |
| - | </ | + | === HA 表示 === |
| - | <WRAP center round info 60%> | + | <wrap #ks6_2_6_1 /> |
| - | バージョン 770 以降 | + | == 動作検証 == |
| - | </ | + | Once the steps described above have been followed, we can check the cluster status by accessing the HA management view: |
| - | A new parameter has been added to the '' | + | 上記の手順を完了したら、HA 管理画面にアクセスしてクラスタの状態を確認できます。 |
| - | Pandora FMS が使用するデータ受け取りディレクトリのパス、デフォルトでは '' | + | < |
| + | https://PANDORA_IP/pandora_console/index.php? | ||
| + | </ | ||
| - | If it is configured, it will look for the file ''/ | + | {{ : |
| - | 設定されている場合、''/ | + | In it, we will see information about the connection and replication status: |
| - | < | + | そこには、接続とレプリケーションのステータスに関する情報が表示されます。 |
| - | $config[" | + | |
| - | </code> | + | * <wrap : |
| + | * <wrap : | ||
| + | * <wrap : | ||
| + | * <wrap : | ||
| + | * <wrap : | ||
| + | * <wrap :en>**DB Role**</ | ||
| + | * <wrap : | ||
| + | * <wrap : | ||
| + | * <wrap : | ||
| + | * <wrap :en>**DB version**</wrap>: Installed version of the schema in the PandoraFMS DB. | ||
| - | In Pandora FMS console you could see the cluster status accessing to the Manage HA view. | + | * **IP**: クラスタを構成するノードのIPアドレス。 |
| + | * **ノードラベル(Node label)**: ノードに設定可能な識別ラベル。 | ||
| + | * **SQL ノードステータス(SQL Node status)**: MySQLサービスのステータス。 | ||
| + | * **SSH**: SSH接続ステータス。 | ||
| + | * **レプリケーションステータス(Replication Status)**: レプリケーションステータス。 | ||
| + | * **DB ロール(DB Role)**: クラスタを構成するノードにおけるマスターを識別するためのロール。 | ||
| + | * **遅延(Delay)**: | ||
| + | * **最終更新(Last Update)**: 最終更新時刻。 | ||
| + | * <wrap : | ||
| + | * <wrap :ja>**DB バージョン(DB version)**</ | ||
| - | Pandora FMS コンソールでは、HA 管理画面にアクセスしてクラスタの状態を確認できます。 | + | <wrap #ks6_2_6_2 /> |
| - | < | + | == 可能なアクション == |
| - | https:// | + | |
| + | In the last column of the HA view, we have different actions we can run: | ||
| + | |||
| + | HA 画面の最後の列には、実行可能なさまざまなアクションが表示されます。 | ||
| + | |||
| + | * {{: | ||
| + | * {{: | ||
| + | * {{: | ||
| + | |||
| + | * {{: | ||
| + | * {{: | ||
| + | * {{: | ||
| + | |||
| + | - **Green**: Normal, no operation to perform. | ||
| + | - **Blue**: Pending resynchronization. | ||
| + | - **Yellow**: Resynchronization is being performed. | ||
| + | - **Red**: Error, resynchronization failed. | ||
| + | |||
| + | - **緑**: 正常、実行すべき操作はありません。 | ||
| + | - **青**: 再同期待ち。 | ||
| + | - **黄**: 再同期を実行中。 | ||
| + | - **赤**: エラー、再同期に失敗。 | ||
| + | |||
| + | <wrap #ks6_3 /> | ||
| + | |||
| + | ==== 手動 DB 再同期 ==== | ||
| + | |||
| + | Using the synchronization //script//: With the Pandora FMS server, a //script// is implemented that allows you to synchronize the **SLAVE** database in case it is desynchronized. | ||
| + | |||
| + | 同期スクリプトの使用: | ||
| + | |||
| + | The manual execution of this //script// is as follows: | ||
| + | |||
| + | このスクリプトの手動実行方法は以下のとおりです。 | ||
| + | |||
| + | <code bash> | ||
| + | ./ | ||
| </ | </ | ||
| - | {{ | + | For example, to manually synchronize node 1 to node 2, the execution would be as follows: |
| - | The data of this view is constantly updated thanks to '' | + | たとえば、ノード 1 をノード 2 に手動で同期するには、実行は次のようになります。 |
| - | この画面のデータは、'' | + | <code bash> |
| + | / | ||
| + | / | ||
| + | | ||
| + | | ||
| + | </ | ||
| - | Among the available actions, you may configure | + | To configure |
| - | 実行可能なアクションとしては、各ノードのラベルを設定することができ、{{: | + | **MASTER** |
| - | This icon can have the following states: | + | Thus, whenever a [[# |
| - | このアイコンには次の状態があります。 | + | したがって、[[# |
| + | |||
| + | This process will generate events in the system indicating the start, the end and if any error has occurred within it. | ||
| + | |||
| + | この処理は、開始、終了、およびエラーが発生したかどうかを示すイベントをシステム内に生成します。 | ||
| + | |||
| + | <wrap #ks6_4 /> | ||
| - | * **Green**: Normal, no operation to be performed. | ||
| - | * **Blue**: Pending resynchronization. | ||
| - | * **Yellow**: Resynchronization is in progress. | ||
| - | * **Red**: //Error//, resynchronization failed. | ||
| - | * **緑**: 正常、何の処理も実行されていない。 | ||
| - | * **青**: 同期保留中。 | ||
| - | * **黄**: 同期実行中。 | ||
| - | * **赤**: // | ||
| 行 1225: | 行 1476: | ||
| </ | </ | ||
| - | **mysql** > '' | + | **mysql** > '' |
| - | **mysql** > '' | + | **mysql** > '' |
| **mysql** > '' | **mysql** > '' | ||
| 行 1472: | 行 1723: | ||
| *************************** 1. row *************************** | *************************** 1. row *************************** | ||
| | | ||
| - | Master_Host: | + | Master_Host: |
| Master_User: | Master_User: | ||
| Master_Port: | Master_Port: | ||
| 行 1547: | 行 1798: | ||
| </ | </ | ||
| - | [[ja: | + | [[ja: |
| ===== (OBSOLETE) データベース HA ===== | ===== (OBSOLETE) データベース HA ===== | ||