両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン |
ja:documentation:pandorafms:complex_environments_and_optimization:08_optimization [2024/11/12 02:47] – [Pandora FMS の診断ツール] kanayama | ja:documentation:pandorafms:complex_environments_and_optimization:08_optimization [2025/02/26 02:42] (現在) – [全体の再構築] junichi |
---|
=== 全体の再構築 === | === 全体の再構築 === |
| |
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 a look at the ''/var/lib/mysql'' directory, you may see that there are three files, that have always the same name, and that are, depending on the severity of the case, huge. In this example: | Secondly, an export of all schemas and data must be done. Choose a directory of the machine, in a partition that has enough space to store the backup of the database in case it is a large database. The 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> |
| |
| 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''. |
| |
- すべてのスキーマをディスクにダンプします (**mysqldump** 経由)。 | MySQL インストールディレクトリ (''/var/lib/mysql'') にアクセスし、''binlog.000001''、''binlog.000002''、… および ''binlog.index'' という名前のファイルを削除します。さらに、データベース ''pandora'' と同じ名前のディレクトリも削除します。 |
| |
<code bash> | <code bash> |
mysqldump -u root -p -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 done, we 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 /> |
| |
==== オプションのインデックス ==== | ==== オプションのインデックス ==== |
==== 診断情報 ==== | ==== 診断情報 ==== |
| |
This tool is located in the <wrap :en>**Management → Admin tools → Diagnostic Info**</wrap> section, and is designed to provide the most important information about Pandora FMS configuration and its database. | This tool is located in the <wrap :en>**Management → Admin tools → Diagnostic Info**</wrap> section, and is conceived to provide the most important information about Pandora FMS configuration and its database. |
| |
このツールは <wrap :ja>**管理(Management) → 管理ツール(Admin tools) → 診断情報(Diagnostic Info)**</wrap> セクションにあり、Pandora FMS の設定とデータベースに関する最も重要な情報を提供するように設計されています。 | このツールは <wrap :ja>**管理(Management) → 管理ツール(Admin tools) → 診断情報(Diagnostic Info)**</wrap> セクションにあり、Pandora FMS の設定とデータベースに関する最も重要な情報を提供するように設計されています。 |
| |
{{ :wiki:diagnostic_info.png }} | [[:wiki:diagnostic_info.png?id=ja%3Adocumentation%3Apandorafms%3Acomplex_environments_and_optimization%3A08_optimization&media=wiki:diagnostic_info.png|{{ :wiki:diagnostic_info.png }}]] |
| |
| [[:ja:documentation:start|Pandora FMS ドキュメント一覧に戻る]] |
| |
[[ja:documentation:start|Pandora FMS ドキュメント一覧に戻る]] | |
| |
===== (OBSOLETE) ===== | ===== (OBSOLETE) ===== |