ja:quickguides:ha_percona_xtradb

差分

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

この比較画面へのリンク

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
ja:quickguides:ha_percona_xtradb [2022/05/30 05:42] – [はじめに] junichija:quickguides:ha_percona_xtradb [2023/09/27 04:25] (現在) – [以前のデータがある環境における変更の適用] junichi
行 4: 行 4:
  
 [[:ja:quickguides:start|クイックガイド一覧に戻る]] [[:ja:quickguides:start|クイックガイド一覧に戻る]]
 +
  
  
行 30: 行 31:
 </WRAP> </WRAP>
  
-===== Percona XtraDB Cluster Installation =====+===== 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**:
 <code> <code>
 pandora001 pandora001
行 44: 行 51:
  
 **NODE 2**: **NODE 2**:
 +
 +**ノード2**:
 <code> <code>
 pandora002 pandora002
行 51: 行 60:
  
 **NODE 3**: **NODE 3**:
 +
 +**ノード3**:
 <code> <code>
 pandora003 pandora003
行 58: 行 69:
  
  
-==== Running on all nodes ====+==== 全ノードでの実行 ====
  
 <code> <code>
行 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 ''sstuser'') that will be used for replication between all nodes. Execute: 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 ''sstuser'') that will be used for replication between all nodes. Execute:
 +
 +すべてのノードにインストールしたら、各ノードでサービスを開始し、**root** ユーザと、全ノード間のレプリケーションに使用されるユーザ(この場合は ''sstuser'')に共通のパスワードを設定します。 以下を実行します:
 +
 <code> <code>
 # 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 サーバにログインします(すべてのノードで実行することを忘れないでください)。
 +
 <code> <code>
 # mysql -uroot -p$(grep "temporary password" /var/log/mysqld.log | \ rev | cut -d' ' -f1 | rev)> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('Pandor4!'); # mysql -uroot -p$(grep "temporary password" /var/log/mysqld.log | \ rev | cut -d' ' -f1 | rev)> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('Pandor4!');
行 80: 行 97:
  
 Now proceed to create the user ''sstuser'': Now proceed to create the user ''sstuser'':
 +
 +続いて、ユーザ ''sstuser'' を作成します:
 +
 <code> <code>
  
行 89: 行 109:
  
 Stop the ''mysql'' service **on all nodes** after finishing this configuration: Stop the ''mysql'' service **on all nodes** after finishing this configuration:
 +
 +ここまでの設定が終わったら、**全ノードで** ''mysql'' サービスを停止します。
 +
 <code> <code>
 # 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 ''pandora001'' node. To do this you have to add a specific configuration in the node that you choose as the main one, in this case the ''pandora001'' node.
 +
 +これを行うには、メインとして選択したノード(この場合は ''pandora001'' ノード)に特定の設定を追加する必要があります。
  
 Modify the ''/etc/my.cnf'' file of the ''pandora001'' node adding correctly the parameters indicated between the two lines ''# Modified for PFMS'': Modify the ''/etc/my.cnf'' file of the ''pandora001'' node adding correctly the parameters indicated between the two lines ''# Modified for PFMS'':
 +
 +''pandora001'' ノードの ''/etc/my.cnf'' ファイルを編集し、2行の # Modified for PFMS の間に示す設定を正しく追加します。
 +
 <code> <code>
 [mysqld] [mysqld]
行 154: 行 184:
  
 Start with this configuration the mysql service in the ''pandora001'' node, in bootstrap mode: Start with this configuration the mysql service in the ''pandora001'' node, in bootstrap mode:
 +
 +''pandora001'' ノードにて、bootstrap モードで mysql サービスを起動します。
 +
 <code> <code>
 # systemctl start mysql@bootstrap # systemctl start mysql@bootstrap
行 160: 行 193:
  
 In the nodes ''pandora002'' and ''pandora003'' modify the file ''/etc/my.cnf'' indicating the following parameters indicated between the two lines ''# Modified for PFMS'': In the nodes ''pandora002'' and ''pandora003'' modify the file ''/etc/my.cnf'' indicating the following parameters indicated between the two lines ''# Modified for PFMS'':
 +
 +''pandora002'' および ''pandora003'' ノードで ''/etc/my.cnf'' を編集し、次に示す 2行の ''# Modified for PFMS'' の間の設定を追加します。
  
    * Node ''pandora002'':    * Node ''pandora002'':
 +
 +   * ノード ''pandora002'':
  
 <code> <code>
行 216: 行 253:
  
   * Node ''pandora003'':   * Node ''pandora003'':
 +
 +  * ノード ''pandora003'':
  
 <code> <code>
行 270: 行 309:
  
 Start in the nodes ''pandora002''  and ''pandora003''  the ''mysqld''  service to start the synchronization: Start in the nodes ''pandora002''  and ''pandora003''  the ''mysqld''  service to start the synchronization:
 +
 +''pandora002'' および ''pandora003'' ノードで、同期するために ''mysqld'' サービスを起動します。
  
 <code> <code>
