バックアップおよびリストア手順
バックアップ手順
データベースバックアップ
First, make a backup of the existing database. There are two methods available to make such backup.
最初に、データベースをバックアップする必要があります。バックアップには 2つの方法があります。
If a history database is used, perform its backup as well.
ヒストリデータベースを利用している場合は、そのバックアップも実行します。
手動バックアップ
Open a terminal window with the appropriate user credentials and enter the following commands (enter the access credentials for the database):
適切な権限のユーザでターミナルウィンドウを開き、次のコマンドを入力します(データベースのアクセス情報を入力します):
mysqldump -u < pandora_db_user > -p < pandora_db_name > | gzip> pandoradb.sql.gz
Pandora FMS データベースバックアップユーティリティ
Pandora FMS allows to periodically perform a backup of the database that can be programmed in the following ways Discovery → New console task and selecting from the drop-down menu Backup Pandora FMS database.
Pandora FMS では、自動検出(Discovery) > 新しいコンソールタスク(New console task) から、ドロップダウンで “Pandora FMS データベースのバックアップ(Backup Pandora FMS database)“ を選択することにより、定期的なデータベースのバックアップ を設定できます。
To create a new database backup:
新規データベースバックアップの作成には次のようにします。
- Select the backup frequency or one-time with “Not scheduled”.
- Select exactly when the “Next execution” backup task will be started.
- You need to indicate the content of which groups to support (or select all “All”).
- By default it is stored in
/var/www/html/pandora_console/attachment/backups
but you can specify any directory to which you have write and read rights.
- 定期バックアップもしくは、”Not scheduled” で一回のみのバックアップを選択します。
- “次の実行(Next execution)” バックアップタスクを開始するタイミングを正確に選択します。
- サポートするグループの内容を指定する必要があります(または “すべて(All)” を選択します)。
- デフォルトでは
/var/www/html/pandora_console/attachment/backups
に保存されますが、読み書きできる任意のディレクトリを指定することができます。
Once you have finished filling in the fields, click on the Create button.
フィールドへの入力が完了したら、作成(Create) ボタンをクリックします。
設定ファイルバックアップ
Pandora のエージェントおよびサーバの設定ファイルをバックアップするには、次のコマンドを実行します。
tar -pcvzf pandora_configuration.tar.gz /etc/pandora/*.conf
エージェントバックアップ
エージェントディレクトリもバックアップする必要があります。すでに配布されているコレクションやエージェントプラグインを保存するために重要です。
tar -pcvzf agent.tar.gz /usr/share/pandora_agent
サーババックアップ
サーバブラグイン
サーバプラグインが置かれているデフォルトディレクトリは、/usr/share/pandora_server (Pandora サーバのメインディレクトリ) です。
注意: 他のディレクトリ内にサーバプラグインがある場合は、それもバックアップする必要があります。
tar -pcvzf pandora_server.tar.gz /usr/share/pandora_server tar -pcvzf my_plugin_folder.tar.gz /home/myuser/my_plugin_folder
If you have server plugins located in other directories, you should also back them up.
他のディレクトリにサーバー プラグインがある場合は、それらもバックアップする必要があります。
リモート設定
リモートエージェントの動作のために、リモート設定ファイルおよびコレクションのバックアップが必要です。
tar -pcvzf collections.tar.gz /var/spool/pandora/data_in/collections tar -pcvzf md5.tar.gz /var/spool/pandora/data_in/md5 tar -pcvzf remote_agents_conf.tar.gz /var/spool/pandora/data_in/conf
コンソールバックアップ
カスタム画像、拡張などを保存するために、コンソールのバックアップを実行します。
tar -pcvzf pandora_console.tar.gz /var/www/html/pandora_console
リストア手順
データベースリストア
If you use a history database, restore it as well.
ヒストリ DB を利用している場合は、そのリストアも実行する必要があります。
手動リストア
Make sure that your database is up and running, and Pandora FMS server and EndPoint are shut down.
データベースが起動し、Pandora FMS サーバとエンドポイントが停止していることを確認します。
[root@localhost ~]# systemctl start mysqld Starting mysqld: [ OK ] [root@localhost ~]# systemctl stop pandora_server Stopping Pandora FMS Server [root@localhost ~]# systemctl stop pandora_agent_daemon Stopping Pandora Agent.
From version NG 754 onwards, additional options are available for manual startup and shutdown of High Availability (HA) environments.
バージョン NG 754 以降では、高可用性(HA)環境の手動起動および停止のための追加オプションがあります。
その後、データベースをリストアします。
[root@localhost ~]# gunzip pandora.sql.gz [root@localhost ~]# cat pandoradb.sql | mysql -u root -p pandora
次の方法でもリカバリできます。
mysql –u root –p pandora
CREATE DATABASE pandora; USE pandora; SOURCE PATH BACKUP;
The database to be created must have the same name as the backed-up database.
作成するデータベース名は、バックアップしたものと同じである必要があります。
設定ファイルリストア
最初に、エージェントおよびサーバ設定ファイルをリストアします。
[root@localhost ~]# tar -zxvf pandora_configuration.tar.gz -C /
エージェントリストア
エージェントディレクトリのリストアを実行します。
[root@localhost ~]# tar -zxvf agent.tar.gz -C /
サーバリストア
サーバプラグイン
pandora server のメインのディレクトリおよび、プラグインの入ったディレクトリをリストアします。
[root@localhost ~]# tar -zxvf pandora_server.tar.gz -C / [root@localhost ~]# tar -zxvf my_plugin_folder.tar.gz -C /
リモート設定
リモートエージェントが正しく動作するために、リモート設定ファイルおよびコレクションファイルをリストアします。
[root@localhost ~]# tar -zxvf collections.tar.gz -C / [root@localhost ~]# tar -zxvf md5.tar.gz -C / [root@localhost ~]# tar -zxvf remote_agents_conf.tar.gz -C /
コンソールリストア
カスタム画像や拡張などを含め、コンソールのリストアを行います。
[root@localhost ~]# tar -zxvf pandora_console.tar.gz -C /
Pandora FMS サーバおよびエンドポイントの起動
The last step is to start Pandora FMS server and EndPoint:
最後に、Pandora FMS サーバとエンドポイントを起動します。
[root@localhost ~]# systemctl start pandora_server [root@localhost ~]# systemctl start pandora_agent_daemon