====== バックアップおよびリストア手順 ======
{{indexmenu_n>7}}
[[ja:documentation:start|Pandora FMS ドキュメント一覧に戻る]]
===== バックアップ手順 =====
==== データベースバックアップ ====
Firstly, 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 -p | gzip> pandoradb.sql.gz
<コンソールでパスワードを入力>
=== Pandora FMS データベースバックアップユーティリティ ===
Pandora FMS allows to [[:en:documentation:03_monitoring:04_discovery#console_tasks|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)"** を選択することにより、[[:ja:documentation:03_monitoring:04_discovery#コンソールタスク|定期的なデータベースのバックアップ]] を設定できます。
{{ :wiki:pfms-create-new-console-task-backup-db.png }}
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
=== リモート設定 ===
リモートエージェントの動作のために、リモート設定ファイルおよびコレクションのバックアップが必要です。
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
===== リストア手順 =====
Perform the [[:en:documentation:02_installation:01_installing|installation]] procedure.
[[:ja:documentation:02_installation:01_installing|インストール]] 手順を実施します。
==== データベースリストア ====
ヒストリ DB を利用している場合は、そのリストアも実行する必要があります。
=== 手動リストア ===
データベースが起動し、Pandora サーバとエージェントが停止していることを確認します。
[root@localhost ~]# /etc/init.d/mysqld start
Starting mysqld: [ OK ]
[root@localhost ~]# /etc/init.d/pandora_server stop
Stopping Pandora FMS Server
[root@localhost ~]# /etc/init.d/pandora_agent_daemon stop
Stopping Pandora Agent.
\\
From version NG 754 onwards, [[:en:documentation:05_big_environments:07_server_management#manual_startupshutdown_for_pandora_fms_servers|additional options are available for manual startup and shutdown]] of High Availability (HA) environments.\\
\\
バージョン NG 754 以降では、高可用性(HA)環境の[[:ja:documentation:02_installation:06_server_management#pandora_fms_サーバの手動起動・停止|手動起動および停止のための追加オプションがあります。]]\\
その後、データベースをリストアします。
[root@localhost ~]# gunzip pandora.sql.gz
[root@localhost ~]# cat pandoradb.sql | mysql -u root -p pandora
Enter password:
次の方法でもリカバリできます。
mysql –u root –p pandora
create database pandora;
use pandora;
source PATH BACKUP;
作成するデータベース名は、バックアップしたものと同じである必要があります。
==== 設定ファイルリストア ====
最初に、エージェントおよびサーバ設定ファイルをリストアします。
[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 サーバおよびエージェントの起動 ====
最後に、Pandora FMS サーバとエージェントを起動します。
[root@localhost ~]# /etc/init.d/pandora_server start
[root@localhost ~]# /etc/init.d/pandora_agent_daemon start
[[ja:documentation:start|Pandora FMS ドキュメント一覧に戻る]]