差分
このページの2つのバージョン間の差分を表示します。
| 両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン | ||
| ja:documentation:pandorafms:complex_environments_and_optimization:06_ha [2026/06/19 23:22] – [データベースの複製] junichi | ja:documentation:pandorafms:complex_environments_and_optimization:06_ha [2026/06/19 23:35] (現在) – [冗長化構成(HA)] junichi | ||
|---|---|---|---|
| 行 3: | 行 3: | ||
| {{indexmenu_n> | {{indexmenu_n> | ||
| - | [[ja: | + | [[ja: |
| - | + | ||
| ===== 概要 ===== | ===== 概要 ===== | ||
| 行 1392: | 行 1390: | ||
| <wrap #ks6_3 /> | <wrap #ks6_3 /> | ||
| + | ==== 手動 DB 再同期 ==== | ||
| + | Using the synchronization //script//: With the Pandora FMS server, a //script// is implemented that allows you to synchronize the **SLAVE** database in case it is desynchronized. | ||
| + | 同期スクリプトの使用: | ||
| + | The manual execution of this //script// is as follows: | ||
| - | ==== pandora_server 設定 ==== | + | このスクリプトの手動実行方法は以下のとおりです。 |
| - | <WRAP center round info 60%> | + | < |
| - | + | ||
| - | Version 770 or later. | + | |
| - | + | ||
| - | </ | + | |
| - | + | ||
| - | <WRAP center round info 60%> | + | |
| - | + | ||
| - | バージョン 770 以降 | + | |
| - | + | ||
| - | </ | + | |
| - | + | ||
| - | It is necessary to configure inside [[: | + | |
| - | + | ||
| - | [[: | + | |
| - | + | ||
| - | The parameters to be added are the following: | + | |
| - | + | ||
| - | 追加するパラメータは次の通りです。 | + | |
| - | + | ||
| - | * **ha_hosts < | + | |
| - | Configure the '' | + | |
| - | + | ||
| - | * **ha_hosts < | + | |
| - | HA 環境を構成する MySQL サーバの IP アドレスまたは FQDN を指定する '' | + | |
| - | + | ||
| - | < | + | |
| - | ha_hosts 192.168.80.170, | + | |
| - | + | ||
| - | </ | + | |
| - | + | ||
| - | * **ha_dbuser** | + | |
| - | These are the parameters where you must indicate the user and password of **root** | + | |
| - | + | ||
| - | * **ha_dbuser** | + | |
| - | これらは、**root** ユーザのユーザとパスワードを指定する必要があるパラメータです。root 以外の場合は、各ノードで // | + | |
| - | + | ||
| - | < | + | |
| - | ha_dbuser root | + | |
| - | ha_dbpass pandora | + | |
| - | + | ||
| - | </ | + | |
| - | + | ||
| - | * **repl_dbuser** | + | |
| - | Parameters to define the replication user that will use the **SLAVE** | + | |
| - | + | ||
| - | * **repl_dbuser** | + | |
| - | **SLAVE** から **MASTER** に接続するレプリケーションユーザを定義するパラメータです。 例: | + | |
| - | + | ||
| - | < | + | |
| - | repl_dbuser slaveuser | + | |
| - | repl_dbpass pandora | + | |
| - | + | ||
| - | </ | + | |
| - | + | ||
| - | * **ha_sshuser** | + | |
| - | Parameters to define the user/port with which it is connected by **ssh** | + | |
| - | + | ||
| - | * **ha_sshuser** および **ha_sshport** | + | |
| - | リカバリ操作を実行するために **ssh** によって Percona/ | + | |
| - | + | ||
| - | < | + | |
| - | ha_sshuser root | + | |
| - | ha_sshport 22 | + | |
| - | + | ||
| - | </ | + | |
| - | + | ||
| - | * **ha_resync**'' | + | |
| - | By default the script to perform the resynchronization of the nodes, this is located at: | + | |
| - | + | ||
| - | * **ha_resync**'' | + | |
| - | デフォルトでは、ノードの再同期を実行するスクリプトは次の場所にありますP | + | |
| - | + | ||
| - | < | + | |
| - | / | + | |
| - | + | ||
| - | </ | + | |
| - | + | ||
| - | 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** | + | |
| - | + | ||
| - | スクリプトをカスタマイズしてインストールする場合は、必要に応じて **SLAVE** ノードの自動または手動同期を実行するスクリプトの場所をこのパラメータで指定します。 | + | |
| - | + | ||
| - | < | + | |
| - | ha_resync / | + | |
| - | + | ||
| - | </ | + | |
| - | + | ||
| - | * **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** | + | |
| - | 前のトークンで設定された同期スクリプトの実行に関するすべての情報が格納されるログのパスです。 例: | + | |
| - | + | ||
| - | < | + | |
| - | ha_resync_log / | + | |
| - | + | ||
| - | </ | + | |
| - | + | ||
| - | * **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 環境内の各サーバで各チェックを試行する回数です。 例: | + | |
| - | + | ||
| - | < | + | |
| - | ha_connect_retries 2 | + | |
| - | + | ||
| - | </ | + | |
| - | + | ||
| - | Once all these parameters are configured, you could start Pandora FMS server with the '' | + | |
| - | + | ||
| - | これらのパラメータをすべて設定したら、'' | + | |
| - | + | ||
| - | When it knows it, it will create the '' | + | |
| - | + | ||
| - | それを認識すると、''/ | + | |
| - | + | ||
| - | In case the '' | + | |
| - | + | ||
| - | '' | + | |
| - | + | ||
| - | This file will be used as an interchange with the Pandora FMS Console to know at any time the IP address of the Percona/ | + | |
| - | + | ||
| - | このファイルは、**MASTER** の役割を持つ Percona/ | + | |
| - | + | ||
| - | * **restart** | + | |
| - | It will be indicated with a value of '' | + | |
| - | + | ||
| - | **pandora_ha** デーモンは、競合を回避しながら障害時のサービスの再起動を行うため、通常は値は '' | + | |
| - | + | ||
| - | < | + | |
| - | # Pandora FMS will restart after restart_delay seconds on critical errors. | + | |
| - | restart 0 | + | |
| - | + | ||
| - | </ | + | |
| - | + | ||
| - | * **ha_backup_source_dir**: | + | |
| - | + | ||
| - | Directory that will contain the HA backup data. Default value: ''/ | + | |
| - | + | ||
| - | HA バックアップデータを保存するディレクトリ。デフォルト値: | + | |
| - | + | ||
| - | * **ha_mysql_source_dir**: | + | |
| - | + | ||
| - | Directory that will contain the MySQL data. Default value: ''/ | + | |
| - | + | ||
| - | MySQLデータを保存するディレクトリ。デフォルト値: | + | |
| - | + | ||
| - | <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 を表示するウェルカムメッセージまたはバナーを抑制します。**すべて** のデバイスで以下を実行します: | + | |
| - | + | ||
| - | < | + | |
| - | [ -f / | + | |
| - | sed -i -e ' | + | |
| - | systemctl restart sshd | + | |
| - | + | ||
| - | </ | + | |
| - | + | ||
| - | Share the SSH keys between '' | + | |
| - | + | ||
| - | '' | + | |
| - | + | ||
| - | < | + | |
| - | printf " | + | |
| - | ssh-copy-id -p22 root@node1 | + | |
| - | ssh-copy-id -p22 root@node2 | + | |
| - | + | ||
| - | </ | + | |
| - | + | ||
| - | <WRAP center round important 75%> | + | |
| - | + | ||
| - | * In case you have the installation on Ubuntu Server, enable the **root** | + | |
| - | * Then enable the SSH connection of the root user at least through shared keys " | + | |
| - | + | ||
| - | </ | + | |
| - | + | ||
| - | <WRAP center round important 75%> | + | |
| - | + | ||
| - | * Ubuntu Server にインストールしている場合は、**root** ユーザが SSH 経由で接続できるようにします。 これは、'' | + | |
| - | * 次に、'' | + | |
| - | + | ||
| - | </ | + | |
| - | + | ||
| - | === 同期スクリプトの利用 === | + | |
| - | + | ||
| - | 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: | + | |
| - | + | ||
| - | スクリプトの手動実行は次の通りです: | + | |
| - | + | ||
| - | < | + | |
| ./ | ./ | ||
| - | |||
| </ | </ | ||
| - | For example, to make a manual synchronization from node 1 to node 2 the execution would be the following: | + | For example, to manually synchronize |
| - | 例えば、ノード1 | + | たとえば、ノード 1 をノード 2 に手動で同期するには、実行は次のようになります。 |
| - | + | ||
| - | < | + | |
| - | / | + | |
| + | <code bash> | ||
| + | / | ||
| + | / | ||
| + | | ||
| + | | ||
| </ | </ | ||
| - | 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 '' | + | 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 '' |
| - | **MASTER** と **SLAVE** | + | **MASTER** と **SLAVE** 間で同期の問題が発生した場合にHA環境の自動復旧を設定するには、サーバ設定ファイル(/ |
| - | So, whenever a [[# | + | Thus, whenever a [[# |
| - | そうすると、[[#スプリットブレイン|スプリットブレイン]] が発生した場合 (両方のサーバがマスターの役割を持っている場合)、または **MASTER** と **SLAVE** | + | したがって、[[#ks6_6|スプリットブレイン]]が発生するたび(両方のサーバがマスターの役割を持っている場合)、または **MASTER**ノードと **SLAVE** |
| - | This process will generate events in the system indicating the start, the end and if any error took place in there. | + | This process will generate events in the system indicating the start, the end and if any error has occurred within it. |
| - | この処理は、開始、終了、およびそこでエラーが発生したかどうかを示すイベントをシステムで生成します。 | + | この処理は、開始、終了、およびエラーが発生したかどうかを示すイベントをシステム内に生成します。 |
| <wrap #ks6_4 /> | <wrap #ks6_4 /> | ||
| - | ==== Pandora FMS コンソールの設定 ==== | ||
| - | |||
| - | <WRAP center round info 60%> | ||
| - | |||
| - | Version 770 or later. | ||
| - | |||
| - | </ | ||
| - | |||
| - | <WRAP center round info 60%> | ||
| - | |||
| - | バージョン 770 以降 | ||
| - | |||
| - | </ | ||
| - | |||
| - | A new parameter has been added to the '' | ||
| - | |||
| - | Pandora FMS が使用するデータ受け取りディレクトリのパス、デフォルトでは ''/ | ||
| - | |||
| - | If it is configured, it will look for the file ''/ | ||
| - | |||
| - | 設定されている場合、''/ | ||
| - | |||
| - | < | ||
| - | $config[" | ||
| - | |||
| - | </ | ||
| - | |||
| - | In Pandora FMS console you could see the cluster status accessing to the Manage HA view. | ||
| - | |||
| - | Pandora FMS コンソールでは、HA 管理画面にアクセスしてクラスタの状態を確認できます。 | ||
| - | |||
| - | < | ||
| - | https:// | ||
| - | |||
| - | </ | ||
| - | |||
| - | {{ : | ||
| - | |||
| - | The data of this view is constantly updated thanks to '' | ||
| - | |||
| - | この画面のデータは、'' | ||
| - | |||
| - | 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{{: | ||
| - | |||
| - | 実行可能なアクションとしては、各ノードのラベルを設定することができ、{{: | ||
| - | |||
| - | 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. | ||
| - | * **緑**: 正常、何の処理も実行されていない。 | ||
| - | * **青**: 同期保留中。 | ||
| - | * **黄**: 同期実行中。 | ||
| - | * **赤**: // | ||
| 行 1729: | 行 1476: | ||
| </ | </ | ||
| - | **mysql** > '' | + | **mysql** > '' |
| - | **mysql** > '' | + | **mysql** > '' |
| **mysql** > '' | **mysql** > '' | ||
| 行 1976: | 行 1723: | ||
| *************************** 1. row *************************** | *************************** 1. row *************************** | ||
| | | ||
| - | Master_Host: | + | Master_Host: |
| Master_User: | Master_User: | ||
| Master_Port: | Master_Port: | ||
| 行 2051: | 行 1798: | ||
| </ | </ | ||
| - | [[ja: | + | [[ja: |
| ===== (OBSOLETE) データベース HA ===== | ===== (OBSOLETE) データベース HA ===== | ||