ja:documentation:pandorafms:complex_environments_and_optimization:06_ha

差分

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

この比較画面へのリンク

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
ja:documentation:pandorafms:complex_environments_and_optimization:06_ha [2026/06/19 23:21] – [ノード 1] 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 ドキュメント一覧に戻る]]
- +
  
 ===== 概要 ===== ===== 概要 =====
行 1392: 行 1390:
 <wrap #ks6_3 /> <wrap #ks6_3 />
  
 +==== 手動 DB 再同期 ====
  
-=== ノード 2 ===+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.
  
-Node 2 ''/etc/my.cnf'' ( ''/etc/mysql/my.cnf'' for Ubuntu server)+同期スクリプトの使用: Pandora FMS サーバでは、**SLAVE** データベースが同期されていない場合に同期できるようにするスクリプトが実装されています。
  
-ノード 2 ''/etc/my.cnf'' ( Ubuntu server の場合は ''/etc/mysql/my.cnf'' )+The manual execution of this //script// is as follows:
  
-<code> +スクリプトの動実行方法は以下のとおりです。
-[mysqld] +
-server_id=2 # It is important that it is different in all nodes. +
-datadir=/var/lib/mysql +
-socket=/var/lib/mysql/mysql.sock +
-log-error=/var/log/mysqld.log +
-pid-file=/var/run/mysqld/mysqld.pid +
-# OPTIMIZATION FOR PANDORA FMS +
-innodb_buffer_pool_size = 4096M +
-innodb_lock_wait_timeout = 90 +
-innodb_file_per_table +
-innodb_flush_method = O_DIRECT +
-innodb_log_file_size = 64M +
-innodb_log_buffer_size = 16M +
-thread_cache_size = 8 +
-max_connections = 200 +
-key_buffer_size=4M +
-read_buffer_size=128K +
-read_rnd_buffer_size=128K +
-sort_buffer_size=128K +
-join_buffer_size=4M +
-sql_mode="" +
-# SPECIFIC PARAMETERS FOR BINARY REPLICATION +
-binlog-do-db=pandora +
-replicate-do-db=pandora +
-max_binlog_size = 100M +
-binlog-format=MIXED +
-binlog_expire_logs_seconds=172800 # 2 DAYS +
-sync_source_info=1 +
-sync_binlog=1 +
-port=3306 +
-report-port=3306 +
-report-host=master +
-gtid-mode=off +
-enforce-gtid-consistency=off +
-master-info-repository=TABLE +
-relay-log-info-repository=TABLE +
-sync_relay_log = 0 +
-replica_compressed_protocol = 1 +
-replica_parallel_workers = 1 +
-innodb_flush_log_at_trx_commit = 2 +
-innodb_flush_log_at_timeout = 1800 +
- +
-[client] +
-user=root +
-password=pandora +
- +
-</code> +
- +
-  * The tokens after 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. +
-  * The token called ''binlog_expire_logs_seconds''  is configured for a period of two days. +
-  * In the ''[client]''  subsection enter the user and password used for the database, by default when installing PFMS they are ''root''  and ''pandora''  respectively. //These values are **necessary**  to perform the backups without indicating user (automated).// +
- +
-  * **OPTIMIZATION FOR PANDORA FMS** というコメント後の設定は、Pandora FMS 用に最適化された設定です。 +
-  * コメント **SPECIFIC PARAMETERS FOR BINARY REPLICATION** の後に、バイナリケーションのための特定のパラメーターを設定しています。 +
-  * ''binlog_expire_logs_seconds'' というークンは、2 日で設定しています。 +
-  * ''[client]'' サブセクションで、データベースに使用するユーザとパスワードを入力します。Pandora FMS をインストールするときのデフォルトでは、それぞれ ''root'' と ''pandora'' です。 //これらの値は、ユーザ入力無しに(自化された)バックアップを実行するために **必要**です。// +
-  +
-<WRAP center round important 75%> +
- +
-It is important that the ''server_id''  token is different in all nodes, in this example for node 2 this number is used. +
- +
-</WRAP> +
- +
-<WRAP center round important 75%> +
- +
-''server_id'' トークンがすべてノードで異なるこが重要です。この例では、ノード 2 でこの番号が使用されています。 +
- +
-</WRAP> +
- +
-=== マスターノード設定 === +
- +
-Once you have the correct configuration on both nodes, start the configuration of the node //that will take the role of master server//. +
- +
-両方のノードで正しい設定ができたら、//マスターサーバの役割を果たすノードの設定を開始します//。 +
- +
-**1.-** Start the ''mysqld'' service: +
- +
-**1.-** ''mysqld'' サービスを開始します:+
  
 <code bash> <code bash>
