差分
このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン | ||
ja:quickguides:ha_percona_xtradb [2022/05/30 05:42] – [はじめに] junichi | ja:quickguides:ha_percona_xtradb [2023/09/27 04:25] (現在) – [以前のデータがある環境における変更の適用] junichi | ||
---|---|---|---|
行 4: | 行 4: | ||
[[: | [[: | ||
+ | |||
行 30: | 行 31: | ||
</ | </ | ||
- | ===== Percona XtraDB Cluster | + | ===== Percona XtraDB Cluster |
To perform a correct installation of Percona XtraDB Cluster, first the Percona XtraDB Cluster server and client must be installed in all the nodes. | To perform a correct installation of Percona XtraDB Cluster, first the Percona XtraDB Cluster server and client must be installed in all the nodes. | ||
+ | |||
+ | Percona XtraDB Cluster を正しくインストールするには、最初に Percona XtraDB Cluster サーバとクライアントをすべてのノードにインストールする必要があります。 | ||
The data of the nodes to be used in the example will be the following: | The data of the nodes to be used in the example will be the following: | ||
+ | |||
+ | 例で使用するノードの情報は次の通りです。 | ||
**NODE 1**: | **NODE 1**: | ||
+ | |||
+ | **ノード1**: | ||
< | < | ||
pandora001 | pandora001 | ||
行 44: | 行 51: | ||
**NODE 2**: | **NODE 2**: | ||
+ | |||
+ | **ノード2**: | ||
< | < | ||
pandora002 | pandora002 | ||
行 51: | 行 60: | ||
**NODE 3**: | **NODE 3**: | ||
+ | |||
+ | **ノード3**: | ||
< | < | ||
pandora003 | pandora003 | ||
行 58: | 行 69: | ||
- | ==== Running on all nodes ==== | + | ==== 全ノードでの実行 |
< | < | ||
行 66: | 行 77: | ||
Once installed on all nodes, start the service on each node and set up a password that is common for the **root** user, as well as a user (in this case '' | Once installed on all nodes, start the service on each node and set up a password that is common for the **root** user, as well as a user (in this case '' | ||
+ | |||
+ | すべてのノードにインストールしたら、各ノードでサービスを開始し、**root** ユーザと、全ノード間のレプリケーションに使用されるユーザ(この場合は '' | ||
+ | |||
< | < | ||
# systemctl start mysqld | # systemctl start mysqld | ||
行 72: | 行 86: | ||
Get a temporary password for **root** and login with it to the MySQL server (remember to run on all nodes): | Get a temporary password for **root** and login with it to the MySQL server (remember to run on all nodes): | ||
+ | |||
+ | **root** の一時パスワードを取得し、それを使用して MySQL サーバにログインします(すべてのノードで実行することを忘れないでください)。 | ||
+ | |||
< | < | ||
# mysql -uroot -p$(grep " | # mysql -uroot -p$(grep " | ||
行 80: | 行 97: | ||
Now proceed to create the user '' | Now proceed to create the user '' | ||
+ | |||
+ | 続いて、ユーザ '' | ||
+ | |||
< | < | ||
行 89: | 行 109: | ||
Stop the '' | Stop the '' | ||
+ | |||
+ | ここまでの設定が終わったら、**全ノードで** '' | ||
+ | |||
< | < | ||
# systemctl stop mysqld | # systemctl stop mysqld | ||
行 95: | 行 118: | ||
Once you have stopped all servers, you must start one of them in bootstrap mode, so that it acts as the main server to perform replication between the other two nodes. | Once you have stopped all servers, you must start one of them in bootstrap mode, so that it acts as the main server to perform replication between the other two nodes. | ||
+ | |||
+ | すべてのサーバを停止したら、そのうちの 1つをブートストラップモードで起動して、他の 2つのノード間でレプリケーションを実行するメインサーバとして機能するようにする必要があります。 | ||
To do this you have to add a specific configuration in the node that you choose as the main one, in this case the '' | To do this you have to add a specific configuration in the node that you choose as the main one, in this case the '' | ||
+ | |||
+ | これを行うには、メインとして選択したノード(この場合は '' | ||
Modify the ''/ | Modify the ''/ | ||
+ | |||
+ | '' | ||
+ | |||
< | < | ||
[mysqld] | [mysqld] | ||
行 154: | 行 184: | ||
Start with this configuration the mysql service in the '' | Start with this configuration the mysql service in the '' | ||
+ | |||
+ | '' | ||
+ | |||
< | < | ||
# systemctl start mysql@bootstrap | # systemctl start mysql@bootstrap | ||
行 160: | 行 193: | ||
In the nodes '' | In the nodes '' | ||
+ | |||
+ | '' | ||
* Node '' | * Node '' | ||
+ | |||
+ | * ノード '' | ||
< | < | ||
行 216: | 行 253: | ||
* Node '' | * Node '' | ||
+ | |||
+ | * ノード '' | ||
< | < | ||
行 270: | 行 309: | ||
Start in the nodes '' | Start in the nodes '' | ||
+ | |||
+ | '' | ||
< | < | ||
行 277: | 行 318: | ||
<WRAP center round box 60%> At this point you can perform the installation of the Pandora FMS database on node 1 and observe how it replicates correctly between the other two servers. </ | <WRAP center round box 60%> At this point you can perform the installation of the Pandora FMS database on node 1 and observe how it replicates correctly between the other two servers. </ | ||
+ | |||
+ | <WRAP center round box 60%> この時点で、ノード1 に Pandora FMS データベースのインストールを実行し、他の 2つのサーバ間でデータベースがどのように正しく複製されるかを観察できます。</ | ||
Once you have verified the correct operation of the replication, | Once you have verified the correct operation of the replication, | ||
+ | |||
+ | レプリケーションの正しい動作を確認したら、bootstrap モードで開始したノード(この場合は '' | ||
< | < | ||
行 286: | 行 331: | ||
Change inside the '' | Change inside the '' | ||
+ | |||
+ | ノード1 の '' | ||
< | < | ||
行 293: | 行 340: | ||
Start again the '' | Start again the '' | ||
+ | |||
+ | ノード '' | ||
< | < | ||
行 300: | 行 349: | ||
- | ===== Changes to the Pandora FMS schema for its correct operation | + | ===== 正しい動作のための |
<WRAP center round important 60%> To avoid problems with deadlocks due to the constant writings and readings that are produced in parallel, it is necessary to modify the following Pandora FMS tables with the following modifications: | <WRAP center round important 60%> To avoid problems with deadlocks due to the constant writings and readings that are produced in parallel, it is necessary to modify the following Pandora FMS tables with the following modifications: | ||
+ | </ | ||
+ | |||
+ | <WRAP center round important 60%> 並行して行われる書き込みと読み取りによるデッドロックの問題を回避するために、以下に示す内容で Pandora FMS の該当テーブルを変更する必要があります。\\ | ||
</ | </ | ||
行 328: | 行 380: | ||
For its correct operation, these changes should be applied with the database without data, only with the schema. | For its correct operation, these changes should be applied with the database without data, only with the schema. | ||
+ | 正しく動作させるには、これらの変更をスキーマのみのデータが入っていないデータベースに適用する必要があります。 | ||
- | ===== Applying changes in an environment with previous data ===== | + | ===== 以前のデータがある環境における変更の適用 |
In this scenario, it is necessary to rebuild the tables where the necessary modifications have been added to avoid deadlocks in the environment. The process would be as follows: | In this scenario, it is necessary to rebuild the tables where the necessary modifications have been added to avoid deadlocks in the environment. The process would be as follows: | ||
+ | |||
+ | このシナリオは、デッドロックを回避するために、すでにデータが入っているテーブルに対して変更を適用して再構築する場合の例です。処理は次のようになります。 | ||
1.- '' | 1.- '' | ||
+ | |||
+ | 1.- DROP および create TABLE フィールドを除く、個別に関係するすべてのテーブルを'' | ||
+ | |||
< | < | ||
#mysqldump -u root -p pandora tagent_access --skip-add-drop-table --complete-insert --no-create-info> | #mysqldump -u root -p pandora tagent_access --skip-add-drop-table --complete-insert --no-create-info> | ||
行 344: | 行 402: | ||
2.- Delete the affected tables: | 2.- Delete the affected tables: | ||
+ | |||
+ | 2.- 影響のあるテーブルを削除します。 | ||
< | < | ||
行 355: | 行 415: | ||
3.- Create again all the tables with all the '' | 3.- Create again all the tables with all the '' | ||
+ | |||
+ | 3.- 環境が問題なく動作するように、新しい列を含むすべてのテーブルを '' | ||
4.- Incorporate with **source** all the '' | 4.- Incorporate with **source** all the '' | ||
+ | |||
+ | 4.- 手順1 で作成したすべての '' | ||
+ | |||
< | < | ||
#mysql -u root -p pandora | #mysql -u root -p pandora | ||
行 367: | 行 432: | ||
</ | </ | ||
- | At the end of the process, all the tables will have the incremental | + | At the end of the process, all the tables will have the incremental |
- | [[: | + | 処理が終わると、すべてのテーブルに、最初から作成されたインクリメンタル ID が含まれます。 |
+ | [[: | ||