ja:documentation:pandorafms:complex_environments_and_optimization:08_optimization

差分

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

この比較画面へのリンク

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
ja:documentation:pandorafms:complex_environments_and_optimization:08_optimization [2024/11/12 02:48] – [診断情報] kanayamaja:documentation:pandorafms:complex_environments_and_optimization:08_optimization [2025/02/26 02:42] (現在) – [全体の再構築] junichi
行 1114: 行 1114:
 === 全体の再構築 === === 全体の再構築 ===
  
-This section affects only **InnoDB** databases. Pandora FMS is built on Innodb databases.+The **PFMS server** must first be stopped:
  
-この節の説明は、Innodb データベースのみ該当しす。Pandora FMS は、Innodb デタベース利用しています。+ず**PFMS サバ**停止する必要があります。
  
-Unfortunately, MySQL is degraded with time, and this affects the global performance of the system.There is no other solution that does not involve rebuilding all the database schemes from scratch, rebuilding the data binary file that MySQL uses to store all the information and the files used to rebuild the transactions.+<code bash> 
 +systemctl stop pandora_ha
  
-時間ともに MySQL のパフォーマンスが落ちると、システム全体のパフォーマンスに影響します。この場合は、すべてのデータベーススキーマをゼロから再構築する以外に解決策はありません。MySQL がデータの保存に利用しているバイナリファイルを利用し、またそれを再構築します。+</code>
  
-If you take look at the ''/var/lib/mysql'' directory, you may see that there are three files, that have always the same nameand that are, depending on the severity of the case, hugeIn this example:+Secondly, an export of all schemas and data must be done. Choose a directory of the machinein a partition that has enough space to store the backup of the database in case it is a large databaseThe following command is executed:
  
-''/var/lib/mysql'' ィレクトと、常同じ名前を持ち状態応じて非常に大きサイズのファイルが 3 つあることがわかります。この例では、次のようになります。 +次に、すべてのスキーマとータのエスポートを実行す必要があります。データベースが大きい場合備えてデータベースのバックアップを保存するの十分スペースがあるパーティション内のディレクトリを選択します。次のコマンドを実行します。
-<file> +
- -rw-rw----  1 mysql mysql 4.8G 2012-01-12 14:00 ibdata1 +
- -rw-rw----  1 mysql mysql 5.0M 2012-01-12 14:00 ib_logfile0 +
- -rw-rw----  1 mysql mysql 5.0M 2012-01-12 14:00 ib_logfile1+
  
-</file>+<code bash> 
 +mysqldump -uroot -p pandora --single-transaction > backup.sql
  
-The ''ibdata1'' file is the one that stores all the system Innobd data. In a very fragmented system that has not been "rebuilt" or "installed" for a long time, this system will be big but little efficient. The ''innodb_file_per_table'' parameter, that was [[#ks1_3|mentioned before]], regulates part of this performance.+</code>
  
-''ibdata1'' ファイルは、すべてのシステム Innobd データを保存するファイルです。長い間「再構築」または「インストール」されていない非常に断片化されたシステムでは、これは大きくなり効率は下がります。[[#ks1_3|前に説明した]] ''innodb_file_per_table'' パラメータは、このパフォーマンスの一部を制御します。+After finishing the process we will have in the file ''backup.sql'' the data, in the directory where we are.
  
-Similarly, each database has in the ''/var/lib/mysql'' **directory,** one directory to define its structure. Delete them too.+処理が完了すると、現在のディレクトリ内のファイル ''backup.sql'' にデータが格納されます。
  
-同様に、各データベースは ''/var/lib/mysql'' **ディレクトリ** 内に、その構造を定義する 1 つのディレクトリがあります。これらも削除します。+Once this is done, MySQL is stopped with:
  
-The process is quite easy:+これが完了したら、MySQL を次のように停止します。
  
-手順はとても簡単です。+<code bash> 
 +systemctl stop mysqld.service
  
-  - Dump (via **mysqldump**) all the schemes to the disk:+</code>
  
-  - すべてのマをディクにダンプします (**mysqldump**  経由)+Access the MySQL installation directory in ''/var/lib/mysql'' and delete the files named ''binlog.000001'', ''binlog.000002'' … and ''binlog.index''. In addition, we will delete the directory with the same name as the database ''pandora''
 + 
 +MySQL インディトリ (''/var/lib/mysql''アクセスし、''binlog.000001''、''binlog.000002''、… および ''binlog.index'' という名前のファイルを削除します。さらに、データベース ''pandora'' と同じ名前のディレクトリも削除します。
  
 <code bash> <code bash>
-mysqldump -u root --A> alldata.sql+rm -rf /var/lib/mysql/pandora 
 +rm -rf /var/lib/mysql/binlog.0* 
 +rm -rf /var/lib/mysql/binlog.index
  
 </code> </code>
  
-  * Stop MySQL. +Once these steps are donewe will start MySQL again with:
-  * Delete ''ibdata1'', ''ib_logfile0''''ib_logfile1''  and the InnoDB database directories +
-  * Start MySQL+
-  * Create ''pandora''  database again (''create database pandora;''+
-  * Import the backup file (''alldata.sql'')+
  
-  * MySQL を停止ます。 +これらの手順が完了たら次のコマンドで MySQL を再起動します。
-  * ''ibdata1'' ''ib_logfile0'' 、''ib_logfile1'' 、およびInnoDBデータベースディレクトリを削除します。 +
-  * MySQL を再起動します。 +
-  * ''pandora''  データベースを再度作成します (''create database pandora;''+
-  * バックアップファイル(''alldata.sql'' )をインポートします+
  
 <code bash> <code bash>
-mysql -u root -p+systemctl start mysqld.service
  
 </code> </code>
 +
 +Access the MySQL terminal with the following command:
 +
 +次のコマンドで MySQL ターミナルにアクセスします。
 +
 +<code bash>
 +mysql -uroot -p pandora
 +
 +</code>
 +
 +The ''pandora'' database will be selected, but it will be empty. The following command is used to import in the database the //backup// that we did from the Pandora FMS database:
 +
 +''pandora'' データベースが選択されますが空の状態です。Pandora FMS データベースから実行した //バックアップ// をデータベースにインポートするために次のコマンドを使用します。
  
 <code sql> <code sql>
-CREATE DATABASE pandora; +source backup.sql;
-USE pandora; +
-SOURCE alldata.sql;+
  
 </code> </code>
  
-The system should work faster now.+Finally the **PFMS server** must be started:
  
-システムの作が高速化されはずです。+最後に、**PFMS サーバ** を起必要があります。
  
-<wrap #ks1_11 />+<code bash> 
 +systemctl start pandora_ha
  
 +</code>
 +
 +<wrap #ks1_11 />
  
 ==== オプションのインデックス ==== ==== オプションのインデックス ====
  • ja/documentation/pandorafms/complex_environments_and_optimization/08_optimization.1731379692.txt.gz
  • 最終更新: 2024/11/12 02:48
  • by kanayama