-systemctl start mysqld +./pandora_ha_resync_slave.sh "pandora_server.conf file" MASTER SLAVE
- +
 </code> </code>
  
-**2.-** Access with the temporary **root** password that will have been generated in the log, the file ''/var/log/mysqld.log'':+For example, to manually synchronize node 1 to node 2, the execution would be as follows:
  
-**2.-** ログファイル ''/var/log/mysqld.log'' 書かれていテンポラリの **root** パスワードでアクセスします:+たとえば、ノード 1 をノード 2 に手動で同期すには、実行は次ようになります
  
 <code bash> <code bash>
-grep "temporary password" /var/log/mysqld.log +/usr/share/pandora_server/util/pandora_ha_resync_slave.sh \  
- + /etc/pandora/pandora_server.conf \  
 + pandoraha1 \  
 + pandoraha2
 </code> </code>
  
-With the password that appearsaccess MySQL server:+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'').
  
-見つけたパスワードで、MySQL サーバへアセスします:+**MASTER** と **SLAVE** 間同期の問題が発生した場合にHA環境の自動復旧を設定するには、サーバ設定ファイル(/etc/pandora/pandora_server.conf)内の ''splitbrain_autofix'' 設定トーンを ''1'' に設定する必要があります
  
-<code bash> +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.
-mysql -u root -p+
  
 +したがって、[[#ks6_6|スプリットブレイン]]が発生するたび(両方のサーバがマスターの役割を持っている場合)、または **MASTER**ノードと **SLAVE** ノード間で同期の問題が発生するたびに、''pandora_ha'' は ''pandora_ha_resync_slave.sh'' //スクリプト//を起動して、その時点からスレーブサーバ上で MASTER サーバの状態を同期しようとします。
  
-</code>+This process will generate events in the system indicating the start, the end and if any error has occurred within it.
  
-''Password'': → Enter the password observed with the **grep** command. +この処理は、開始、終了、およびエラーが発生したかどうかを示すイベントをシステム内に生成します。
- +
-''Password'': → **grep** コマンドで見つけたパスワードを入力します。 +
- +
-**3.-** Change the temporary password to ''pandora'' of the **root** user. Remember that the **mysql >** prompt corresponds to the MySQL command interpreter (**MYSQL CLI**): +
- +
-**3.-** **root** ユーザのテンポラリパスワードを ''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 >** プロンプトは MySQL コマンドインタプリタ(**MYSQL CLI**)です。 +
- +
-**mysql >** ''ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'Pandor4!';'' +
- +
-**mysql >** ''UNINSTALL COMPONENT "file:component_validate_password";'' +
- +
-**mysql >** ''ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'pandora';'' +
- +
-**4.-** Create the binary replication user and **root** user for remote connections and cluster administration: +
- +
-**4.-** バイナリレプリケーションユーザおよび、リモート接続とクラスタ管理のための **root** ユーザを作成します: +
- +
-**mysql >** ''CREATE USER slaveuser@'%' IDENTIFIED WITH mysql_native_password BY 'pandora';'' +
- +
-**mysql >** ''GRANT REPLICATION CLIENT, REPLICATION SLAVE on *.* to slaveuser@'%';'' +
- +
-**mysql >** ''CREATE USER root@'%' IDENTIFIED WITH mysql_native_password BY 'pandora';'' +
- +
-**mysql >** ''GRANT ALL PRIVILEGES ON *.* to root@'%';'' +
- +
-**5.-** Create Pandora FMS database: +
- +
-**5.-** Pandora FMS データベースを作成します: +
- +
-**mysql >** ''create database pandora;'' +
- +
-**mysql >** ''use pandora;'' +
- +
-**mysql >** ''source /var/www/html/pandora_console/pandoradb.sql'' +
- +
-**mysql >** ''source /var/www/html/pandora_console/pandoradb_data.sql'' +
- +
-<WRAP center round info 60%> +
- +
-For the **source** command: As long as Pandora FMS console is installed in the same server, //otherwise send this file to the master server//. +
- +
-</WRAP> +
- +
-<WRAP center round info 60%> +
- +
-**source** コマンド: 同じサーバへ Pandora FMS コンソールをインストールしている場合。//そうでなければ、このファイルをマスターサーバへコピーします。// +
- +
-</WRAP> +
- +
-6.- Create the pandora user and give the access privileges to this user: +
- +
-**6.-** pandora ユーザを作成し、このユーザにアクセス権限を与えます: +
- +
-**mysql >** ''CREATE USER pandora@'%' IDENTIFIED WITH mysql_native_password BY 'pandora';'' +
- +
-**mysql >** ''grant all privileges on pandora.* to pandora@'%';'' +
- +
-<WRAP center round box 75%> +
- +
-At this point you have the master server ready to start replicating Pandora FMS database. +
- +
-</WRAP> +
- +
-<WRAP center round box 75%> +
- +
-これで、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** # ''chcon -R system_u:object_r:mysqld_db_t:s0 /var/lib/mysql'' +
- +
-**5.-** Start the ''mysqld'' service on the **SLAVE** server: +
- +
-**5.-** **SLAVE** サーバで、''mysqld'' サービスを開始します: +
- +
-<code> +
-systemctl start mysqld +
- +
-</code> +
- +
-**6.-** Start the SLAVE mode on this server (use the data noted in point 2): +
- +
-**6.-** このサーバで SLAVE モードを開始します(手順 2 で確認したデータを利用します): +
- +
-**SLAVE** # ''mysql -u root -ppandora'' +
- +
-**SLAVE** # **mysql >** ''reset slave all;'' +
- +
-**SLAVE** # **mysql >** +
-<code> +
-CHANGE MASTER TO MASTER_HOST='nodo1', +
- MASTER_USER='slaveuser', +
- MASTER_PASSWORD='pandora', +
- MASTER_LOG_FILE='binlog.000003', +
- MASTER_LOG_POS=157; +
- +
-</code> +
- +
-**SLAVE** # **mysql >** ''start slave;'' +
- +
-**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: +
- +
-これらのすべての手順が完了したら、MySQL シェル内で ''show slave status'' コマンドを実行すると、ノードがスレーブとして設定されていることがわかります。 正しく設定されている場合は、次のような出力が表示されます。 +
- +
-<code> +
-*************************** 1. row *************************** +
-Slave_IO_State: Waiting for source to send event +
-Master_Host: node1 +
-Master_User: root +
-Master_Port: 3306 +
-Connect_Retry: 60 +
-Master_Log_File: binlog.000018 +
-Read_Master_Log_Pos: 1135140 +
-Relay_Log_File: relay-bin.000002 +
-Relay_Log_Pos: 1135306 +
-Relay_Master_Log_File: binlog.000018 +
-Slave_IO_Running: Yes +
-Slave_SQL_Running: Yes +
-Replicate_Do_DB: pandora +
-Replicate_Ignore_DB: +
-Replicate_Do_Table: +
-Replicate_Ignore_Table: +
-Replicate_Wild_Do_Table: +
-Replicate_Wild_Ignore_Table: +
-Last_Errno: 0 +
-Last_Error: +
-Skip_Counter:+
-Exec_Master_Log_Pos: 1135140 +
-Relay_Log_Space: 1135519 +
-Until_Condition: None +
-Until_Log_File: +
-Until_Log_Pos:+
-Master_SSL_Allowed: No +
-Master_SSL_CA_File: +
-Master_SSL_CA_Path: +
-Master_SSL_Cert: +
-Master_SSL_Cipher: +
-Master_SSL_Key: +
-Seconds_Behind_Master:+
-Master_SSL_Verify_Server_Cert: No +
-Last_IO_Errno:+
-Last_IO_Error: +
-Last_SQL_Errno:+
-Last_SQL_Error: +
-Replicate_Ignore_Server_Ids: +
-Master_Server_Id:+
-Master_UUID: fa99f1d6-b76a-11ed-9bc1-000c29cbc108 +
-Master_Info_File: mysql.slave_master_info +
-SQL_Delay: 0 +
-SQL_Remaining_Delay: NULL +
-Slave_SQL_Running_State: Replica has read all relay log; waiting for more +
-updates +
-Master_Retry_Count: 86400 +
-Master_Bind: +
-Last_IO_Error_Timestamp: +
-Last_SQL_Error_Timestamp: +
-Master_SSL_Crl: +
-Master_SSL_Crlpath: +
-Retrieved_Gtid_Set: +
-Executed_Gtid_Set: +
-Auto_Position:+
-Replicate_Rewrite_DB: +
-Channel_Name: +
-Master_TLS_Version: +
-Master_public_key_path: +
-Get_master_public_key:+
-Network_Namespace: +
-1 row in set, 1 warning (0,00 sec) +
- +
-</code> +
- +
-At this point you can be sure that you have binary replication enabled and working correctly. +
- +
-この時点で、バイナリレプリケーションが有効になり、正しく動作していることを確認できます。 +
- +
-==== pandora_server 設定 ==== +
- +
-<WRAP center round info 60%> +
- +
-Version 770 or later. +
- +
-</WRAP> +
- +
-<WRAP center round info 60%> +
- +
-バージョン 770 以降 +
- +
-</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''+
- +
-[[:ja:documentation:pandorafms:installation:04_configuration#サーバ|pandora_server.conf ファイル]] 内で、''pandora_ha'' が正しく動作するために必要な一連のパラメータを設定する必要があります。 +
- +
-The parameters to be added are the following: +
- +
-追加するパラメータは次の通りです。 +
- +
-  * **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>** +
-HA 環境を構成する MySQL サーバの IP アドレスまたは FQDN を指定する ''ha_host'' パラメーターを設定します。 最初に入力した IP アドレスは、**MASTER** サーバになるか、HA 環境を最初に開始するときに少なくともマスターの役割を持つサーバです。 例: +
- +
-<code> +
-ha_hosts 192.168.80.170,192.168.80.172 +
- +
-</code> +
- +
-  * **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** +
-これらは、**root** ユーザのユーザとパスワードを指定する必要があるパラメータです。root 以外の場合は、各ノードで //マスター - スレーブ// 昇格操作を実行できる特権を持つ MySQL ユーザを指定する必要があります。 例: +
- +
-<code> +
-ha_dbuser root +
-ha_dbpass pandora +
- +
-</code> +
- +
-  * **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** +
-**SLAVE** から **MASTER** に接続するレプリケーションユーザを定義するパラメータです。 例: +
- +
-<code> +
-repl_dbuser slaveuser +
-repl_dbpass pandora +
- +
-</code> +
- +
-  * **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** +
-リカバリ操作を実行するために **ssh** によって Percona/MySQL サーバに接続されるユーザ/ポートを定義するパラメータです。このオプションを正しく動作させるには、''pandora_ha'' サービスを実行するユーザと ''ha_sshuser'' パラメータで指定されたユーザの間で ssh キーを共有する必要があります。 例: +
- +
-<code> +
-ha_sshuser root +
-ha_sshport 22 +
- +
-</code> +
- +
-  * **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'' +
-デフォルトでは、ノードの再同期を実行するスクリプトは次の場所にありますP +
- +
-<file> +
- /usr/share/pandora_server/util/pandora_ha_resync_slave.sh +
- +
-</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. +
- +
-スクリプトをカスタマイズしてインストールする場合は、必要に応じて **SLAVE** ノードの自動または手動同期を実行するスクリプトの場所をこのパラメータで指定します。 +
- +
-<code> +
-ha_resync /usr/share/pandora_server/util/pandora_ha_resync_slave.sh +
- +
-</code> +
- +
-  * **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** +
-前のトークンで設定された同期スクリプトの実行に関するすべての情報が格納されるログのパスです。 例: +
- +
-<code> +
-ha_resync_log /var/log/pandoraha_resync.log +
- +
-</code> +
- +
-  * **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** +
-環境に変更を加える前に、HA 環境内の各サーバで各チェックを試行する回数です。 例: +
- +
-<code> +
-ha_connect_retries 2 +
- +
-</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. +
- +
-これらのパラメータをすべて設定したら、''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 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 サーバが常に示されています。 +
- +
-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) が指定されている場合、このファイルはそのパスに配置されます。 +
- +
-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. +
- +
-このファイルは、**MASTER** の役割を持つ Percona/MySQL サーバの IP アドレスをいつでも知れるように、Pandora FMS コンソールでも使用されます。 +
- +
-  * **restart** +
-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 failure, thus avoiding possible conflicts. Example: +
- +
-**pandora_ha** デーモンは、競合を回避しながら障害時のサービスの再起動を行うため、通常は値は ''0'' です。 例: +
- +
-<code> +
-# Pandora FMS will restart after restart_delay seconds on critical errors. +
-restart 0 +
- +
-</code> +
- +
-  * **ha_backup_source_dir**: +
- +
-Directory that will contain the HA backup data. Default value: ''/var/tmp''+
- +
-HA バックアップデータを保存するディレクトリ。デフォルト値: ''/var/tmp'' +
- +
-  * **ha_mysql_source_dir**: +
- +
-Directory that will contain the MySQL data. Default value: ''/var/lib''+
- +
-MySQLデータを保存するディレクトリ。デフォルト値: ''/var/lib'' +
- +
-<wrap #ks6_3_1 /> +
- +
-=== サーバ間の 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: +
- +
-OpenSSH サーバがインストールされ、各ホストで動作している必要があります。OpenSSH を表示するウェルカムメッセージまたはバナーを抑制します。**すべて** のデバイスで以下を実行します: +
- +
-<code> +
-[ -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 +
- +
-</code> +
- +
-Share the SSH keys between ''pandora_ha'' and all the existing Percona/MySQL servers in the environment, **run on Pandora FMS server**: +
- +
-''pandora_ha'' と環境内に存在するすべての Percona/MySQL サーバ間で SSH 鍵を共有します。**Pandora FMS サーバで以下を実行します**: +
- +
-<code> +
-printf "\n\n\n" | ssh-keygen -t rsa -P '' +
-ssh-copy-id -p22 root@node1 +
-ssh-copy-id -p22 root@node2 +
- +
-</code> +
- +
-<WRAP center round important 75%> +
- +
-  * 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> +
- +
-<WRAP center round important 75%> +
- +
-  * Ubuntu Server にインストールしている場合は、**root** ユーザが SSH 経由で接続できるようにします。 これは、''sudo passwd root'' コマンドを実行して root ユーザにパスワードを設定することによって行えます。 +
-  * 次に、''sshd'' サービスの設定ファイルにある "**PermitRootLogin without-password**" を使用して、root ユーザの SSH 接続を有効にします。 +
- +
-</WRAP> +
- +
-=== 同期スクリプトの利用 === +
- +
-With Pandora FMS server a script is implemented that allows you to synchronize the **SLAVE** database in case it is out of sync. +
- +
-Pandora FMS サーバでは、同期が取れていない場合に **SLAVE** データベースを同期できるようにするスクリプトが実装されています。 +
- +
-The manual execution of this script is the following: +
- +
-スクリプトの手動実行は次の通りです: +
- +
-<code> +
-./pandora_ha_resync_slave.sh "pandora_server.conf file" MASTER SLAVE +
- +
-</code> +
- +
-For example, to make a manual synchronization from node 1 to node 2 the execution would be the following: +
- +
-例えば、ノード1 からノード2 へ手動で同期するには、次のように実行します: +
- +
-<code> +
-/usr/share/pandora_server/util/pandora_ha_resync_slave.sh /etc/pandora/pandora_server.conf node1 node2 +
- +
-</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''). +
- +
-**MASTER** と **SLAVE** の間で同期の問題が発生した際に HA 環境の自動回復を設定するには、サーバ設定ファイル(''/etc/pandora/pandora_server.conf'')内の設定トークン ''splitbrain_autofix'' を 1 にする必要があります。  +
- +
-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. +
- +
-そうすると、[[#スプリットブレイン|スプリットブレイン]] が発生した場合 (両方のサーバがマスターの役割を持っている場合)、または **MASTER** と **SLAVE** の間で同期の問題が発生した場合は、常に ''pandora_ha'' が ''pandora_ha_resync_slave.sh'' スクリプトを起動して、その時点のマスターサーバの状態をスレーブサーバへ同期しようとします。 +
- +
-This process will generate events in the system indicating the start, the end and if any error took place in there. +
- +
-この処理は、開始、終了、およびそこでエラーが発生したかどうかを示すイベントをシステム生成します。+
  
 <wrap #ks6_4 /> <wrap #ks6_4 />
  
-==== Pandora FMS コンソールの設定 ==== 
- 
-<WRAP center round info 60%> 
- 
-Version 770 or later. 
- 
-</WRAP> 
- 
-<WRAP center round info 60%> 
- 
-バージョン 770 以降 
- 
-</WRAP> 
- 
-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''. 
- 
-Pandora FMS が使用するデータ受け取りディレクトリのパス、デフォルトでは ''/var/spool/pandora/data_in'' を示す新しいパラメータが ''config.php'' に追加されました。 
- 
-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. 
- 
-設定されている場合、''/var/spool/pandora/data_in/conf/pandora_ha_hosts.conf'' ファイルを探して、接続先の IP アドレスを取得します。 
- 
-<code> 
-$config["remote_config"] = "/var/spool/pandora/data_in"; 
- 
-</code> 
- 
-In Pandora FMS console you could see the cluster status accessing to the Manage HA view. 
- 
-Pandora FMS コンソールでは、HA 管理画面にアクセスしてクラスタの状態を確認できます。 
- 
-<code> 
-https://PANDORA_IP/pandora_console/index.php?sec=gservers&sec2=enterprise/godmode/servers/HA_cluster 
- 
-</code> 
- 
-{{  :wiki:pfms-servers-manage_database_ha-view_nodes.png  }} 
- 
-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. 
- 
-この画面のデータは、''pandora_ha'' により常に更新されます。''pandora_server.conf'' で前述のパラメータが正しく設定されている限り、このデータを表示するための特別な設定はありません。 
- 
-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&}}. 
- 
-実行可能なアクションとしては、各ノードのラベルを設定することができ、{{:wiki:pfms-servers-manage_database_ha-resync_node_icon.png?nolink&}}アイコンにて **SLAVE** ノードを同期するオプションを実行できます。 
- 
-This icon can have the following states: 
- 
-このアイコンには次の状態があります。 
- 
-  * **Green**: Normal, no operation to be performed. 
-  * **Blue**: Pending resynchronization. 
-  * **Yellow**: Resynchronization is in progress. 
-  * **Red**: //Error//, resynchronization failed. 
  
-  * **緑**: 正常、何の処理も実行されていない。 
-  * **青**: 同期保留中。 
-  * **黄**: 同期実行中。 
-  * **赤**: //エラー//、同期失敗。 
  
  
行 2076: 行 1476:
 </WRAP> </WRAP>
  
-**mysql** > ''CREATE USER slaveuser@% IDENTIFIED WITH mysql_native_password BY 'pandora';''+**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';''
行 2323: 行 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
行 2398: 行 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.1781911316.txt.gz
  • 最終更新: 2026/06/19 23:21
  • by junichi