ja:documentation:pandorafms:complex_environments_and_optimization:06_ha

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
ja:documentation:pandorafms:complex_environments_and_optimization:06_ha [2025/04/06 13:06] – [マスターノード設定] junichija:documentation:pandorafms:complex_environments_and_optimization:06_ha [2026/06/19 23:35] (現在) – [冗長化構成(HA)] junichi
行 3: 行 3:
 {{indexmenu_n>6}} {{indexmenu_n>6}}
  
-[[ja:documentation:start|Pandora FMS ドキュメント一覧に戻る]] +[[ja:documentation:pandorafms:start|Pandora FMS ドキュメント一覧に戻る]]
- +
  
 ===== 概要 ===== ===== 概要 =====
行 83: 行 81:
 <wrap #ks3 /> <wrap #ks3 />
  
-===== ソフトウアエージェントでのバランシング =====+===== エンドポイントでのバランシング =====
  
-From Software Agents, it is possible to perform data server balancing, since it is possible to configure a master (main) and a backup (operational backup) data server. In the Software Agent configuration file ''pandora_agent.conf''  [[:en:documentation:pandorafms:installation:05_configuration_agents#ks3|it should be configured and uncommented]] the following part of the agent configuration file:+From EndPoints, it is possible to perform data server balancing, since it is possible to configure a master (main) and a backup (operational backup) data server. In the EndPoint configuration file ''pandora_agent.conf''  [[:en:documentation:pandorafms:installation:05_configuration_agents#ks3|it should be configured and uncommented]] the following part of the agent configuration file:
  
-ソフトウェアージェントからは、マスター (メイン) およびバックアップ (運用バックアップ) データサーバを設定でき、データサーバのバランス調整を実行できます。ソフトウェアージェント設定ファイル ''pandora_agent.conf'' で [[:ja:documentation:pandorafms:installation:05_configuration_agents#エージェントの一般的なパラメータ|次の部分を設定しコメントを外す必要があります]]。+ンドポイントからは、マスター (メイン) およびバックアップ (運用バックアップ) データサーバを設定でき、データサーバのバランス調整を実行できます。エンドポイント設定ファイル ''pandora_agent.conf'' で [[:ja:documentation:pandorafms:installation:05_configuration_agents#ks3|次の部分を設定しコメントを外す必要があります]]。
  
   * <wrap :en>**secondary_server_ip**</wrap>: IP address of the secondary server.   * <wrap :en>**secondary_server_ip**</wrap>: IP address of the secondary server.
行 115: 行 113:
 <WRAP center round important 90%> <WRAP center round important 90%>
  
-Only the remote configuration of the Software Agent is operative, if enabled, on the main server.+Only the remote configuration of the EndPoint is operative, if enabled, on the main server.
  
 </WRAP> </WRAP>
行 121: 行 119:
 <WRAP center round important 90%> <WRAP center round important 90%>
  
-ージェントのリモート設定が有効になっている場合、メインサーバでのみ操作できます。+ンドポイントのリモート設定が有効になっている場合、メインサーバでのみ操作できます。
  
 </WRAP> </WRAP>
行 129: 行 127:
 ===== ネットワーク、WMI、プラグイン、ウェブ、予測サーバのバランシングと HA ===== ===== ネットワーク、WMI、プラグイン、ウェブ、予測サーバのバランシングと HA =====
  
-You need to install [[:en:documentation:pandorafms:introduction:02_architecture#ks1_1|multiple servers]]: network server, WMI server, Plugin server, Web server or prediction server, on several machines on the network (all with the same visibility to the systems you want to monitor) and all on the same segment (so that network latency data is consistent).+You need to install [[:en:documentation:pandorafms:introduction:02_architecture|multiple servers]]: network server, WMI server, Plugin server, Web server or prediction server, on several machines on the network (all with the same visibility to the systems you want to monitor) and all on the same segment (so that network latency data is consistent).
  
-[[:ja:documentation:pandorafms:introduction:02_architecture#ks1_1|複数のサーバ]]に、ネットワーク、WMI、プラグイン、ウェブ、予測サーバを (モニタしたいシステムを見れるよう同じように) それぞれインストールします。複数のサーバは (ネットワーク遅延が同じになるように) 同一セグメントに置く必要があります。+[[:ja:documentation:pandorafms:introduction:02_architecture|複数のサーバ]]に、ネットワーク、WMI、プラグイン、ウェブ、予測サーバを (モニタしたいシステムを見れるよう同じように) それぞれインストールします。複数のサーバは (ネットワーク遅延が同じになるように) 同一セグメントに置く必要があります。
  
 それぞれのサーバはプライマリとして選択できます。それぞれのサーバは、他方がダウンした場合、そのサーバに割り当てられていた全てのモジュールデータの収集を自動的に引き継ぎます。Pandora FMS サーバには、最終接続時間 (サーバの threshold x 2) を確認して、他のサーバがダウンしていることを検知する仕組が実装されています。Pandora FMS サーバが 1台でも稼働していれば、他のサーバのダウンを検出することができます。すべての Pandora FMS サーバがダウンした場合は、検出する手段はありません。 それぞれのサーバはプライマリとして選択できます。それぞれのサーバは、他方がダウンした場合、そのサーバに割り当てられていた全てのモジュールデータの収集を自動的に引き継ぎます。Pandora FMS サーバには、最終接続時間 (サーバの threshold x 2) を確認して、他のサーバがダウンしていることを検知する仕組が実装されています。Pandora FMS サーバが 1台でも稼働していれば、他のサーバのダウンを検出することができます。すべての Pandora FMS サーバがダウンした場合は、検出する手段はありません。
行 210: 行 208:
 他のサーバに[[[:ja:documentation:pandorafms:command_center:03_installation|コンソールをインストール]]するだけです。それらのいずれからも、異なるユーザによって異なる場所から同時に使用することができます。 コンソールの前段で[[https://pandorafms.com/guides/public/books/load-balancing-with-keepalived|ロードバランサ]]を使用すると、セッションシステムが「クッキー」によって管理され、これがブラウザーに保管されるため、どちらがアクセスされているかを実際に知らなくてもアクセスできます。 他のサーバに[[[:ja:documentation:pandorafms:command_center:03_installation|コンソールをインストール]]するだけです。それらのいずれからも、異なるユーザによって異なる場所から同時に使用することができます。 コンソールの前段で[[https://pandorafms.com/guides/public/books/load-balancing-with-keepalived|ロードバランサ]]を使用すると、セッションシステムが「クッキー」によって管理され、これがブラウザーに保管されるため、どちらがアクセスされているかを実際に知らなくてもアクセスできます。
  
-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: ''/var/spool/pandora/data_in'') for remote configuration of agents, collections and other directories (see topic [[:en:documentation:pandorafms:technical_annexes:15_security_architecture#ks3_1_1|"Security architecture"]]).+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: ''/var/spool/pandora/data_in'') for remote configuration of agents, collections and other directories (see topic [[:en:documentation:pandorafms:cybersecurity:15_security_architecture#ks3_1_1|"Security architecture"]]).
  
-リモート設定を使用する場合、双方のデータサーバとコンソールは、データ入力ディレクトリ (デフォルト: ''/var/spool/pandora/data_in'') 配下の configuration、collections その他を共有する必要があります。([[:ja:documentation:pandorafms:technical_annexes:15_security_architecture#ks3_1_1|"セキュリティアーキテクチャ"]] も参照ください。)+リモート設定を使用する場合、双方のデータサーバとコンソールは、データ入力ディレクトリ (デフォルト: ''/var/spool/pandora/data_in'') 配下の configuration、collections その他を共有する必要があります。([[:ja:documentation:pandorafms:cybersecurity:15_security_architecture#ks3_1_1|"セキュリティアーキテクチャ"]] も参照ください。)
  
   * ''/var/spool/pandora/data_in/conf''   * ''/var/spool/pandora/data_in/conf''
行 445: 行 443:
 ==== バイナリレプリケーション設定 ==== ==== バイナリレプリケーション設定 ====
  
-<WRAP center round info 60%>+<wrap #ks6_2_1 />
  
-It is recommended that to store the //binlogs//  generated by replication in an additional partition or external diskits size must be the same as the one reserved for the databaseSee also the //token//  ''log-bin''  and ''log-bin-index''.+=== 要件 === 
 + 
 +<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 #ks6_2_1_2 /
 + 
 +== 接続性 == 
 + 
 +Between the nodes that will form the HAthere must be connectivity via SSH (port number ''22'') and also between their MySQL servers (''3306''). 
 + 
 +HA を構成するノード間には、SSH(ポート番号 ''22'')による接続が必要であり、また、それらの MySQL サーバ間(''3306'')にも接続が必要です。 
 + 
 +Likewise, it is recommended to use descriptive hostnames and DNS resolution between the machines. 
 + 
 +同様に、マシン間では分かりやすいホスト名と DNS 解決を使用することが推奨されます。 
 + 
 +<wrap #ks6_2_1_3 /> 
 + 
 +== 共有ディレクトリ == 
 + 
 +If you want to use two data servers and have both handle policies, collections, and remote configurations, you will have to share the key directories so that all instances of the Data Server can read and write to those directoriesConsoles must also have access to these shared directories. For example, sharing them via NFS: 
 + 
 +2台のデータサーバを使用し、両方でポリシー、コレクション、リモート設定を処理する場合は、すべてのデータサーバインスタンスがこれらのディレクトリを読み書きできるように、キーディレクトリを共有する必要があります。コンソールもこれらの共有ディレクトリにアクセスできる必要があります。たとえば、NFS 経由で共有する場合: 
 + 
 +<file> 
 +/var/spool/pandora/data_in/conf 
 +/var/spool/pandora/data_in/collections 
 +/var/spool/pandora/data_in/md5 
 +/var/spool/pandora/data_in/netflow 
 +/var/www/html/pandora_console/attachment 
 +/var/spool/pandora/data_in/discovery 
 +</file> 
 + 
 +<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 /etc/cron.hourly/motd_rebuild ] && rm -f /etc/cron.hourly/motd_rebuild 
 +cp -a /etc/ssh/sshd_config{,.bak-$(date +%F)} 
 +sed -i -e 's/^Banner.*/#Banner none/g/etc/ssh/sshd_config 
 +sed -'s/^\s*session\s\+optional\s\+pam_motd\.so/#&//etc/pam.d/sshd 
 +systemctl restart sshd 
 +</code> 
 + 
 +**On Ubuntu 22.04**: 
 + 
 +**Ubuntu 22.04 の場合**: 
 + 
 +<code bash> 
 +cp -a /etc/pam.d/sshd{,.bak-$(date +%F)} 
 +sed -i 's/^session\s\+optional\s\+pam_motd.so/# &//etc/pam.d/sshd 
 +chmod -x /etc/update-motd.d/* 
 +systemctl restart sshd 
 +</code> 
 + 
 +a) RSA key generation without //passphrase//: 
 + 
 +a) パスフレーズなしの RSA 鍵生成: 
 + 
 +<code bash> 
 +printf "\n\n\n" | ssh-keygen -t rsa -P '' 
 +</code> 
 + 
 +b) Identity copy (Bidirectional and Reflexive): 
 + 
 +b) アイデンティティコピー(双方向): 
 + 
 +<code bash> 
 +ssh-copy-id -p22 root@pandoraha1 
 +ssh-copy-id -p22 root@pandoraha2 
 +</code> 
 + 
 +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 
 +</code> 
 + 
 +<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 ''my.cnf'' file.
  
 </WRAP> </WRAP>
  
-<WRAP center round info 60%>+<WRAP center round warning 90%> 
  
-レプリケーションによって生成された //binlogs// を追加パーティションまた外部ディクに保存することをお勧めします。そのサイズはデタベス用に予約されているサイズと同じある必要があります。 ''log-bin'' および ''log-bin-index'' //トークン//も参照してください。+重要:こ手順のみ実行し、''my.cnf'' ファイルを変更する前に実行してください。
  
 </WRAP> </WRAP>
  
-Once you have installed MySQL server in all the cluster nodes, proceed to configure both environments to have them replicated.+Access the MySQL console: 
 + 
 +MySQL コンソールにアクセスします。 
 + 
 +<code bash> 
 +mysql -u root -p pandora 
 +# Password by default: Pandor4! 
 +</code> 
 + 
 +Run the following SQL queries: 
 + 
 +以下の SQL クエリを実行します。 
 + 
 +<code sql> 
 +UNINSTALL COMPONENT 'file://component_validate_password'; 
 +CREATE USER replicationuser@'%' IDENTIFIED WITH mysql_native_password BY 'pandora'; 
 +GRANT REPLICATION CLIENT, REPLICATION SLAVE on *.* to replicationuser@'%'; 
 +CREATE USER root@'%' IDENTIFIED WITH mysql_native_password BY 'Pandor4!'; 
 +GRANT ALL PRIVILEGES ON *.* to root@'%'; 
 +CREATE USER pandora@'%' IDENTIFIED WITH mysql_native_password BY 'pandora'; 
 +GRANT ALL PRIVILEGES ON pandora.* to pandora@'%'; 
 +FLUSH PRIVILEGES; 
 +EXIT; 
 +</code> 
 + 
 +<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 ''log-bin'' and ''log-bin-index'' //tokens//
 + 
 +</WRAP> 
 + 
 +<WRAP center round info 90%> 
 + 
 +レプリケーションによって生成された //binlogs// は、追加のパーティションまたは外部ディスクに保存することをお勧めします。そのサイズは、データベース用に予約されているサイズと同じである必要があります。''log-bin'' および ''log-bin-index'' //トークン//も参照してください。 
 + 
 +</WRAP> 
 + 
 +Once the MySQL server is installed on all nodes in the cluster, proceed to perform the configuration in both environments to have them replicated. 
 + 
 +クラスター内のすべてのノードに MySQL サーバがインストールされたら、両方の環境で設定を行い、それらが複製されるようにします。
  
-すべてのクラスタノードに MySQL サーバをインストールしたら、両方の環境をレプリケートするように設定します。+First of all, you must configure the ''my.cnf'' configuration file, preparing it for binary replication to work properly.
  
-First of all, configure the configuration file ''my.cnf''  preparing it for the binary replication to work correctly.+まず最初に、''my.cnf'' ファイルを設定し、バイナリレプリケーションが正しく動作するように準備する必要があります。
  
-まず、設定ファイル ''my.cnf'' を設定して、バイナリレプリケーションが正しく機能するように準備します。+**Node 1**
  
-=== ノード 1 ===+**ノード 1**
  
-Node 1 ''/etc/my.cnf'' ( ''/etc/mysql/my.cnf'' for Ubuntu server):+Node 1 ''/etc/my.cnf'' (''/etc/mysql/my.cnf'' on Ubuntu server):
  
-ノード 1 ''/etc/my.cnf'' ( Ubuntu server の場合は ''/etc/mysql/my.cnf'' ):+ノード 1 ''/etc/my.cnf'' (Ubuntu サーバでは ''/etc/mysql/my.cnf''):
  
 <code> <code>
行 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
 +#log-bin=/path                     # Uncomment for adding an additional storage path for binlogs and setting a new path
 +#log-bin-index=/path/archive.index # Uncomment for adding an additional storage path for binlogs and setting a new path
 sync_source_info=1 sync_source_info=1
 sync_binlog=1 sync_binlog=1
行 520: 行 677:
 </code> </code>
  
-  * The tokens after the **OPTIMIZATION FOR PANDORA FMS**  comment perform the optimized configuration for Pandora FMS. +  * The //tokens// following the **OPTIMIZATION FOR PANDORA FMS** comment perform the optimized configuration for Pandora FMS. 
-  * After the comment **SPECIFIC PARAMETERS FOR BINARY REPLICATION**  the specific parameters for the binary replication are configured. +  * After the **SPECIFIC PARAMETERS FOR BINARY REPLICATION** comment, the specific parameters for binary replication are configured. 
-  * The token called ''binlog_expire_logs_seconds''  is configured for a period of two days. +  * The //token// called ''binlog_expire_logs_seconds'' is set for a period of two days. 
-  * In the ''[client]''  subsection enter the user and password used for the databaseby default when installing PFMS they are ''root''  and ''pandora''  respectively. //These values are **necessary**  to perform the backups without indicating user (automated).//+  * In the ''[client]'' subsectionenter the user and password used for the databaseby defaultwhen installing PFMS they are ''root'' and ''pandora'' respectively. //These values are **necessary** for making backups without specifying a user (automated)//.
  
-  * **OPTIMIZATION FOR PANDORA FMS** というコメントの後の設定は、Pandora FMS 用に最適化された設定す。 +  * **OPTIMIZATION FOR PANDORA FMS** コメントに続く //トークン// は、Pandora FMS 最適化された設定を実行します。 
-  * コメント **SPECIFIC PARAMETERS FOR BINARY REPLICATION** の後に、バイナリレプリケーションのための特定パラメーターを設定しています。 +  * **SPECIFIC PARAMETERS FOR BINARY REPLICATION** コメントの後に、バイナリレプリケーションの特定パラメータ設定されます。 
-  * ''binlog_expire_logs_seconds'' というトークンは、2 日で設定しています。 +  * ''binlog_expire_logs_seconds'' という //トークン// は、2 日間有効です。 
-  * ''[client]'' サブセクション、データベース使用するユーザとパスワードを入力します。Pandora FMS をインストールするときのデフォルトでは、それぞれ ''root'' と ''pandora'' す。 //これらの値は、ユーザの入力無し(自動化された)バックアップを実行するために **必要**です。//+  * ''[client]'' サブセクションには、データベース使用するユーザー名とパスワードを入力します。デフォルトでは、PFMS のインストール時にそれぞれ ''root'' と ''pandora'' になります。//これらの値は、ユーザを指定せずにバックアップを作成する (自動) ために **必要** です。//
  
-<WRAP center round important 75%>+<WRAP center round important 90%>
  
-It is important that the ''server_id''  token is different in all nodesin this example for node 1 this number is used.+It is important that the ''server_id'' //token// is different on all nodesin this example, that number is used for node 1.
  
 </WRAP> </WRAP>
  
-<WRAP center round important 75%>+<WRAP center round important 90%>
  
-''server_id'' トークンがすべてのノードで異なることが重要です。この例ノード 1 でこの番号が使用されています。+すべてのノードで ''server_id'' トークンが異なることが重要です。この例の番号はノード 1 使用されます。
  
 </WRAP> </WRAP>
  
-=== ノード 2 ===+**Node 2** 
 + 
 +**ノード 2**
  
-Node 2 ''/etc/my.cnf'' ( ''/etc/mysql/my.cnf'' for Ubuntu server)+Node 2 ''/etc/my.cnf'' (''/etc/mysql/my.cnf'' on Ubuntu server ):
  
-ノード 2 ''/etc/my.cnf'' ( Ubuntu server の場合は ''/etc/mysql/my.cnf'' )+ノード 2 ''/etc/my.cnf'' (Ubuntu サーバでは ''/etc/mysql/my.cnf''):
  
 <code> <code>
行 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
 +#log-bin=/path                     # Uncomment for adding an additional storage path for binlogs and setting a new path
 +#log-bin-index=/path/archive.index # Uncomment for adding an additional storage path for binlogs and setting a new path
 sync_source_info=1 sync_source_info=1
 sync_binlog=1 sync_binlog=1
行 597: 行 758:
 </code> </code>
  
-  * The tokens after the **OPTIMIZATION FOR PANDORA FMS**  comment perform the optimized configuration for Pandora FMS. +  * The //tokens// following the **OPTIMIZATION FOR PANDORA FMS** comment perform the optimized configuration for Pandora FMS. 
-  * After the comment **SPECIFIC PARAMETERS FOR BINARY REPLICATION**  the specific parameters for the binary replication are configured. +  * After the **SPECIFIC PARAMETERS FOR BINARY REPLICATION** comment, the specific parameters for binary replication are configured. 
-  * The token called ''binlog_expire_logs_seconds''  is configured for a period of two days. +  * The //token// called ''binlog_expire_logs_seconds'' is set for a period of two days. 
-  * In the ''[client]''  subsection enter the user and password used for the databaseby default when installing PFMS they are ''root''  and ''pandora''  respectively. //These values are **necessary**  to perform the backups without indicating user (automated).//+  * In the ''[client]'' subsectionenter the user and password used for the databaseby defaultwhen installing PFMS they are ''root'' and ''pandora'' respectively. //These values are **necessary** for making backups without specifying a user (automated)//.
  
-  * **OPTIMIZATION FOR PANDORA FMS** というコメントの後の設定は、Pandora FMS 用に最適化された設定す。 +  * **OPTIMIZATION FOR PANDORA FMS** コメントに続く //トークン// は、Pandora FMS 最適化された設定を実行します。 
-  * コメント **SPECIFIC PARAMETERS FOR BINARY REPLICATION** の後に、バイナリレプリケーションのための特定パラメーターを設定しています。 +  * **SPECIFIC PARAMETERS FOR BINARY REPLICATION** コメントの後に、バイナリレプリケーションの特定パラメータ設定されます。 
-  * ''binlog_expire_logs_seconds'' というトークンは、2 日で設定しています。 +  * ''binlog_expire_logs_seconds'' という //トークン// は、2 日間有効です。 
-  * ''[client]'' サブセクション、データベース使用するユーザとパスワードを入力します。Pandora FMS をインストールするときのデフォルトでは、それぞれ ''root'' と ''pandora'' す。 //これらの値は、ユーザの入力無し(自動化された)バックアップを実行するために **必要**です。// +  * ''[client]'' サブセクションには、データベース使用するユーザー名とパスワードを入力します。デフォルトでは、PFMS のインストール時にそれぞれ ''root'' と ''pandora'' になります。//これらの値は、ユーザを指定せずにバックアップを作成する (自動) ために **必要** です。//
-  +
-<WRAP center round important 75%>+
  
-It is important that the ''server_id''  token is different in all nodesin this example for node 2 this number is used.+<WRAP center round important 90%> 
 + 
 +It is important that the ''server_id'' //token// is different on all nodesin this example, that corresponding number is used for node 2.
  
 </WRAP> </WRAP>
  
-<WRAP center round important 75%>+<WRAP center round important 90%>
  
-''server_id'' トークンがすべてのノードで異なることが重要です。この例ノード 2 でこの番号が使用されています。+すべてのノードで ''server_id'' トークンが異なることが重要です。この例の番号はノード 2 使用されます。
  
 </WRAP> </WRAP>
  
-=== マスターノード設定 ===+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 ''mysqld'' service:+両方のノードで実行
  
-**1.-** ''mysqld'' サービスを開始します:+**On Rocky Linux 9**: 
 + 
 +**Rocky Linux 9 の場合**:
  
 <code bash> <code bash>
-systemctl start mysqld +systemctl restart mysqld
- +
 </code> </code>
  
-**2.-** Access with the temporary **root** password that will have been generated in the log, the file ''/var/log/mysqld.log'': 
  
-**2.-** ログファイル ''/var/log/mysqld.log'' に書かれているテンポラリの **root** パスワードでアクセスします:+**On Ubuntu Server 22.04**:
  
-<code bash> +**Ubuntu Server 22.04 の場合**:
-grep "temporary password" /var/log/mysqld.log +
- +
- +
-</code> +
- +
-With the password that appears, access MySQL server: +
- +
-見つけたパスワードで、MySQL サーバへアクセスします:+
  
 <code bash> <code bash>
-mysql -u root -p +systemctl restart mysql
- +
 </code> </code>
  
-''Password'': → Enter the password observed with the **grep** command.+<wrap #ks6_2_3_3 />
  
-''Password'': → **grep** コマンドで見つけたパスワードを入力します。+== DB の複製 ==
  
-**3.-** Change the temporary password to ''pandora'' of the **root** user. Remember that the **mysql >** prompt corresponds to the MySQL command interpreter (**MYSQL CLI**):+Database cloning: The next step consists of cloning the master database (**MASTER**) onto the slave node (**SLAVE**). To do this, follow these steps:
  
-**3.-** **root** ユーザのテンポラリパスワードを ''pandora'' 変更します。+データベースの複製作成:次のステップは、マスターデータベース(**MASTER**)をスレーブノード(**SLAVE**複製ることです。これを行うには、次の手順に従ってください
  
-<WRAP center round info 90%>+**1.-** Perform a full download (//dump//) of the **MASTER** database:
  
-In the following instructions the authentication method ''mysql_native_password'' is used, to use ''caching_sha2_password'' please refer to the topic "[[:en:documentation:pandorafms:technical_annexes:46_mysql_sha|SHA authentication method configuration in MySQL]]".+**1.-** **MASTER** データベースの完全ダウンロード(//dump//)を実行します。
  
-</WRAP>+**MASTER** #
  
-<WRAP center round info 90%>+<file> 
 +xtrabackup --backup --target-dir=/root/pandoradb.bak/
  
-以下の手順では、認証方法 ''mysql_native_password'' が使用されています。''caching_sha2_password'' を使用するには、トピック "[[:ja:documentation:pandorafms:technical_annexes:46_mysql_sha|MySQL での SHA 認証方法の設定]]" を参照してください。+</file>
  
-</WRAP>+**MASTER** #
  
-**mysql >** プロンプトは MySQL コマンドインタプリタ(**MYSQL CLI**)です。+<file> 
 +xtrabackup --prepare --target-dir=/root/pandoradb.bak/
  
-**mysql >** ''ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'Pandor4!';''+</file>
  
-**mysql >** ''UNINSTALL COMPONENT "file:component_validate_password";''+**2.-** Get the position of the binary //log// from the backup:
  
-**mysql >** ''ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'pandora';''+**2.-** バックアップからバイナリ //log// の位置を取得します。
  
-**4.-** Create the binary replication user and **root** user for remote connections and cluster administration:+**MASTER** # ''cat /root/pandoradb.bak/xtrabackup_binlog_info''
  
-**4.-** バイナリレプリケーションユーザおよび、リモート接続とクラスタ管理のための **root** ユーザを作成します:+It will return something like the following:
  
-**mysql >** ''CREATE USER slaveuser@'%' IDENTIFIED WITH mysql_native_password BY 'pandora';''+以下のような結果が返されます。
  
-**mysql >** ''GRANT REPLICATION CLIENT, REPLICATION SLAVE on *.* to slaveuser@'%';''+<file> 
 +binlog.000003 157 
 +</file>
  
-**mysql >** ''CREATE USER root@'%' IDENTIFIED WITH mysql_native_password BY 'pandora';''+//Take note of these two values as they are required for step number 6.//
  
-**mysql >** ''GRANT ALL PRIVILEGES ON *.* to root@'%';''+//これらの 2つの値はステップ 6で必要となるため、メモしておいてください。//
  
-**5.-** Create Pandora FMS database:+Stop MySQL service on the Slave Server:
  
-**5.-** Pandora FMS デタベースを作成します:+スレーブサバ上の MySQL サスを停止します
  
-**mysql >** ''create database pandora;''+**On Rocky Linux 9**:
  
-**mysql >** ''use pandora;''+**Rocky Linux 9 の場合**:
  
-**mysql >** ''source /var/www/html/pandora_console/pandoradb.sql''+<code bash> 
 +systemctl stop mysqld 
 +</code>
  
-**mysql >** ''source /var/www/html/pandora_console/pandoradb_data.sql'' 
  
-<WRAP center round info 60%>+**On Ubuntu Server 22.04**:
  
-For the **source** commandAs 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** ド: 同じサーバへ Pandora FMS コソールインストールしている場合。//そうでなければ、このァイルをマスターサーバへコピーします。//+すべてのコン削除(デトDB削除):
  
-</WRAP>+<code bash> 
 +rm -rf /var/lib/mysql/
 +</code>
  
-6.- Create the pandora user and give the access privileges to this user:+To avoid problems, we will also stop the ''pandora_ha'' service on both nodes.
  
-**6.-** pandora ユーザ作成しザにアクセ権限を与えます:+問題回避するため両方ドで ''pandora_ha'' サービも停止します
  
-**mysql >** ''CREATE USER pandora@'%' IDENTIFIED WITH mysql_native_password BY 'pandora';''+<code bash> 
 +systemctl stop pandora_ha 
 +</code>
  
-**mysql >** ''grant all privileges on pandora.* to pandora@'%';''+**3.-** Make a copy using **rsync** with the **SLAVE*server to send the performed backup:
  
-<WRAP center round box 75%>+**3.-** **rsync** を使用して **SLAVE** サーバにバックアップを送信するためのコピーを作成します。
  
-At this point you have the master server ready to start replicating Pandora FMS database.+**MASTER** # ''rsync -avpP -e ssh /root/pandoradb.bak/ pandoraha2:/var/lib/mysql/''
  
-</WRAP>+**4.-** On the **SLAVE** server, configure the permissions so that the MySQL server can seamlessly access the sent files:
  
-<WRAP center round box 75%> +**4.-** スレーブサーバで、MySQL サーバが送信されたファイルにシームレスにアクセスできるように権限を設定します
- +
-これで、Pandora FMS データベースのレプリケーションを開始するためのマスターサーバの準備が完了です。 +
- +
-</WRAP> +
- +
-=== データベースの複製 === +
- +
-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** # ''xtrabackup –backup –target-dir=/root/pandoradb.bak/'' +
- +
-**MASTER** # ''xtrabackup –prepare –target-dir=/root/pandoradb.bak/'' +
- +
-**2.-** Get the position of the backup binary log: +
- +
-**2.-** バックアップバイナリログのポジションを取得します: +
- +
-**MASTER** # ''cat /root/pandoradb.bak/xtrabackup_binlog_info'' +
- +
-It will return something like the following: +
- +
-次のような出力があります: +
- +
-<file> +
-binlog.000003 157 +
- +
-</file> +
- +
-//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** # ''rsync -avpP -e ssh /root/pandoradb.bak/ node2:/var/lib/mysql/'' +
- +
-**4.-** On the **SLAVE** server, configure the permissions so that the MySQL server can access the files sent without any problem: +
- +
-**4.-** **SLAVE** サーバで、問題なく MySQL サーバがファイルにアクセスできるようにパーミッションを設定します:+
  
 **SLAVE** # ''chown -R mysql:mysql /var/lib/mysql'' **SLAVE** # ''chown -R mysql:mysql /var/lib/mysql''
行 788: 行 902:
 **5.-** Start the ''mysqld'' service on the **SLAVE** server: **5.-** Start the ''mysqld'' service on the **SLAVE** server:
  
-**5.-** **SLAVE** サーバで''mysqld'' サービスを開始します:+**5.-** スレーブサーバで ''mysql'' サービスを開始します
  
-<code>+<code bash>
 systemctl start mysqld systemctl start mysqld
- 
 </code> </code>
  
-**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.-** このサーバで SLAVE モードを開始します(手順 2 で確認したデータを用します):+**6.-** このサーバでスレーブモードを開始します手順2でメモしたデータを使用します)。
  
 **SLAVE** # ''mysql -u root -ppandora'' **SLAVE** # ''mysql -u root -ppandora''
行 804: 行 917:
  
 **SLAVE** # **mysql >** **SLAVE** # **mysql >**
 +
 <code> <code>
-CHANGE MASTER TO MASTER_HOST='nodo1', +CHANGE MASTER TO MASTER_HOST='pandoraha1', 
- MASTER_USER='slaveuser',+ MASTER_USER='replicationuser',
  MASTER_PASSWORD='pandora',  MASTER_PASSWORD='pandora',
  MASTER_LOG_FILE='binlog.000003',  MASTER_LOG_FILE='binlog.000003',
  MASTER_LOG_POS=157;  MASTER_LOG_POS=157;
- 
 </code> </code>
  
行 817: 行 930:
 **SLAVE** # **mysql >** ''SET GLOBAL read_only=1;'' **SLAVE** # **mysql >** ''SET GLOBAL read_only=1;''
  
-Once you are done with all these steps, if you run the ''show slave status'' command inside the MySQL shell you will notice that the node is set as slave. If it has been configured correctly you should see an output like the following:+Once you have finished with all these steps, if you run the ''show slave status'' command inside the MySQL //shell// you will notice that the node is in //slave// mode. If set up correctlyan output similar to the following should be seen:
  
-これらのすべての手順が完了したら、MySQL シェル内で ''show slave status'' コマンドを実行すると、ノードがスレーブとして設定されていることがわかります。 正しく設定されている場合は、次のような出力が表示されます。+これらの手順をすべて完了したら、MySQL シェル内で ''show slave status'' コマンドを実行すると、ノードがスレーブモードになっていることがわかります。正しく設定されていれば、次のような出力が表示されます。
  
 <code> <code>
 *************************** 1. row *************************** *************************** 1. row ***************************
 Slave_IO_State: Waiting for source to send event Slave_IO_State: Waiting for source to send event
-Master_Host: node1+Master_Host: pandoraha1
 Master_User: root Master_User: root
 Master_Port: 3306 Master_Port: 3306
行 888: 行 1001:
 </code> </code>
  
-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 
 +</code>
  
-<WRAP center round info 60%>+<code sql> 
 +CHANGE REPLICATION SOURCE TO 
 +SOURCE_HOST='pandoraha1', -- Enter the IP or dns address of your MASTER MySQL server 
 +SOURCE_USER='replicationuser', -- Enter the replication username 
 +SOURCE_PASSWORD='pandora', -- Enter the replication password 
 +SOURCE_LOG_FILE='binlog.000003', -- Update to the values retrieved on previous step 
 +SOURCE_LOG_POS=157 -- Update to the values retrieved on previous step 
 +
 +</code> 
 + 
 +We start the replica and verify that everything is correct: 
 + 
 +レプリカを起動し、すべてが正しいことを確認します。 
 + 
 +<code mysql> 
 +STOP REPLICA; 
 +  
 +START REPLICA; 
 +SHOW REPLICA STATUS\G 
 +</code> 
 + 
 +We verify that the replica is correct by running the ''show slave status'' command and confirming the output: 
 + 
 +''show slave status'' コマンドを実行し、その出力を確認することで、レプリカが正しいことを検証します。 
 + 
 +<code> 
 +      Replica_IO_Running: Yes 
 +      Replica_SQL_Running: Yes 
 +</code> 
 + 
 +Both must be set to ''Yes''
 + 
 +両方とも ''Yes'' になっている必要があります。 
 + 
 +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> </WRAP>
  
-<WRAP center round info 60%>+<WRAP center round info 90%>
  
-バージョン 770 以+バージョン 770 以
  
 </WRAP> </WRAP>
  
-It is necessary to configure inside [[:en:documentation:pandorafms:installation:04_configuration#server|the pandora_server.conf file]] a series of necessary parameters for the correct operation of the ''pandora_ha''.+It is necessary to configure within the [[:en:documentation:pandorafms:installation:04_configuration#ks2|pandora_server.conf file]] a series of parameters needed for the proper functioning of ''pandora_ha''.
  
-[[:ja:documentation:pandorafms:installation:04_configuration#サーバ|pandora_server.conf ファイル]] 内で、''pandora_ha'' が正しく動作するために必要な一連のパラメータを設定する必要があります。+''pandora_ha'' が正しく機能するために必要な一連のパラメータを、[[:ja:documentation:pandorafms:installation:04_configuration#ks2|pandora_server.conf ファイル]]内で設定する必要があります。
  
 The parameters to be added are the following: The parameters to be added are the following:
  
-追加するパラメータはりです。+追加するパラメータは以下とおりです。
  
-  * **ha_hosts <IP_ADDRESS1>,<IP_ADDRESS2>**  : +  * **ha_hosts <IP_ADDRESS1>,<IP_ADDRESS2>**:
-Configure the ''ha_host''  parameter followed by the IP addresses or FQDN of the MySQL servers that make up the HA environment. The IP address you put first will have preference to be the **MASTER**  server or at least have the master role when you first start the HA environment. Example:+
  
-  * **ha_hosts <IPアドレス1>,<IPアドレス2>**  +The ''ha_host'' parameter must be configured followed by the IP addresses or FQDN of the MySQL servers that make up the HA environment. The IP address placed first will have preference to be the **MASTER** server or at least it has the master role when the HA environment is started for the first time. Example
-HA 環境を構成する MySQL サーバの IP アドレスまたは FQDN を指定する ''ha_host'' パラメーターを設定します。 最初に入力した IP アドレスは、**MASTER** サーバにるか、HA 環境最初に開始するときに少なくともマスターの役割を持つサーバです。 例:+ 
 +''ha_host'' パラメータを設定した後、HA 環境を構成する MySQL サーバの IP アドレスまたは FQDN を指定する必要があります。最初に指定された IP アドレスが **MASTER** サーバとして優先的使用されるか、少なくとも HA 環境最初に起動されたときにマスターの役割を持ちます。例:
  
 <code> <code>
行 925: 行 1086:
 </code> </code>
  
-  * **ha_dbuser**  and **ha_dbpass** +  * **ha_dbuser** and **ha_dbpass**
-These are the parameters where you must indicate the user and password of **root**  user or otherwise a MySQL user with the maximum privileges that will be in charge of performing all the //master - slave//  promotion operations on the nodes. Example:+ 
 +  * **ha_dbuser** および **ha_dbpass**: 
 + 
 +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:
  
-  * **ha_dbuser**  および **ha_dbpass** +これらは、**root** ユーザとパスワードを指定するパラメータです。それができない場合は、ノード上のすべてのマスター/スレーブ昇格操作実行を監視す最大を持つ MySQL ユーザを指定ます。例:
-これらは、**root** ユーザのユーザとパスワードを指定する必要があるパラメータです。root 以外の場合は、ノードで //マスター スレーブ// 昇格操作実行でき権を持つ MySQL ユーザを指定する必要があります。 例+
  
 <code> <code>
行 937: 行 1100:
 </code> </code>
  
-  * **repl_dbuser**  and **repl_dbpass**  : +  * **repl_dbuser** and **repl_dbpass**:
-Parameters to define the replication user that will use the **SLAVE**  to connect to the **MASTER**. Example:+
  
-  * **repl_dbuser**  および **repl_dbpass**  +  * **repl_dbuser** および **repl_dbpass**: 
-**SLAVE** から **MASTER** に接続するレプリケーションユーザを定義するパラメータです。 例:+ 
 +Parameters to define the replication user that the **SLAVE** will use to connect to the **MASTER**. Example: 
 + 
 +**SLAVE** が **MASTER** に接続するために使用するレプリケーションユーザを定義するパラメータ。例:
  
 <code> <code>
-repl_dbuser slaveuser+repl_dbuser replicationuser
 repl_dbpass pandora repl_dbpass pandora
  
 </code> </code>
  
-  * **ha_sshuser**  and **ha_sshport**  : +  * **ha_sshuser** and **ha_sshport**:
-Parameters to define the user/port with which it is connected by **ssh**  to the Percona/MySQL servers to perform the recovery operations. For the correct operation of this option, it is necessary to have the ssh keys shared between the user with which the ''pandora_ha''  service is executed and the user indicated in the ''ha_sshuser''  parameter. Example:+
  
-  * **ha_sshuser** および **ha_sshport**  +  * **ha_sshuser** および **ha_sshport**: 
-リカバリ操作を実行するために **ssh** によって Percona/MySQL サーバに接続されるユーザ/ポートを定義するパラメータです。このオプション正しく動作させるには、''pandora_ha'' サービスを実行るユーザと ''ha_sshuser'' パラメータで指定されたユーザの間で ssh キーを共有する必要があります。 例+ 
 +Parameters to define the user/port with which to connect via **ssh** to the Percona/MySQL servers to perform recovery operations. For this option to work properly, it is necessary to share the **ssh** keys between the user running the ''pandora_ha'' service and the user specified in the **ha_sshuser** parameter. Example: 
 + 
 +リカバリ操作を実行するために**ssh** 経由で Percona/MySQL サーバに接続るユーザ/ポートを定義するパラメータ。このオプション正しく機能するには、''pandora_ha'' サービスを実行しているユーザと **ha_sshuser** パラメータで指定されたユーザの間で **ssh** キーを共有する必要があります。例:
  
 <code> <code>
行 961: 行 1128:
 </code> </code>
  
-  * **ha_resync**''PATH_SCRIPT_RESYNC''  : +  * **ha_resync**''PATH_SCRIPT_RESYNC'':
-By default the script to perform the resynchronization of the nodes, this is located at:+
  
-  * **ha_resync**''PATH_SCRIPT_RESYNC''  +By default, the //script// to resynchronize the nodes is located at: 
-デフォルトでは、ノード再同期を実行するスクリプトは次の場所にありますP+ 
 +デフォルトでは、ノード再同期するためのスクリプトは次の場所にあります
  
 <file> <file>
- /usr/share/pandora_server/util/pandora_ha_resync_slave.sh+/usr/share/pandora_server/util/pandora_ha_resync_slave.sh
  
 </file> </file>
  
-In the case of having a customized installation of the script, indicate in this parameter its location to perform the automatic or manual synchronization of the **SLAVE**  node when needed.+If having a custom installation of the //script//, indicate its location in this parameter so that the automatic or manual synchronization of the **SLAVE** node is carried out when needed.
  
-スクリプトをカスタマイズしてインストールる場合は、必要に応じて **SLAVE** ノードの自動または手動同期実行するスクリプトの場所をこのパラメータで指定します。+//スクリプト// をカスタインストールしている場合は、このパラメーターでその場所を指定しください。そうすることで、**SLAVE** ノードの自動または手動同期が必要に応じて実行されます。
  
 <code> <code>
行 981: 行 1148:
 </code> </code>
  
-  * **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: 
-前のトークンで設定された同期スクリプト実行に関するすべての情報が格納されるログのパスです。 例+ 
 +前のトークンで設定されたスクリプトによって実行されたすべての情報を保存するログファイルのパス。例:
  
 <code> <code>
 ha_resync_log /var/log/pandoraha_resync.log ha_resync_log /var/log/pandoraha_resync.log
- 
 </code> </code>
  
-  * **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 環境サーバで各チェックで実され再試行の数。例:
  
 <code> <code>
行 1003: 行 1169:
 </code> </code>
  
-Once all these parameters are configured, you could start Pandora FMS server with the ''pandora_ha''  service. The server will get an image of the environment and it will know at that moment who is the **MASTER**  server.+Once all these parameters are configured, you can start the Pandora FMS server with the ''pandora_ha'' service. The server will obtain an image of the environment and will know at that moment which one is the **MASTER** server. 
 + 
 +これらのパラメータをすべて設定したら、''pandora_ha'' サービスを使用してPandora FMS サーバを起動できます。サーバは環境イメージを取得し、その時点でどのサーバが **MASTER** サーバであるかを認識します。
  
-これらのパラメータをすべて設定したら、''pandora_ha'' サービスで Pandora FMS サーバを起動できます。 サーバは環境の状態を取得し、その時点でどれが **MASTER** サーバであるかを認識します。+When it knows it, it will create the ''pandora_ha_hosts.conf'' file in the ''/var/spool/pandora/data_in/conf/'' folder, where it will indicate at all times the Percona/MySQL server that has the **MASTER** role.
  
-When it knows it, it will create the ''pandora_ha_hosts.conf''  file in the ''/var/spool/pandora/data_in/conf/ folder'', where the Percona/MySQL server that has the **MASTER**  role will be indicated at all times.+システムがそれを認識すると、''/var/spool/pandora/data_in/conf/'' フォルダーに ''pandora_ha_hosts.conf'' ファイルを作成し、常に **MASTER** ロールを持つ Percona/MySQL サーバを指定します。
  
-それを認識すると、''/var/spool/pandora/data_in/conf/'' フォルダに ''pandora_ha_hosts.conf'' ファイルが作成されます。これには、**MASTER** の役割を持つ Percona/MySQL サーバが常に示されています。+In the event that the ''incomingdir'' parameter of the ''pandora_server.conf'' file contains a different path (PATH), this file will be located in that PATH.
  
-In case the ''incomingdir''  parameter of the ''pandora_server.conf''  file contains a different path (PATH), this file will be located at that PATH.+''pandora_server.conf'' ファイルの ''incomingdir'' パラメータに別のパス(PATH)が指定されている場合、このファイルはそのパスに配置されます。
  
-''pandora_server.conf'' ファイルの ''incomingdir'' パラメータに別のパス (PATH) が指定されている場合、このファイルはそのパスに配置されます。+This file will be used as an exchange with the Pandora FMS Console so that it knows at all times the IP address of the Percona/MySQL server with the **MASTER** role.
  
-This file will be used as an interchange with the Pandora FMS Console to know at any time the IP address of the Percona/MySQL server with **MASTER**  role.+このファイルは、Pandora FMS Console とのやり取りに使用され、**MASTER** ロールを持つ Percona/MySQL サーバの IP アドレスを常に把握できるようにします。
  
-このファイルは、**MASTER** の役割を持つ Percona/MySQL サーバの IP アドレスをいつでも知れるように、Pandora FMS コンソールでも使用されます。+  * **restart**:
  
-  * **restart** +It will be indicated with a value of ''0'', since the **pandora_ha** //daemon// is in charge of restarting the service in case of failure and thus possible conflicts are avoided. Example:
-It will be indicated with a value of ''0'', since the **pandora_ha**  daemon is the one in charge of restarting the service in case of failurethus avoiding possible conflicts. Example:+
  
-**pandora_ha** デーモンは、競合を回避しな障害時サービス再起動を行うため、通常は値は ''0'' です。 例+**pandora_ha** //デーモン// が障害発生サービス再起動する役割担っているため、競合が発生する可能性があり、その場合は ''0'' という値示されます。例:
  
 <code> <code>
行 1030: 行 1197:
 </code> </code>
  
-=== サーバ間の 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:+  * **ha_backup_source_dir**:
  
-OpenSSH サーバがインストールされ、各ホストで動作している必要があります。OpenSSH を表示するウェルカムメッセージまたはバナーを抑制します。**すべて** のデバイスで以下を実行します:+Directory that will contain the HA backup data. Default value''/var/tmp''.
  
-<code> +HA バックアップデータが格納されるディレクトリ。デフォルト値: ''/var/tmp''。
-[ -f /etc/cron.hourly/motd_rebuild ] && rm -f /etc/cron.hourly/motd_rebuild +
-sed -i -e 's/^Banner.*//g/etc/ssh/sshd_config +
-systemctl restart sshd+
  
 +  * **ha_mysql_source_dir**:
 +
 +Directory that contains the MySQL data. Default value: ''/var/lib''.
 +
 +MySQL データが格納されているディレクトリ。デフォルト値: ''/var/lib''
 +
 +Once the modifications are made in the configuration file, we start ''pandora_ha'' on both nodes:
 +
 +設定ファイルに変更を加えたら、両方のノードで ''pandora_ha'' を起動します。
 +
 +<code bash>
 +systemctl start pandora_ha
 </code> </code>
  
-Share the SSH keys between ''pandora_ha'' and all the existing Percona/MySQL servers in the environment, **run on Pandora FMS server**:+<wrap #ks6_2_4_2 />
  
-''pandora_ha'' と環境内に存在するすべての Percona/MySQL サーバ間で SSH 鍵を共有します。**Pandora FMS バで以下を実行します**:+== Pandora FMS コンソルの調整 ==
  
-<code> +The Console'''config.php'' file located at
-printf "\n\n\n" | ssh-keygen -t rsa -P '' +
-ssh-copy-id -p22 root@node1 +
-ssh-copy-id -p22 root@node2+
  
 +コンソールの ''config.php'' ファイルは、以下にあります。
 +
 +<file>
 +/var/www/html/pandora_console/include/
 +</file>
 +
 +must be configured, adding the following value:
 +
 +以下の値を追加して設定する必要があります。
 +
 +<code php>
 +$config["remote_config"] = "/var/spool/pandora/data_in";
 </code> </code>
  
-<WRAP center round important 75%>+Looking as follows:
  
-  * In case you have the installation on Ubuntu Server, enable the **root**  user to connect via SSH. This is done by generating a password to the root user by executing the ''sudo passwd root''  command. +見た目は以下のようになります。
-  * Then enable the SSH connection of the root user at least through shared keys "**PermitRootLogin without-password**" in the configuration file of the ''sshd''  service.+
  
-</WRAP>+{{  :wiki:pfms_ha-config_php.png  }}
  
-<WRAP center round important 75%>+With this, Pandora FMS will read the file
  
-  * Ubuntu Server にインストーしている場合は、**root** ユーザが SSH 経由で接続できるようします。 これは、''sudo passwd root'' コマンを実行して root ユーザにパワードを設定するとによって行えます。 +これより、Pandora FMS はファイルを読み込みます。 
-  * 次に、''sshd''ビスの設定ファイルにある "**PermitRootLogin without-password**" を使用して、root ユーザの SSH 接続を有効にします。+ 
 +<file> 
 +/var/spool/pandora/data_in/conf/pandora_ha_hosts.conf 
 +</file> 
 + 
 +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> </WRAP>
  
-=== 同期スクリプトの利用 ===+<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** データベースを同期できるようにするスクリプトが実装されています。+</WRAP>
  
-The manual execution of this script is the following:+A new parameter has been added to the ''config.php'' configuration indicating the path of the exchange directory used by Pandora FMS by default ''/var/spool/pandora/data_in''.
  
-リプトの手動実行次の通りです:+Pandora FMS がデフォルトで使用する交換ディレクトパスを示す新しいパラメータが ''config.php'' 設定に追加されました。デフォルトでは ''/var/spool/pandora/data_in'' です。 
 + 
 +If configured, it will look for the file ''/var/spool/pandora/data_in/conf/pandora_ha_hosts.conf'' from where it will obtain the IP address to make the connection. 
 + 
 +設定されている場合、接続に必要な IP アドレスを取得するために、ファイル ''/var/spool/pandora/data_in/conf/pandora_ha_hosts.conf'' を検索します。
  
 <code> <code>
-./pandora_ha_resync_slave.sh "pandora_server.conf fileMASTER SLAVE+$config["remote_config"] = "/var/spool/pandora/data_in";
  
 </code> </code>
  
-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 管理画面にアクセスすることでクラスタ状態を確認できます
  
 <code> <code>
-/usr/share/pandora_server/util/pandora_ha_resync_slave.sh /etc/pandora/pandora_server.conf node1 node2+https://PANDORA_IP/pandora_console/index.php?sec=gservers&sec2=enterprise/godmode/servers/HA_cluster
  
 </code> </code>
  
-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 ''splitbrain_autofix'' configured to 1, inside the server configuration file (''/etc/pandora/pandora_server.conf'').+{{  :wiki:pfms-servers-manage_database_ha-view_nodes-mr70.png  }}
  
-**MASTER** と **SLAVE** の間で同期の問題が発生した際に HA 環境の自動回復を設定するには、サーバ設定ファイル(''/etc/pandora/pandora_server.conf'')内の設定トークン ''splitbrain_autofix'' を 1 にする必要があります。 +The data in this view are constantly updated thanks to ''pandora_ha''; no previous configuration procedure needs to be done to be able to view this section as long as ''pandora_server.conf'' is correctly configured with the parameters mentioned in the previous section.
  
-So, whenever a [[#ks6_6|Split-Brain]] takes place (both servers have the master role) or there is any synchronization problem between **MASTER**  and **SLAVE**  node, ''pandora_ha''  will try to launch the ''pandora_ha_resync_slave.sh''  script to synchronize from that point the MASTER server status in the SLAVE server.+この画面のデータは ''pandora_ha'' により常に更新されます。前のセクションで説明したパラメータを使用して ''pandora_server.conf'' が正しく設定されていれば、このセクションを表示するために事前の設定手順は必要ありません。
  
-そうすると、[[#スプリットブレイン|スプリットブレイン]] が発生した場合 (両方のサーバがマスターの役割を持っている場合)、または **MASTER** と **SLAVE** の間で同期の問題が発生した場合は、常に ''pandora_ha'' が ''pandora_ha_resync_slave.sh'' スクリプトを起動して、その時点のマスターサーバの状態をスレーブサーバへ同期しようとします。+Among the available actions, you can configure a label for each node and you can perform the option to synchronize the **SLAVE** node using the icon{{:wiki:pfms-servers-manage_database_ha-resync_node_icon.png?nolink&}}.
  
-This process will generate events in the system indicating the start, the end and if any error took place in there.+利用可能なアクションの中には、各ノードのラベルを設定したり、アイコン{{:wiki:pfms-servers-manage_database_ha-resync_node_icon.png?nolink&}}を使用して **SLAVE** ノードを同期するオプションを実行したりすることができます。
  
-この処理は、開始、終了、およびそこでエラーが発生したかどうかを示すイベントをシステムで生成します。+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 />
  
-</WRAP>+=== HA 表示 ===
  
-<WRAP center round info 60%>+<wrap #ks6_2_6_1 />
  
-バージョン 770 以降+== 動作検証 ==
  
-</WRAP>+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 ''config.php'' configuration indicating the path of the exchange directory that Pandora FMS uses by default ''/var/spool/pandora/data_in''.+上記の手順を完了したら、HA 管理画面にアクセスしてクラスタの状態を確認できます。
  
-Pandora FMS が使用するデータ受け取りディレクトリのパス、デフォルトでは ''/var/spool/pandora/data_in'' を示す新しいパラメータが ''config.php'' に追加されました。+<file> 
 +https://PANDORA_IP/pandora_console/index.php?sec=gservers&sec2=enterprise/godmode/servers/new_HA_cluster 
 +</file>
  
-If it is configured, it will look for the file ''/var/spool/pandora/data_in/conf/pandora_ha_hosts.conf'' where it will get the IP address to make the connection.+{{  :wiki:pfms_ha-manage_database_ha.png  }}
  
-設定されている場合、''/var/spool/pandora/data_in/conf/pandora_ha_hosts.conf'' ファイルを探して、接続先の IP アドレスを取得します。+In it, we will see information about the connection and replication status:
  
-<code> +そこには、接続とレプリケーションのステータスに関する情報が表示されます。
-$config["remote_config"] = "/var/spool/pandora/data_in";+
  
-</code>+  * <wrap :en>**IP**</wrap>: IP addresses of the nodes forming the cluster. 
 +  * <wrap :en>**Node label**</wrap>: Identifying labels that can be configured for the nodes. 
 +  * <wrap :en>**SQL Node status**</wrap>: MySQL service status. 
 +  * <wrap :en>**SSH**</wrap>: SSH connection status. 
 +  * <wrap :en>**Replication Status**</wrap>: Replication status. 
 +  * <wrap :en>**DB Role**</wrap>: The roles in the nodes forming the cluster to identify the Master. 
 +  * <wrap :en>**Delay**</wrap>: //Delay// time or how long it takes the non-Master node to receive DB changes. 
 +  * <wrap :en>**Last Update**</wrap>: Time of the last update. 
 +  * <wrap :en>**SQL version**</wrap>: Installed MySQL version. 
 +  * <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)**: //遅延時間// マスター以外のノードがDBの変更を受信するまでの時間。 
 +  * **最終更新(Last Update)**: 最終更新時刻。 
 +  * <wrap :ja>**SQL バージョン(SQL version)**</wrap>: インストールされている MySQL のバージョン。 
 +  * <wrap :ja>**DB バージョン(DB version)**</wrap>: Pandora FMS データベースにインストールされているスキーマのバージョン。
  
-Pandora FMS コンソールでは、HA 管理画面にアクセスしてクラスタの状態を確認できます。+<wrap #ks6_2_6_2 />
  
-<code> +== 可能なアクション ==
-https://PANDORA_IP/pandora_console/index.php?sec=gservers&sec2=enterprise/godmode/servers/HA_cluster+
  
 +In the last column of the HA view, we have different actions we can run:
 +
 +HA 画面の最後の列には、実行可能なさまざまなアクションが表示されます。
 +
 +  * {{:wiki:pfms_ha-icon_edit.png?nolink&21x21}} Used to edit the <wrap :en>**Node label**</wrap> field.
 +  * {{:wiki:pfms_ha-icon_enable.png?nolink&21x21}} Used to disable/enable the slave node.
 +  * {{:wiki:pfms_ha-icon_status_db.png?nolink&21x21}} Used to launch resynchronization from the console and can have the following statuses:
 +
 +  * {{:wiki:pfms_ha-icon_edit.png?nolink&21x21}} <wrap :ja>**ノードラベル(Node label)**</wrap> フィールドを編集するために使用します。
 +  * {{:wiki:pfms_ha-icon_enable.png?nolink&21x21}} スレーブノードを無効化/有効化するために使用します。
 +  * {{:wiki:pfms_ha-icon_status_db.png?nolink&21x21}} コンソールから再同期を開始するために使用し、以下のステータスを持つことができます。
 +
 +  - **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.
 +
 +同期スクリプトの使用: Pandora FMS サーバでは、**SLAVE** データベースが同期されていない場合に同期できるようにするスクリプトが実装されています。
 +
 +The manual execution of this //script// is as follows:
 +
 +このスクリプトの手動実行方法は以下のとおりです。
 +
 +<code bash>
 +./pandora_ha_resync_slave.sh "pandora_server.conf file" MASTER SLAVE
 </code> </code>
  
-{{  :wiki:pfms-servers-manage_database_ha-view_nodes.png  }}+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 ''pandora_ha'', there is no need to do any previous configuration procedure to be able to see this section as long as the ''pandora_server.conf'' is correctly configured with the parameters mentioned in the previous section.+たとえば、ノード 1 をノード 2 に手動で同期するには、実行は次のようになります。
  
-この画面のデータは、''pandora_ha'' により常に更新されます。''pandora_server.conf'' で前述のパラメータが正しく設定されている限り、このデータを表示するための特別な設定はありません。+<code bash> 
 +/usr/share/pandora_server/util/pandora_ha_resync_slave.sh \  
 + /etc/pandora/pandora_server.conf \  
 + pandoraha1 \  
 + pandoraha2 
 +</code>
  
-Among the available actions, you may configure a label for each one of the nodes and you can perform the option to synchronize the **SLAVE** node through the icon{{:wiki:pfms-servers-manage_database_ha-resync_node_icon.png?nolink&}}.+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 ''splitbrain_autofix'' configuration //token// set to ''1'', within the server configuration file (''/etc/pandora/pandora_server.conf'').
  
-実行可能なアクションとしては、各ノードラベルを設定することができ{{:wiki:pfms-servers-manage_database_ha-resync_node_icon.png?nolink&}}アコンにて **SLAVE** ノ同期するオプションを実行できます。+**MASTER** と **SLAVE** 間で同期の問題が発生た場合にHA環境自動復旧を設定するにはサーバ設定ファル(/etc/pandora/pandora_server.conf)内の ''splitbrain_autofix'' 設定トクンを ''1'' に設定する必要があります。
  
-This icon can have the following states:+Thus, whenever a [[#ks6_6|Split-Brain]] occurs (both servers have the master role) or there is a synchronization problem between the **MASTER** and **SLAVE** node, ''pandora_ha'' will try to launch the ''pandora_ha_resync_slave.sh'' //script// to synchronize the MASTER server status on the SLAVE server from that moment on.
  
-このアンにはの状態があります。+したがって、[[#ks6_6|スプリットブレイン]]が発生するたび(両方のサーバがマスターの役割を持っている場合)、または **MASTER**ノードと **SLAVE** ノード間で同期の問題が発生するたび、''pandora_ha'' は ''pandora_ha_resync_slave.sh'' //スクリプト//を起動して、その時点からスレーブサーバ上で MASTER サーバの状態を同期しようとします。 
 + 
 +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. 
  
-  * **緑**: 正常、何の処理も実行されていない。 
-  * **青**: 同期保留中。 
-  * **黄**: 同期実行中。 
-  * **赤**: //エラー//、同期失敗。 
  
  
行 1199: 行 1464:
 **3.-** **MASTER** ノードで ''mysql_native_password'' トークンを指定しての全ユーザの再作成: **3.-** **MASTER** ノードで ''mysql_native_password'' トークンを指定しての全ユーザの再作成:
  
-**mysql** > ''CREATE USER slaveuser@% IDENTIFIED WITH mysql_native_password BY 'pandora';''+<WRAP center round info 90%> 
 + 
 +In the following instructions the authentication method ''mysql_native_password'' is used, to use ''caching_sha2_password'' please refer to the topic "[[:en:documentation:pandorafms:technical_annexes:46_mysql_sha|SHA authentication method configuration in MySQL]]"
 + 
 +</WRAP> 
 + 
 +<WRAP center round info 90%> 
 + 
 +以下の手順では、認証方法 ''mysql_native_password'' が使用されています。''caching_sha2_password'' を使用するには、トピック "[[:ja:documentation:pandorafms:technical_annexes:46_mysql_sha|MySQL での SHA 認証方法の設定]]" を参照してください。 
 + 
 +</WRAP> 
 + 
 +**mysql** > ''CREATE USER replicationuser@% IDENTIFIED WITH mysql_native_password BY 'pandora';''
  
-**mysql** > ''GRANT REPLICATION CLIENT, REPLICATION SLAVE on *.* to slaveuser@%;''+**mysql** > ''GRANT REPLICATION CLIENT, REPLICATION SLAVE on *.* to replicationuser@%;''
  
 **mysql** > ''CREATE USER pandora@% IDENTIFIED WITH mysql_native_password BY 'pandora';'' **mysql** > ''CREATE USER pandora@% IDENTIFIED WITH mysql_native_password BY 'pandora';''
行 1446: 行 1723:
 *************************** 1. row *************************** *************************** 1. row ***************************
                Slave_IO_State: Waiting for source to send event                Slave_IO_State: Waiting for source to send event
-                  Master_Host: node1+                  Master_Host: pandoraha1
                   Master_User: root                   Master_User: root
                   Master_Port: 3306                   Master_Port: 3306
行 1521: 行 1798:
 </WRAP> </WRAP>
  
-[[ja:documentation:start|Pandora FMS ドキュメント一覧に戻る]]+[[ja:documentation:pandorafms:start|Pandora FMS ドキュメント一覧に戻る]]
  
 ===== (OBSOLETE) データベース HA ===== ===== (OBSOLETE) データベース HA =====
  • ja/documentation/pandorafms/complex_environments_and_optimization/06_ha.1743944817.txt.gz
  • 最終更新: 2025/04/06 13:06
  • by junichi