es 备份和恢复

es backup and restore

  1. shared file system repository
    path.repo: ["/mount/backups", "/mount/longterm_backups"]

  2. You must register a snapshot repository before you can perform snapshot and restore operations.

PUT /_snapshot/my_backup
{
"type": "fs",
"settings": {
"location": "my_backup_location"
}
}

2.1 To retrieve information about a registered repository, use a GET request:

GET /_snapshot/my_backup
siuvo_daily_backup
which returns:
{
"my_backup": {
"type": "fs",
"settings": {
"location": "my_backup_location"
}
}
}

2.2 To retrieve information about multiple repositories, specify a comma-delimited list of repositories.

GET /_snapshot/repo,backup*

GET /_snapshot
GET /_snapshot/_all

2.3 After all nodes are restarted, the following command can be
used to register the shared file system repository with the name my_fs_backup:

PUT /_snapshot/my_fs_backup
{
"type": "fs",
"settings": {
"location": "/mount/backups/my_fs_backup_location",
"compress": true
}
}

2.4 Repository Verificationedit

The verification process can also be executed manually by running the following command:
POST /_snapshot/my_unverified_backup/_verify

  1. snapshot
    PUT /_snapshot/my_backup/snapshot_1?wait_for_completion=true

3.1 By default a snapshot of all open and started indices in the cluster is created.

PUT /_snapshot/my_backup/snapshot_2?wait_for_completion=true
{
"indices": "index_1,index_2",
"ignore_unavailable": true,
"include_global_state": false
}

curl -X PUT "localhost:9200/_snapshot/my_backup/snapshot_2?wait_for_completion=true" -H 'Content-Type: application/json' -d'
{
"indices": "smhc.ops4,smhc.ops5",
"ignore_unavailable": true,
"include_global_state": false
}
'

PUT /_snapshot/my_backup/<snapshot-{now/d}>

curl -X PUT "localhost:9200/_snapshot/my_backup/%3Csnapshot-%7Bnow%2Fd%7D%3E"

3.2 snapshot can be obtained using the following command

curl -X GET "localhost:9200/_snapshot/my_backup/snapshot_1"
curl -X GET "localhost:9200/snapshot/my_backup/snapshot*,some_other_snapshot"
curl -X GET "localhost:9200/_snapshot/my_backup/_all"

A currently running snapshot can be retrieved using the following command:
curl -X GET "localhost:9200/_snapshot/my_backup/_current"

3.3 A snapshot can be deleted from the repository using the following command:

curl -X DELETE "localhost:9200/_snapshot/my_backup/snapshot_2"

A repository can be unregistered using the following command:
curl -X DELETE "localhost:9200/_snapshot/my_backup"

3.4 snapshots with their detailed status information

curl -X GET "localhost:9200/_snapshot/_status"
curl -X GET "localhost:9200/_snapshot/my_backup/_status"
curl -X GET "localhost:9200/_snapshot/my_backup/snapshot_1/_status"

Multiple ids are also supported:
curl -X GET "localhost:9200/_snapshot/my_backup/snapshot_1,snapshot_2/_status"
curl -X GET "localhost:9200/_snapshot/my_backup/snapshot_1"
curl -X GET "localhost:9200/_snapshot/my_backup/snapshot_1/_status"

curl -X PUT 'localhost:9200/_snapshot/siuvo_daily_backup/%3Csnapshot-%7Bnow%2Fd%7D%3E'

PUT /_snapshot/my_backup/<snapshot-{now/d}>

curl -X PUT 'localhost:9200/_snapshot/siuvo_daily_backup/%3Csnapshot-%7Bnow%2Fd%7D%3E'
curl -X PUT 'localhost:9200/_snapshot/siuvo_daily_backup/%253Csnapshot-%257Bnow%252Fd%257D%253E'

curl -X PUT 'localhost:9200/_snapshot/siuvo_daily_backup/<snapshot-{now/d}>'

curl -X PUT 'localhost:9200/_snapshot/siuvo_daily_backup/snapshot-now/d'

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi阅读 8,190评论 0赞 10
  • 这是一篇自由书写。手里拿着笔,把笔尖放在本子上纸上快速地不假思索地写。如果不知道写什么,就在笔尖下写出“我不知道接...
    春语润心阅读 674评论 0赞 0
  • 钟汉良日记248 2018.12.15 龙岩 阴天 休息了一天,数据惨不忍睹! 今天是最近半个月来,数据最不好看的...
    钟汉良日记阅读 195评论 0赞 1
  • 敬爱的李老师,智慧的马教授,亲爱的家人们,大家好,我是侯宇辰 今天是我日精进分享的第66天,每天进步一点点,距离成...
    所以努力阅读 466评论 0赞 1
  • 夜静如水, 是谁拨动了琴弦, 激起了圆圈。 心素如简, 是谁无意的出现, 搅乱了尘缘。 落日双人情, 祥云情意暖,...
    你好青儿阅读 436评论 2赞 7

友情链接更多精彩内容