ja:documentation:pandorafms:technical_annexes:16_elastic_search_backup

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
ja:documentation:pandorafms:technical_annexes:16_elastic_search_backup [2024/08/22 08:27] – [スナップショット] junichija:documentation:pandorafms:technical_annexes:16_elastic_search_backup [2024/10/11 22:56] (現在) – [Elastic Search バックアップ] junichi
行 1: 行 1:
-====== Elastic Search バックアップ ====== +====== Elastic Search バックアップとリストア ======  
 {{indexmenu_n>16}} {{indexmenu_n>16}}
  
行 6: 行 7:
 <WRAP center round info 90%> <WRAP center round info 90%>
  
-From NG 774 version, Pandora FMS incorporates [[en:documentation:pandorafms:technical_annexes:38_opensearch_installation|OpenSearch]] for //logs// monitoring, this topic is only valid for version 773 or previous versions.+From NG 774 version, Pandora FMS incorporates [[:en:documentation:pandorafms:technical_annexes:38_opensearch_installation|OpenSearch]] for //log// monitoring, this topic is only valid for version 773 or previous versions.
  
 </WRAP> </WRAP>
行 129: 行 130:
 <wrap #ks2 /> <wrap #ks2 />
  
-==== バックアップのリストア ====+===== バックアップのリストア ====
 + 
 +  * **On the target machine** 
   * ターゲットマシンにて   * ターゲットマシンにて
  
-1) ソースマシンでバックアップを作成するときに行ったのと同じように、設定ファイルの "elasticsearch.yml" を編集します。+Modify the configuration file ''elasticsearch.yml'' in the same way as in [[#ks1|create the backup on the source machine]]:
  
-  vi /etc/elasticsearch/elasticsearch.yml+[[#ks1|ソースマシンでバックアップを作成]]するときに行ったのと同じように、設定ファイルの "elasticsearch.yml" を編集します。 
 + 
 +<code bash> 
 +vi /etc/elasticsearch/elasticsearch.yml 
 + 
 +</code> 
 + 
 +Add the following line:
  
 次の行を追加します。 次の行を追加します。
  
-  path.repo: /usr/local/var/backups/+<code> 
 +path.repo: /usr/local/var/backups/
  
-{{ wiki: Elk2.png?600 }}+</code>
  
-2) 設定ファイルに追記したディレクトリを作成します。+Create the directory previously added to the configuration file:
  
-  mkdir -p /usr/local/var/backups/+設定ファイルに追記したディレクトリを作成します。
  
-3) ディレクトリのパーミッションとユーザを設定します。+<code bash> 
 +mkdir -p /usr/local/var/backups/
  
-<code> 
- chmod 700 /usr/local/var/backups 
- chown elasticsearch:elasticsearch /usr/local/var/backups 
 </code> </code>
  
-4) サービスを再起動します。+Grant read and write permissions to the directory:
  
-  /etc/init.d/elasticsearch restart+ディレクトリのパーミッションとユーザを設定します。
  
-5) ソースマシンからコピーしたバックアップを展開します。+<code bash> 
 +chmod 700 /usr/local/var/backups 
 +chown elasticsearch:elasticsearch /usr/local/var/backups
  
-  tar -xzvf /home/user/backup/elastic_backup.tar.gz -C /usr/local/var/backups+</code>
  
-6) スナップショットがある場所でリポジトリを作成します。+Restart the service:
  
-<code>+サービスを再起動します。 
 + 
 +<code bash> 
 +/etc/init.d/elasticsearch restart 
 + 
 +</code> 
 + 
 +Unzip the backup imported from the source machine: 
 + 
 +ソースマシンからコピーしたバックアップを展開します。 
 + 
 +<code bash> 
 +tar -xzvf /home/user/backup/elastic_backup.tar.gz -C /usr/local/var/backups 
 + 
 +</code> 
 + 
 +Create the repositories where the snapshots are located: 
 + 
 +スナップショットがある場所でリポジトリを作成します。 
 + 
 +<code bash>
 curl -X PUT "localhost:9200/_snapshot/my_backup" -H 'Content-Type: application/json' -d' curl -X PUT "localhost:9200/_snapshot/my_backup" -H 'Content-Type: application/json' -d'
  
行 173: 行 205:
 } }
 ' '
 +
 </code> </code>
  
-7) インデックスを閉じます。+Close the indexes:
  
-  curl -XPOST http://localhost:9200/<indexname>-*/_close+インデックスを閉じます。 
 + 
 +<code bash> 
 +curl -XPOST http://localhost:9200/< indexes_names >-*/_close 
 + 
 +</code> 
 + 
 +<WRAP center round tip 90%> 
 + 
 +The asterisk shows all indexes starting with that name, ''< indexes_names >''.
  
-<WRAP center round tip 60%> 
-アスタリスクは、その名前で始まるすべてのインデックスを示します。 
 </WRAP> </WRAP>
  
-8) バックアップをインポートします。+<WRAP center round tip 90%>
  
-最初にックアップリポジトリへコピーします。+アスタリスクはその名前 ''< indexes_names >'' で始まるすべてのインデックします。
  
-  cp <name of the snapshot.dat> my_backup_location/+</WRAP>
  
-大文字を使わずにファイル名を変更します。+Import the backup, first copy the backup to the repository:
  
-  mv my_backup_location/<name of snapshot.dat> my_backup_location/snap1+バックアップをリポジトリにインポートします。
  
-以下が重要です。+<code bash> 
 +cp <name_snapshot.dat> my_backup_location/
  
-  curl -X POST "localhost:9200/_snapshot/my_backup/snap1/_restore?wait_for_completion=true"+</code>
  
-9) 最後に、インデックスを再度開きます。+Rename the file without capital letters:
  
-  curl -XPOST http://localhost:9200/<indexname>-*/_open+ファイル名を大文字なしに変更します。 
 + 
 +<code bash> 
 +mv my_backup_location/<name_snapshot.dat> my_backup_location/snap1 
 + 
 +</code> 
 + 
 +Finally, it is imported: 
 + 
 +インポートされます。 
 + 
 +<code bash> 
 +curl -X POST "localhost:9200/_snapshot/my_backup/snap1/_restore?wait_for_completion=true" 
 + 
 +</code> 
 + 
 +Finally, reopen the indexes: 
 + 
 +最後に、インデックスを再度開きます。 
 + 
 +<code bash> 
 +curl -XPOST http://localhost:9200/< indexes_names >-*/_open 
 + 
 +</code>
  
 [[ja:documentation:start|Pandora FMS ドキュメント一覧に戻る]] [[ja:documentation:start|Pandora FMS ドキュメント一覧に戻る]]
 +
  • ja/documentation/pandorafms/technical_annexes/16_elastic_search_backup.1724315253.txt.gz
  • 最終更新: 2024/08/22 08:27
  • by junichi