文書の表示以前のリビジョンバックリンク文書の先頭へ この文書は読取専用です。文書のソースを閲覧することは可能ですが、変更はできません。もし変更したい場合は管理者に連絡してください。 ====== バックアップおよびリストア手順 ====== {{indexmenu_n>7}} [[ja:documentation:pandorafms:start|Pandora FMS ドキュメント一覧に戻る]] <wrap #ks1 /> ===== バックアップ手順 ===== [[#ks1_1|Main database backup]]. [[#ks1_2|Directory and file backup]]. [[#ks2|Recovery and reinstallation from a performed backup]]. [[#ks1_1|メインデータベースバックアップ]] [[#ks1_2|ディレクトリとファイルバックアップ]] [[#ks2|バックアップからのリカバリと再インストール]] <wrap #ks1_1 /> ==== データベースバックアップ ==== First, a backup of the existing database needs to be performed. 最初に、データベースをバックアップする必要があります。 <WRAP center round important 90%> If you use a history database, you must also perform a backup of it. </WRAP> <WRAP center round important 90%> ヒストリデータベースを利用している場合は、そのバックアップも実行します。 </WRAP> <wrap #ks1_1_1 /> === 手動データベースバックアップ === First, open a terminal window with the appropriate user credentials. Enter the following commands (provide the database access credentials): 適切な権限のユーザでターミナルウィンドウを開き、次のコマンドを入力します(データベースのアクセス情報を入力します): <code bash> mysqldump -u <pandora_db_user> -p <pandora_db_name> | gzip > pandoradb.sql.gz </code> This will create a compressed logical backup of the entire Pandora FMS database ''<pandora_db_name>''. これにより、Pandora FMSデータベース全体 ''<pandora_db_name>'' の圧縮された論理バックアップが作成されます。 <wrap #ks1_1_2 /> === Pandora FMS データベースバックアップユーティリティ === Pandora FMS allows for a [[:en:documentation:pandorafms:monitoring:17_discovery_2#ks2_1|database backup periodically]] that can be scheduled in the left side menu, <wrap :en>Management → Discovery → New console task</wrap> and selecting from the drop-down list the option <wrap :en>Backup Pandora FMS database</wrap>: Pandora FMS では、**自動検出(Discovery) > 新しいコンソールタスク(New console task)** から、ドロップダウンで **"Pandora FMS データベースのバックアップ(Backup Pandora FMS database)"** を選択することにより、[[:ja:documentation:pandorafms:monitoring:17_discovery_2#ks2_1|定期的なデータベースのバックアップ]] を設定できます。 {{ :wiki:pfms-create-new-console-task-backup-db-2.png }} To create a new database backup: 新規データベースバックアップの作成には次のようにします。 <wrap :en>Scheduled</wrap>: Select the frequency with which the backup task will run: daily ''Daily'', hourly ''Hourly'', monthly ''Monthly'', without any periodicity ''Not scheduled'', weekly ''Weekly'', or yearly ''Yearly''. <wrap :ja>スケジュール(Scheduled)</wrap>: バックアップ タスクを実行する頻度を選択します。毎日 ''Daily''、毎時 ''hourly''、毎月 ''Monthly''、スケジュールなし ''Not scheduled''、毎週 ''Weekly''、または毎年 ''Yearly''。 <wrap :en>Next execution</wrap>: Select exactly when the backup task will start (first choose the day and then the time); from then on it will be done periodically unless you have chosen the ''Not scheduled'' option in the previous point. <wrap :ja>次の実行(Next execution)</wrap>: バックアップタスクの開始日時を正確に選択します (まず日付を選択し、次に時刻を選択します)。その後は、前の項目で「スケジュールなし」(''Not scheduled'') オプションを選択しない限り、定期的に実行されます。 <wrap :en>Group</wrap>: Group to which the backup task will belong (or select ''All'' for all groups). <wrap :ja>グループ(Group)</wrap>: バックアップタスクが属するグループ(または、すべてのグループを選択する場合は「すべて」(''All'')を選択します)。 In <wrap :en>Parameters</wrap> there are two elements that are important to take into account: <wrap :ja>パラメータ(Parameters)</wrap>には、考慮すべき重要な要素が2つあります。 <wrap :en>Save to disk in path</wrap>: By default, it is stored in ''/var/www/html/pandora_console/attachment/backups'' //but you can specify any directory in which you have read and write permissions// (you must know the exact path since it only has a simple text box for it). <wrap :ja>次のパスに保存(Save to disk in path)</wrap>: デフォルトでは、''/var/www/html/pandora_console/attachment/backups'' に保存されます。//ただし、読み取りと書き込みの権限がある任意のディレクトリを指定できます// (パスを指定するには単純なテキストボックスしかないため、正確なパスを知っている必要があります)。 <wrap :en>Active backups</wrap>: To save storage space, by default, the last three backups performed will be kept. <wrap :ja>アクティブバックアップ(Active backups)</wrap>: ストレージ容量を節約するため、デフォルトでは、最後に実行された 3 つのバックアップが保持されます。 Once you have finished filling out the fields, click the <wrap :en>Create</wrap> button to save. 入力項目をすべて入力したら、<wrap :ja>作成(Create)</wrap>ボタンをクリックして保存してください。 Through the <wrap :en>Pandora FMS database backup manager</wrap> (menu <wrap :en>Management → Setup → Admin tools → DB Backup Manager</wrap>), you will be able to download the backups performed, restore said backups, or simply delete them. //In the event that backups have been deleted, for one reason or another, without using the Web Console for it//, the corresponding item will mark a "lost" state (<wrap :en>Status Lost</wrap>) and the <wrap :en>Delete Lost</wrap> button can be used to permanently delete all backups in that specific state. <wrap :ja>Pandora FMS データベースバックアップマネージャ</wrap> (メニュー <wrap :ja>管理(Management) → セットアップ(Setup) → 管理ツール(Admin tools) → DB バックアップマネージャ(DB Backup Manager)</wrap>) を使用すると、実行されたバックアップをダウンロードしたり、バックアップを復元したり、単に削除したりできます。//Web コンソールを使用せずに、何らかの理由でバックアップが削除された場合//、該当する項目は「紛失(lost)」状態 (<wrap :ja>ステータス紛失(Status Lost)</wrap>) になり、<wrap :ja>紛失を削除(Delete Lost)</wrap> ボタンを使用して、その特定の状態のすべてのバックアップを完全に削除できます。 <wrap #ks1_2 /> ==== 設定ファイルバックアップ ==== First, open a terminal window with the appropriate user credentials. The code shown in this topic uses the ''root'' user; otherwise, prepend the ''sudo'' command to each execution line. To backup Pandora FMS agents and server configuration files: まず、適切なユーザ認証情報を使用してターミナルウィンドウを開きます。このトピックで示されているコードは ''root'' ユーザを使用しています。そうでない場合は、各実行行の前に ''sudo'' コマンドを追加してください。Pandora FMS エージェントとサーバ設定ファイルをバックアップするには以下を実行します。 <code bash> tar -pcvzf pandora_configuration.tar.gz /etc/pandora/*.conf </code> <wrap #ks1_3 /> ==== エージェントバックアップ ==== You also need to back up the Agent file. It is very important to keep the already deployed collections and Agent //plugins//. エージェントファイルのバックアップも必要です。既にデプロイされているコレクションとエージェント//プラグイン//を保持しておくことは非常に重要です。 <code bash> tar -pcvzf agent.tar.gz /usr/share/pandora_agent </code> <wrap #ks1_4 /> ==== サーババックアップ ==== <wrap #ks1_4_1 /> === サーバブラグイン === The default file for server //plugins// is in ''/usr/share/pandora_server'' (the main directory for the <wrap en:>Pandora FMS Servers</wrap>). サーバの //plugins// のデフォルトファイルは ''/usr/share/pandora_server'' (<wrap ja:>Pandora FMS サーバ</wrap> のメインディレクトリ) にあります。 <code bash> tar -pcvzf pandora_server.tar.gz /usr/share/pandora_server </code> <WRAP center round tip 90%> If you have server //plugins// located in other directories, you should back them up as well. </WRAP> <WRAP center round tip 90%> サーバの //plugins// が他のディレクトリにある場合は、それらもバックアップする必要があります。 </WRAP> <code bash> tar -pcvzf my_plugin_folder.tar.gz /home/my_user/my_plugin_folder </code> <wrap #ks1_4_2 /> === リモート設定 === A backup of remote configuration files and collections must be executed to maintain the correct behavior of the remote Agent. リモートエージェントの正常な動作を維持するためには、リモート設定ファイルとコレクションのバックアップを実行する必要があります。 <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 /> ==== コンソールバックアップ ==== Finally, run a backup of the PFMS Web Console. This way, custom images, extensions, etc., can be preserved. 最後に、PFMS Web コンソールのバックアップを実行します。これにより、カスタムイメージや拡張機能などを保持できます。 <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, you must perform a recovery of it as well. </WRAP> <WRAP center round important 90%> ヒストリデータベースを使用している場合は、そのデータベースの復旧も実行する必要があります。 </WRAP> <wrap #ks2_1_1 /> === 手動リストア === Make sure your database is up and running, and that the <wrap en:>Pandora FMS Server</wrap> and the local EndPoint are stopped. データベースが起動して動作していること、および <wrap ja:>Pandora FMS サーバ</wrap> とローカルエンドポイントが停止していることを確認してください。 <code bash> systemctl start mysqld Starting mysqld: [ OK ] systemctl stop pandora_server Stopping Pandora FMS Server 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 for manual start and stop]] of High Availability (HA) environments are available. </WRAP> <WRAP center round tip 90%> バージョン NG 754 以降では、高可用性(HA)環境の[[:ja:documentation:pandorafms:installation:06_server_management#ks1|手動起動および停止のための追加オプションがあります。]] </WRAP> Decompress and import the database. データベースを解凍してインポートします。 <WRAP center round important 90%> The database name (''<pandora_db_name>'') must be the same as the one the //backup// was made from. </WRAP> <WRAP center round important 90%> データベース名(''<pandora_db_name>'')は、//バックアップ// が作成されたデータベース名と同じである必要があります。 </WRAP> <code bash> gunzip pandora.sql.gz cat pandora.sql | mysql -u root -p <pandora_db_name> </code> Additionally, recovery can be performed in the following way: さらに、復旧は以下の方法でも行うことができます。 <code bash> mysql -u root -p <pandora_db_name> </code> <WRAP center round important 90%> The database name (''<pandora_db_name>'') must be the same as the one the //backup// was made from. </WRAP> <WRAP center round important 90%> データベース名(''<pandora_db_name>'')は、//バックアップ// が作成されたデータベース名と同じである必要があります。 </WRAP> <code sql> create database <pandora_db_name>; use <pandora_db_name>; source PATH_BACKUP; </code> <wrap #ks2_2 /> ==== 設定ファイルリストア ==== First, recover the configuration files for the Agents and servers: 最初に、エージェントおよびサーバ設定ファイルをリストアします。 <code bash> tar -zxvf pandora_configuration.tar.gz -C / </code> <wrap #ks2_3 /> ==== エージェントリストア ==== Now, perform the recovery of the EndPoint directory: エンドポイントディレクトリのリストアを実行します。 <code bash> tar -zxvf agent.tar.gz -C / </code> <wrap #ks2_4 /> ==== サーバリストア ==== <wrap #ks2_4_1 /> === サーバプラグイン === Restore the main Pandora FMS server file: メインの Pandora FMS サーバファイルを復元します。 <code bash> tar -zxvf pandora_server.tar.gz -C / </code> And restore any other custom //plugin// files you may have: また、お持ちのその他のカスタム //プラグイン// ファイルもすべて復元します。 <code bash> tar -zxvf my_plugin_folder.tar.gz -C / </code> <wrap #ks2_4_2 /> === リモート設定 === Restoring remote configuration files and collections must be performed to maintain the correct operation of the remote Agent. リモートエージェントの正常な動作を維持するためには、リモート設定ファイルとコレクションの復元を実行する必要があります。 <code bash> tar -zxvf collections.tar.gz -C / tar -zxvf md5.tar.gz -C / tar -zxvf remote_agents_conf.tar.gz -C / </code> <wrap #ks2_5 /> ==== コンソールリストア ==== Now run a Console recovery to restore custom images, extensions, etc. 次に、コンソールリカバリを実行して、カスタムイメージや拡張機能などを復元します。 <code bash> tar -zxvf pandora_console.tar.gz -C / </code> <wrap #ks2_6 /> ==== Pandora FMS サーバおよびエンドポイントの起動 ==== The last step is to start the Pandora FMS server and the EndPoint: 最後に、Pandora FMS サーバとエンドポイントを起動します。 <code bash> systemctl start pandora_server systemctl start pandora_agent_daemon </code> [[ja:documentation:pandorafms:start|Pandora FMS ドキュメント一覧に戻る]] CKG Edit ja/documentation/pandorafms/technical_annexes/07_backup_and_restore_procedures.txt 最終更新: 2026/03/21 08:44by junichi