文書の表示以前のリビジョンバックリンク文書の先頭へ この文書は読取専用です。文書のソースを閲覧することは可能ですが、変更はできません。もし変更したい場合は管理者に連絡してください。 ====== バックアップおよびリストア手順 ====== {{indexmenu_n>7}} [[ja:documentation:start|Pandora FMS ドキュメント一覧に戻る]] <wrap #ks1 /> ===== バックアップ手順 ===== <wrap #ks1_1 /> ==== データベースバックアップ ==== First, make a backup of the existing database. There are two methods available to make such backup. 最初に、データベースをバックアップする必要があります。バックアップには 2つの方法があります。 <WRAP center round important 90%> If a history database is used, perform its backup as well. </WRAP> <WRAP center round important 90%> ヒストリデータベースを利用している場合は、そのバックアップも実行します。 </WRAP> <wrap #ks1_1_1 /> === 手動バックアップ === Open a terminal window with the appropriate user credentials and enter the following commands (enter the access credentials for the database): 適切な権限のユーザでターミナルウィンドウを開き、次のコマンドを入力します(データベースのアクセス情報を入力します): <code bash> mysqldump -u < pandora_db_user > -p < pandora_db_name > | gzip> pandoradb.sql.gz </code> <wrap #ks1_1_2 /> === Pandora FMS データベースバックアップユーティリティ === Pandora FMS allows to [[:en:documentation:pandorafms:monitoring:17_discovery_2#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:pandorafms:monitoring:17_discovery_2#コンソールタスク|定期的なデータベースのバックアップ]] を設定できます。 {{ :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) ボタンをクリックします。 <wrap #ks1_2 /> ==== 設定ファイルバックアップ ==== Pandora のエージェントおよびサーバの設定ファイルをバックアップするには、次のコマンドを実行します。 <code bash> tar -pcvzf pandora_configuration.tar.gz /etc/pandora/*.conf </code> <wrap #ks1_3 /> ==== エージェントバックアップ ==== エージェントディレクトリもバックアップする必要があります。すでに配布されているコレクションやエージェントプラグインを保存するために重要です。 <code bash> tar -pcvzf agent.tar.gz /usr/share/pandora_agent </code> <wrap #ks1_4 /> ==== サーババックアップ ==== <wrap #ks1_4_1 /> === サーバブラグイン === サーバプラグインが置かれているデフォルトディレクトリは、/usr/share/pandora_server (Pandora サーバのメインディレクトリ) です。 **注意**: 他のディレクトリ内にサーバプラグインがある場合は、それもバックアップする必要があります。 <code bash> tar -pcvzf pandora_server.tar.gz /usr/share/pandora_server tar -pcvzf my_plugin_folder.tar.gz /home/myuser/my_plugin_folder </code> <WRAP center round tip 90%> If you have server plugins located in other directories, you should also back them up. </WRAP> <WRAP center round tip 90%> 他のディレクトリにサーバー プラグインがある場合は、それらもバックアップする必要があります。 </WRAP> <wrap #ks1_4_2 /> === リモート設定 === リモートエージェントの動作のために、リモート設定ファイルおよびコレクションのバックアップが必要です。 <code bash> 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 </code> <wrap #ks1_5 /> ==== コンソールバックアップ ==== カスタム画像、拡張などを保存するために、コンソールのバックアップを実行します。 <code bash> tar -pcvzf pandora_console.tar.gz /var/www/html/pandora_console </code> <wrap #ks2 /> ===== リストア手順 ===== Perform the [[:en:documentation:pandorafms:installation:01_installing|installation procedure]]. [[:ja:documentation:pandorafms:installation:01_installing|インストール]] 手順を実施します。 <wrap #ks2_1 /> ==== データベースリストア ==== <WRAP center round important 90%> If you use a history database, restore it as well. </WRAP> <WRAP center round important 90%> ヒストリ DB を利用している場合は、そのリストアも実行する必要があります。 </WRAP> <wrap #ks2_1_1 /> === 手動リストア === データベースが起動し、Pandora サーバとエージェントが停止していることを確認します。 <code bash> [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. </code> <WRAP center round tip 90%> From version NG 754 onwards, [[en:documentation:pandorafms:installation:06_server_management#ks1|additional options are available for manual startup and shutdown]] of High Availability (HA) environments. </WRAP> <WRAP center round tip 90%> バージョン NG 754 以降では、高可用性(HA)環境の[[:ja:documentation:pandorafms:installation:06_server_management#pandora_fms_サーバの手動起動・停止|手動起動および停止のための追加オプションがあります。]] </WRAP> その後、データベースをリストアします。 <code bash> [root@localhost ~]# gunzip pandora.sql.gz [root@localhost ~]# cat pandoradb.sql | mysql -u root -p pandora </code> 次の方法でもリカバリできます。 <code bash> mysql –u root –p pandora </code> <code sql> create database pandora; use pandora; source PATH BACKUP; </code> <WRAP center round important 90%> The database to be created must have the same name as the backed-up database. </WRAP> <WRAP center round important 90%> 作成するデータベース名は、バックアップしたものと同じである必要があります。 </WRAP> <wrap #ks2_2 /> ==== 設定ファイルリストア ==== 最初に、エージェントおよびサーバ設定ファイルをリストアします。 <code bash> [root@localhost ~]# tar -zxvf pandora_configuration.tar.gz -C / </code> <wrap #ks2_3 /> ==== エージェントリストア ==== エージェントディレクトリのリストアを実行します。 <code bash> [root@localhost ~]# tar -zxvf agent.tar.gz -C / </code> <wrap #ks2_4 /> ==== サーバリストア ==== <wrap #ks2_4_1 /> === サーバプラグイン === pandora server のメインのディレクトリおよび、プラグインの入ったディレクトリをリストアします。 <code bash> [root@localhost ~]# tar -zxvf pandora_server.tar.gz -C / [root@localhost ~]# tar -zxvf my_plugin_folder.tar.gz -C / </code> <wrap #ks2_4_2 /> === リモート設定 === リモートエージェントが正しく動作するために、リモート設定ファイルおよびコレクションファイルをリストアします。 <code bash> [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 / </code> <wrap #ks2_5 /> ==== コンソールリストア ==== カスタム画像や拡張などを含め、コンソールのリストアを行います。 <code bash> [root@localhost ~]# tar -zxvf pandora_console.tar.gz -C / </code> <wrap #ks2_6 /> ==== Pandora FMS サーバおよびエージェントの起動 ==== 最後に、Pandora FMS サーバとエージェントを起動します。 <code bash> [root@localhost ~]# systemctl start pandora_server [root@localhost ~]# systemctl start pandora_agent_daemon </code> [[ja:documentation:start|Pandora FMS ドキュメント一覧に戻る]] CKG Edit ja/documentation/pandorafms/technical_annexes/07_backup_and_restore_procedures.txt 最終更新: 2025/02/26 02:26by junichi