行 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> <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>
 +
 +<WRAP center round box 60%> この時点で、ノード1 に Pandora FMS データベースのインストールを実行し、他の 2つのサーバ間でデータベースがどのように正しく複製されるかを観察できます。</WRAP>
  
 Once you have verified the correct operation of the replication, stop the node that has started in bootstrap mode (in this case the ''pandora001'' node): Once you have verified the correct operation of the replication, stop the node that has started in bootstrap mode (in this case the ''pandora001'' node):
 +
 +レプリケーションの正しい動作を確認したら、bootstrap モードで開始したノード(この場合は ''pandora001'' ノード)を停止します。
  
 <code> <code>
行 286: 行 331:
  
 Change inside the ''my.cnf''  file of the NODE 1 the parameter ''wsrep_cluster_address''  to add the other 2 nodes of the cluster to it, it has to be as follows: Change inside the ''my.cnf''  file of the NODE 1 the parameter ''wsrep_cluster_address''  to add the other 2 nodes of the cluster to it, it has to be as follows:
 +
 +ノード1 の ''my.cnf'' ファイル内でパラメータ ''wsrep_cluster_address'' を変更し、クラスタの他の 2つのノードを追加します。次のようにする必要があります。
  
 <code> <code>
行 293: 行 340:
  
 Start again the ''mysqld''  service in the node ''pandora001'', **but this time in normal mode**, so that it synchronizes with the other 2 nodes already active. Start again the ''mysqld''  service in the node ''pandora001'', **but this time in normal mode**, so that it synchronizes with the other 2 nodes already active.
 +
 +ノード ''pandora001'' で ''mysqld'' サービスを再開しますが、**今回は通常モード**で、すでにアクティブになっている他の 2つのノードと同期します。
  
 <code> <code>
行 300: 行 349:
  
  
-===== Changes to the Pandora FMS schema for its correct operation =====+===== 正しい動作のための Pandora FMS スキーマの変更 =====
  
 <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>
 +
 +<WRAP center round important 60%> 並行して行われる書き込みと読み取りによるデッドロックの問題を回避するために、以下に示す内容で Pandora FMS の該当テーブルを変更する必要があります。\\
 </WRAP> </WRAP>
  
行 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.- ''DUMP'' (export data) all the tables involved separately, excluding the DROP and create TABLE fields: 1.- ''DUMP'' (export data) all the tables involved separately, excluding the DROP and create TABLE fields:
 +
 +1.- DROP および create TABLE フィールドを除く、個別に関係するすべてのテーブルを'' DUMP'' (データのエクスポート) します。
 +
 <code> <code>
 #mysqldump -u root -p pandora tagent_access --skip-add-drop-table --complete-insert --no-create-info> tagent_access.sql #mysqldump -u root -p pandora tagent_access --skip-add-drop-table --complete-insert --no-create-info> tagent_access.sql
行 344: 行 402:
  
 2.- Delete the affected tables: 2.- Delete the affected tables:
 +
 +2.- 影響のあるテーブルを削除します。
  
 <code> <code>
行 355: 行 415:
  
 3.- Create again all the tables with all the ''ALTER'' and with all the new columns so that the environment works without problems. To create the tables again it is necessary to use the create table of the file ''/var/www/html/pandora_console/pandoradb.sql'' of the tables ''tagent_access'', ''tagente_datos_inc'', ''tagente_datos_string'', ''tagente_datos_inventory''. 3.- Create again all the tables with all the ''ALTER'' and with all the new columns so that the environment works without problems. To create the tables again it is necessary to use the create table of the file ''/var/www/html/pandora_console/pandoradb.sql'' of the tables ''tagent_access'', ''tagente_datos_inc'', ''tagente_datos_string'', ''tagente_datos_inventory''.
 +
 +3.- 環境が問題なく動作するように、新しい列を含むすべてのテーブルを ''ALTER'' で再度作成します。 テーブルを再度作成するには、テーブル作成が記載されているファイル ''/var/www/html/pandora_console/pandoradb.sql'' の ''tagent_access''、''tagente_datos''、''tagente_datos_inc''、''tagente_datos_string''、''tagente_datos_inventory'' を利用し、[[:ja:quickguides:ha_percona_xtradb#正しい動作のための_pandora_fms_スキーマの変更|正しい動作のための Pandora FMS スキーマの変更]] の内容を実施します。
  
 4.- Incorporate with **source** all the ''DUMP'' data created in step 1. 4.- Incorporate with **source** all the ''DUMP'' data created in step 1.
 +
 +4.- 手順1 で作成したすべての ''DUMP'' データを **source** で読み込みます。
 +
 <code> <code>
 #mysql -u root -p pandora #mysql -u root -p pandora
行 367: 行 432:
 </code> </code>
  
-At the end of the process, all the tables will have the incremental ids created from in all of them.+At the end of the process, all the tables will have the incremental IDs created from scratch in all of them.
  
-[[:ja:quickguides:start|クガイド一覧に戻る]]+処理が終わると、すべてのテーブルに、最初から作成されたリメンタル ID が含まれます。
  
 +[[:ja:quickguides:start|クイックガイド一覧に戻る]]
  
  • ja/quickguides/ha_percona_xtradb.1653889370.txt.gz
  • 最終更新: 2022/05/30 05:42
  • by junichi