差分
このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン | ||
ja:documentation:pandorafms:complex_environments_and_optimization:06_ha [2024/09/07 22:40] – [Corosync-Pacemaker HA 環境マイグレーション] junichi | ja:documentation:pandorafms:complex_environments_and_optimization:06_ha [2025/02/26 10:16] (現在) – [更新] junichi | ||
---|---|---|---|
行 8: | 行 8: | ||
===== 概要 ===== | ===== 概要 ===== | ||
- | Pandora FMS はとても安定したアプリケーションになっています。(みなさんのテストのおかげで、それぞれのバージョンでは拡張が行われ、数百の不具合が報告され、修正されてきました。) しかし、クリティカルや高負荷な環境では、複数のサーバに処理を分散させることが可能です。Pandora FMS では、いずれかのコンポーネントで障害が発生しても、システム自体はダウンしません。 | ||
- | Pandora FMS は、細かいモジュールで設計されています。それぞれのモジュールは、独立して動作することができます。しかし、それぞれはまた、連携して動作することができ、負荷を分配することができます。 | + | In critical and/or high-loaded environments, |
- | Pandora FMS の基本設計を以下に示します。 | + | クリティカルな環境や高負荷の環境では、負荷を複数のマシンに分散し、Pandora FMS コンポーネントのいずれかに障害が発生した場合でもシステムの稼働状態を維持できるようにする必要があります。 |
- | {{ :wiki:ha1.png }} | + | Pandora FMS has been designed to be modular but it is also designed to work in collaboration with other components and to be able to assume the load of those components that failed. |
- | もちろん、エージェントは冗長化構成ではありません。エージェントがダウンすると、モジュールの実行ができず、また、複数のエージェントを平行して実行することはできないため、またはシステム自体がダウンしているため、そのエージェントの全てのデータ収集はできなくなります。 | + | Pandora FMS はモジュール形式で設計されており、他のコンポーネントと連携して動作し、障害が発生したコンポーネントの動作を引き受けられるように設計されています。 |
- | 重要なシステムに対する最良の解決策は、Pandora FMS エージェントのある無しに関わらず、冗長化しモニタリングすることです。 | + | |
- | いくつかの場面において、次のような HA 構成が可能です。 | + | Obviously, agents are not redundant. The solution is to redundate critical systems -regardless of whether they have Pandora FMS agents running or not- and thus redundate the monitoring of these systems. |
- | * データサーバのバランシングと HA | + | 明らかにエージェントは冗長化されていません。解決策は、Pandora FMS エージェントが実行中であるかどうかに関係なく重要なシステムを冗長化し、これらのシステムの監視を冗長化することです。 |
- | * ネットワーク、WMI、プラグイン、Web および予測サーバのバランシングと HA | + | |
- | * データベースのロードバランシング | + | |
- | * 自動検出サーバのバランシングと HA | + | |
- | * Pandora FMS コンソールのバランシングと HA | + | |
+ | High Availability (**HA**) can be used in several scenarios: | ||
+ | いくつかの場面において、次のような高可用性 (**HA**) 構成が可能です。 | ||
+ | * Data server. | ||
+ | * Network Servers, WMI, Plugin, Web, Prediction, Recon, and similar. | ||
+ | * Database (**BBDD**). | ||
+ | * Pandora FMS web console. | ||
+ | * データサーバ | ||
+ | * ネットワークサーバ、WMI、プラグイン、Web、予測、自動検出など | ||
+ | * データベース | ||
+ | * Pandora FMS Web コンソール | ||
+ | <wrap #ks2 /> | ||
===== データサーバの HA ===== | ===== データサーバの HA ===== | ||
- | 最も簡単な方法は、エージェントに実装されている HA を使用することです(プライマリが応答しない場合は代替サーバーに接続できます)。 ただし、データサーバはポート 41121 をサポートし、標準の TCP ポートであるため、通常の TCP サービスのバランシングまたはクラスタリングを可能にする商用ソリューションを使用することができます。 | ||
- | Pandora FMS データサーバでは、(異なるホスト名およびサーバ名で)設定された 2つの | + | * For Pandora FMS data server you need to build two machines with a Pandora FMS data server configured (and different hostname and server name). |
+ | * A Tentacle server must be configured in each of them. | ||
+ | * Each machine will have a different | ||
+ | * If you are going to use an external balancer, it will provide a single | ||
+ | * In the case of using the HA mechanism of the agents, there will be a small delay in sending data, since at each agent execution, it will try to connect with the primary server, and if it does not answer, it will try to connect with the secondary server | ||
- | 外部バランサを使用していて、いずれかのサーバが故障した場合、アクティブなサーバにのみ接続するようになります。Pandora FMS エージェントは変更に気付くことなく、これまでと同様のアドレスへ接続します。しかし、この場合は、ロードバランサーは障害が発生したサーバにはデータを送信せず、アクティブな方にのみ送信します。 | + | * Pandora FMS データサーバの場合は、Pandora FMS データサーバが設定された (ホスト名とサーバ名が異なる) マシンを 2 台構築する必要があります。 |
- | {{ : | + | * それぞれのマシンに Tentacle サーバを設定する必要があります。 |
+ | * 各マシンには異なる IP アドレスがあります。 | ||
+ | * 外部バランサーを使用する場合は、エージェントがデータを送信するために接続するための単一の IP アドレスが提供されます。 | ||
+ | * エージェントの HA メカニズムを使用する場合は、エージェントの実行ごとにプライマリサーバに接続しようとし、応答がない場合はセカンダリサーバに接続しようとするため (そのように設定されている場合)、データの送信に若干の遅延が発生します。 | ||
- | Pandora FMS データサーバの設定を変更する必要はありません。それぞれのサーバに別々の名前を設定してさえいえれば、サーバの状態ビューでいずれかがダウンしていることがわかり便利です。Pandora FMS データモジュールは、いずれかのサーバで処理することができます。事前のサーバ指定は不要です。簡単に HA 構成がとれるように設計されています。 | + | If two data servers are to be used and both handle remote policies, collections, |
- | エージェントの HA メカニズムを使用する場合は、データの送信にわずかな遅延があります。これは、エージェントの実行ごとにプライマリサーバとの接続を試みるためです。応答しない場合 セカンダリに対してこれを行います(設定されている場合)。これについては、次の " | + | 2 つのデータサーバを使用し、両方でリモートポリシー、コレクション、および設定を処理する場合は、データサーバのすべてのインスタンスがこれらのディレクトリの読み取りと書き込みを行えるように、キーディレクトリを共有する必要があります。コンソールもこれらの共有ディレクトリにアクセスできる必要があります。 |
- | 2つのデータサーバーを使用し、ポリシー、コレクション、およびリモート構成を管理する場合は、 [[: | + | * ''/ |
+ | * ''/ | ||
+ | * ''/ | ||
+ | * ''/ | ||
+ | * ''/ | ||
+ | * ''/ | ||
* ''/ | * ''/ | ||
行 51: | 行 67: | ||
* ''/ | * ''/ | ||
* ''/ | * ''/ | ||
+ | * ''/ | ||
- | ===== ソフトウエアエージェントでのバランシング ===== | + | <WRAP center round tip 90%> |
- | ソフトウエアエージェントで、データサーバのバランシングを行うことができます。データサーバの一方をマスター、もう一方をバックアップとして設定することができます。 | + | |
- | エージェントの設定ファイル pandora_agent.conf において、次の部分のコメントを外します。 | + | It is important to only share subdirectories within '' |
- | <code> | + | </WRAP> |
- | # Secondary server configuration | + | |
- | # ============================== | + | |
- | # If secondary_mode is set to on_error, data files are copied to the secondary | + | |
- | # server only if the primary server fails. If set to always, data files are | + | |
- | # always copied to the secondary server | + | |
- | secondary_mode on_error | + | |
- | secondary_server_ip localhost | + | |
- | secondary_server_path | + | |
- | secondary_server_port 41121 | + | |
- | secondary_transfer_mode tentacle | + | |
- | secondary_server_pwd mypassword | + | |
- | secondary_server_ssl no | + | |
- | secondary_server_opts | + | |
- | </code> | + | |
- | There are the following options (for more information, | + | <WRAP center round tip 90%> |
- | 次に示すオプションがあります。(詳細は、[[: | + | サーバのパフォーマンスに悪影響を与えるため、'' |
+ | |||
+ | </ | ||
+ | |||
+ | <wrap #ks3 /> | ||
+ | |||
+ | ===== ソフトウエアエージェントでのバランシング ===== | ||
+ | |||
+ | From Software Agents, it is possible to perform data server balancing, since it is possible to configure a master | ||
+ | |||
+ | ソフトウェアエージェントからは、マスター (メイン) およびバックアップ (運用バックアップ) データサーバを設定でき、データサーバのバランス調整を実行できます。ソフトウェアエージェント設定ファイル '' | ||
+ | |||
+ | * <wrap : | ||
+ | * <wrap : | ||
+ | * <wrap : | ||
+ | * <wrap : | ||
+ | * <wrap : | ||
+ | * <wrap : | ||
+ | * <wrap : | ||
+ | * <wrap : | ||
- | * **secondary_mode**: | ||
- | * **on_error**: | ||
- | * **always**: メインサーバに接続できるできないに関わらず、常にセカンダリサーバにもデータを送信します。 | ||
* **secondary_server_ip**: | * **secondary_server_ip**: | ||
* **secondary_server_path**: | * **secondary_server_path**: | ||
行 85: | 行 103: | ||
* **secondary_transfer_mode**: | * **secondary_transfer_mode**: | ||
* **secondary_server_pwd**: | * **secondary_server_pwd**: | ||
- | * **secondary_server_ssl**: | + | * **secondary_server_ssl**: |
* **secondary_server_opts**: | * **secondary_server_opts**: | ||
+ | * **secondary_mode**: | ||
+ | |||
+ | - <wrap : | ||
+ | - <wrap : | ||
+ | |||
+ | - **on_error**: | ||
+ | - **always**: メインサーバに接続できるできないに関わらず、常にセカンダリサーバにもデータを送信します。 | ||
+ | |||
+ | <WRAP center round important 90%> | ||
+ | |||
+ | Only the remote configuration of the Software Agent is operative, if enabled, on the main server. | ||
+ | |||
+ | </ | ||
+ | |||
+ | <WRAP center round important 90%> | ||
- | <WRAP center round important 60%> | ||
エージェントのリモート設定が有効になっている場合、メインサーバでのみ操作できます。 | エージェントのリモート設定が有効になっている場合、メインサーバでのみ操作できます。 | ||
+ | |||
</ | </ | ||
+ | |||
+ | <wrap #ks4 /> | ||
===== ネットワーク、WMI、プラグイン、ウェブ、予測サーバのバランシングと HA ===== | ===== ネットワーク、WMI、プラグイン、ウェブ、予測サーバのバランシングと HA ===== | ||
- | これは簡単です。複数のサーバに、ネットワーク、WMI、プラグイン、ウェブ、予測サーバを (モニタしたいシステムを見れるよう同じように) それぞれインストールします。複数のサーバは (ネットワーク遅延が同じになるように) 同一セグメントに置く必要があります。 | + | You need to install [[: |
+ | |||
+ | [[: | ||
それぞれのサーバはプライマリとして選択できます。それぞれのサーバは、他方がダウンした場合、そのサーバに割り当てられていた全てのモジュールデータの収集を自動的に引き継ぎます。Pandora FMS サーバには、最終接続時間 (サーバの threshold x 2) を確認して、他のサーバがダウンしていることを検知する仕組が実装されています。Pandora FMS サーバが 1台でも稼働していれば、他のサーバのダウンを検出することができます。すべての Pandora FMS サーバがダウンした場合は、検出する手段はありません。 | それぞれのサーバはプライマリとして選択できます。それぞれのサーバは、他方がダウンした場合、そのサーバに割り当てられていた全てのモジュールデータの収集を自動的に引き継ぎます。Pandora FMS サーバには、最終接続時間 (サーバの threshold x 2) を確認して、他のサーバがダウンしていることを検知する仕組が実装されています。Pandora FMS サーバが 1台でも稼働していれば、他のサーバのダウンを検出することができます。すべての Pandora FMS サーバがダウンした場合は、検出する手段はありません。 | ||
行 101: | 行 138: | ||
{{ wiki: | {{ wiki: | ||
+ | |||
+ | <wrap #ks4_1 /> | ||
==== サーバの設定 | ==== サーバの設定 | ||
行 127: | 行 166: | ||
* '' | * '' | ||
* '' | * '' | ||
+ | |||
+ | <wrap #ks4_2 /> | ||
==== Pandora FMS サーバの HA DB クラスタへの追加 ==== | ==== Pandora FMS サーバの HA DB クラスタへの追加 ==== | ||
- | If [[: | + | If [[#ks6|High Availability is enabled in the Database]], some extra configurations are needed to connect more Pandora FMS servers to MySQL cluster. In the '' |
- | [[: | + | [[# |
* '' | * '' | ||
行 138: | 行 179: | ||
* '' | * '' | ||
- | <code> | + | <file | / |
dbuser pandora | dbuser pandora | ||
- | </code> | + | </file> |
* '' | * '' | ||
行 148: | 行 188: | ||
* '' | * '' | ||
- | <code> | + | <file | / |
dbpass pandora | dbpass pandora | ||
- | </code> | + | </file> |
* '' | * '' | ||
行 161: | 行 201: | ||
</ | </ | ||
+ | |||
+ | <wrap #ks5 /> | ||
===== Pandora FMS コンソールの HA ===== | ===== Pandora FMS コンソールの HA ===== | ||
- | Just [[[: | + | Just [[: |
- | 他のサーバに[[[: | + | 他のサーバに[[[: |
- | In the case of using remote configuration and to manage it from all consoles, both data servers and consoles must share the input data directory (default: ''/ | + | In the case of using remote configuration and to manage it from all consoles, both data servers and consoles must share the input data directory (default: ''/ |
- | リモート設定を使用する場合、双方のデータサーバとコンソールは、データ入力ディレクトリ (デフォルト: | + | リモート設定を使用する場合、双方のデータサーバとコンソールは、データ入力ディレクトリ (デフォルト: |
- | <WRAP center round tip 60%> | + | * ''/ |
+ | * ''/ | ||
+ | * ''/ | ||
+ | * ''/ | ||
+ | * ''/ | ||
+ | * ''/ | ||
+ | |||
+ | <WRAP center round tip 90%> | ||
- | It is important to only share subdirectories within '' | + | It is important to only share subdirectories within '' |
</ | </ | ||
- | <WRAP center round tip 60%> | + | <WRAP center round tip 90%> |
サーバのパフォーマンスに影響するため、'' | サーバのパフォーマンスに影響するため、'' | ||
</ | </ | ||
+ | |||
+ | <wrap #ks5_1 /> | ||
==== 更新 ==== | ==== 更新 ==== | ||
- | When updating Pandora FMS console in an HA environment, | + | When updating Pandora FMS console in an HA environment, |
HA 環境で Pandora FMS コンソールを更新する場合、**管理(Management)** → **ワープアップデート(Warp update)** → [[: | HA 環境で Pandora FMS コンソールを更新する場合、**管理(Management)** → **ワープアップデート(Warp update)** → [[: | ||
行 193: | 行 244: | ||
共有データベースを使用するバランシング環境では、最初のコンソールを更新すると、対応する変更がデータベースに適用されます。 これは、セカンダリのコンソールを更新しようとすると、データベースがすでに更新されているため、Pandora FMS がエラーメッセージを表示することになります。 ただし、コンソールの更新は引き続き実行されます。 | 共有データベースを使用するバランシング環境では、最初のコンソールを更新すると、対応する変更がデータベースに適用されます。 これは、セカンダリのコンソールを更新しようとすると、データベースがすでに更新されているため、Pandora FMS がエラーメッセージを表示することになります。 ただし、コンソールの更新は引き続き実行されます。 | ||
+ | |||
+ | <wrap #ks6 /> | ||
===== 高可用性データベース ===== | ===== 高可用性データベース ===== | ||
行 1267: | 行 1320: | ||
適切なユーザー権限で **mysqldump** コマンドを実行し、データダンプ(データダンプまたは単にダンプ)を取得します: | 適切なユーザー権限で **mysqldump** コマンドを実行し、データダンプ(データダンプまたは単にダンプ)を取得します: | ||
- | < | + | < |
mysqldump -u root -p -n -t --skip-create-options --databases pandora --tables tagente_datos --where=' | mysqldump -u root -p -n -t --skip-create-options --databases pandora --tables tagente_datos --where=' | ||
+ | |||
</ | </ | ||
- | < | + | < |
mysqldump -u root -p -n -t --skip-create-options --databases pandora --tables tagente_datos_string --where=' | mysqldump -u root -p -n -t --skip-create-options --databases pandora --tables tagente_datos_string --where=' | ||
+ | |||
</ | </ | ||
- | < | + | < |
mysqldump -u root -p -n -t --skip-create-options --databases pandora --tables tevento --where=' | mysqldump -u root -p -n -t --skip-create-options --databases pandora --tables tevento --where=' | ||
+ | |||
</ | </ | ||
+ | |||
Once the dumps of these tables have been obtained, the data will be loaded in the **MASTER** node: | Once the dumps of these tables have been obtained, the data will be loaded in the **MASTER** node: | ||
行 1301: | 行 1357: | ||
1.- マスター DB の全体のダンプを取得します: | 1.- マスター DB の全体のダンプを取得します: | ||
- | MASTER # '' | + | MASTER # |
+ | < | ||
- | MASTER # '' | + | xtrabackup --backup --target-dir=/ |
+ | |||
+ | </ | ||
+ | |||
+ | MASTER # | ||
+ | |||
+ | < | ||
+ | xtrabackup | ||
+ | |||
+ | </ | ||
2.- Get the position of the binary log of the backed up data: | 2.- Get the position of the binary log of the backed up data: | ||
行 1339: | 行 1405: | ||
5.- スレーブサーバで '' | 5.- スレーブサーバで '' | ||
- | < | + | < |
systemctl start mysqld | systemctl start mysqld | ||
+ | |||
</ | </ | ||
行 1439: | 行 1506: | ||
</ | </ | ||
+ | |||
+ | [[ja: | ||
===== (OBSOLETE) データベース HA ===== | ===== (OBSOLETE) データベース HA ===== |