差分
このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン最新のリビジョン両方とも次のリビジョン | ||
ja:documentation:05_big_environments:07_server_management [2022/07/08 23:08] – [ヒストリデータベースの設定] junichi | ja:documentation:05_big_environments:07_server_management [2022/12/09 08:43] – [NG 753 およびそれ以前のバージョンにおけるヒストリデータベース] junichi | ||
---|---|---|---|
行 629: | 行 629: | ||
* ヒストリデータベースにアクセスできるように Pandora FMS サーバとコンソールで利用するユーザのパーミッション('' | * ヒストリデータベースにアクセスできるように Pandora FMS サーバとコンソールで利用するユーザのパーミッション('' | ||
+ | |||
+ | **For MySQL 5.7** | ||
+ | |||
+ | **MySQL 5.7 向け:** | ||
<code bash> | <code bash> | ||
GRANT ALL PRIVILEGES ON pandora_history.* TO ' | GRANT ALL PRIVILEGES ON pandora_history.* TO ' | ||
+ | |||
+ | |||
+ | </ | ||
+ | |||
+ | **For MySQL 8:** | ||
+ | |||
+ | **MySQL 8 向け:** | ||
+ | |||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | |||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | |||
+ | To use these environment variables just define them before running //grants// in the terminal, enter the following: | ||
+ | |||
+ | これらの環境変数を使用するには、// | ||
+ | |||
+ | <code bash> | ||
+ | env TZ=' | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | </ | ||
+ | |||
+ | Enter in the terminal: | ||
+ | |||
+ | ターミナルで以下を実行します: | ||
+ | |||
+ | <code bash> | ||
+ | systemctl restart mysql | ||
+ | |||
+ | </ | ||
+ | |||
+ | Enter in the terminal: | ||
+ | |||
+ | ターミナルで以下を実行します: | ||
+ | |||
+ | <code bash> | ||
+ | |||
+ | export MYSQL_PWD=$DBROOTPASS | ||
+ | echo " | ||
+ | echo "ALTER USER \" | ||
+ | echo "GRANT ALL PRIVILEGES ON $DBNAME.* TO \" | ||
+ | |||
+ | export MYSQL_PWD=$DBPASS | ||
行 730: | 行 792: | ||
- | === ヒストリデータベースの削除と圧縮設定 === | ||
- | History database is supposed to contain all history data, but if you want to delete old data, or compact them, you will need to use some specific data in database that take into account the script **pandora_db** when executed from the node. | ||
- | |||
- | ヒストリデータベースは、" | ||
- | |||
- | First, enter some data from the history database in //tconfig// table. Use this SQL queries to create a minimal configuration and configure the performance od **pandora_db** when executed against the history databas. First you need to connect to your database using the command line (CLI) of MySQL. | ||
- | |||
- | 最初に、pandora_db ツールによって利用できるように、// | ||
- | |||
- | This is an example, replace values according to your criteria (but leave '' | ||
- | |||
- | 以下が例です。値は必要に応じて書き換えてください。(ただし、history_db_enabled は 0 にしてください) | ||
- | |||
- | < | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | |||
- | </ | ||
- | |||
- | * This example is for the history database ito store for 6 months (180 days) from the execution date. | ||
- | * Compact data more than 4 months old (120 days). | ||
- | * If you have 1 month worth of data in your main database, you will have a total of 6 months of data, because the last month has no data in the history database, but it has them in the main database. | ||
- | * You may type in any value here, there is no limit of data storage in history database aprt from the machine' | ||
- | |||
- | * この例は、ヒストリデータベースに(現在からさかのぼること) 6ヶ月間データを保存します。 | ||
- | * 4ヶ月(120日)前のデータを圧縮することを意味します。 | ||
- | * メインのデータベースに 1ヶ月間のデータがあるとしても、トータルで 6ヶ月間のデータとなります。なぜなら、直近 1ヶ月のデータはメインデータベースから読まれ、それ以外はヒストリデータベースから読まれるためです。 | ||
- | * これらには任意の値を設定できます。ヒストリデータベースにはデータ量の上限はありません。ただし、ヒストリデータベースは、メインデータベースおよび Pandora FMS サーバやコンソールが動作しているマシンとは物理的に異なるマシンに配置しなければいけないことを理解してください。 | ||
- | |||
- | <WRAP center round tip 75%> In versions prior to Pandora FMS 753 you must execute the script **pandora_db** | ||
- | |||
- | <WRAP center round tip 75%> Pandora FMS 753 より前のバージョンでは、通常のデータベースと同じように、前述のデータベースと以降で説明する追加の設定ファイルを用いてヒストリサーバでメンテナンスのために **pandora_db** スクリプトを実行する必要があります。</ | ||
- | |||
- | In versions prior to Pandora FMS 753, create an additional '' | ||
- | |||
- | Pandora FMS 753 までのバージョンでは、追加の '' | ||
- | |||
- | < | ||
- | dbengine mysql | ||
- | dbname pandora4_history | ||
- | dbuser pandora4_history | ||
- | dbpass 1234 | ||
- | dbhost 192.168.50.23 | ||
- | log_file / | ||
- | </ | ||
- | |||
- | Now you can execute **pandora_db** | ||
- | |||
- | これで、ヒストリデータベースに対して **pandora_db** ツールの定期実行をプログラムできます。 | ||
- | |||
- | < | ||
- | / | ||
- | |||
- | </ | ||
- | |||
- | また、設定値は[[: | ||
- | |||
- | <WRAP center round tip 60%> | ||
- | この処理は、メインのデータベースには影響しません。なぜなら、異なるサーバの異なるデータベースに対して行っているためです。 | ||
- | </ | ||
[[ja: | [[ja: | ||