ELK-B 升級
Author : Janloong Do_O
5.x 升級6.x 官方文檔
備份恢復數據
詳細請閱讀參考文檔 , 本人只在這裏做了一些基本的使用,針對的是單機環境
備份數據需要cluster有一個共享的文件系統,在這裏需要配置一個repo.path
elasticsearch.yml
path.repo: ["/opt/es_backup", "/mount/longterm_backups"]
創建倉庫名
PUT /_snapshot/my_fs_backup
{
"type": "fs",
"settings": {
"location": "/opt/es_backup/Backup20171221.bk",
"compress": true
}
}
向倉庫備份index
全部備份
PUT /_snapshot/my_fs_backup/snapshot_1?wait_for_completion=true
指明index備份
PUT /_snapshot/my_fs_backup/snapshot_1?wait_for_completion=true
{
"indices": "index_1,index_2",
"ignore_unavailable": true,
"include_global_state": false
}
用來查看備份的信息
GET /_snapshot/my_backup/snapshot_1
GET /_snapshot/my_backup/_all
查看備份操作執行狀態
GET /_snapshot/my_fs_backup/snapshot_1/_status
重新讀取數據
POST /_snapshot/my_backup/snapshot_1/_restore
POST /_snapshot/my_backup/snapshot_1/_restore
{
"indices": "index_1,index_2",
"ignore_unavailable": true,
"include_global_state": true,
"rename_pattern": "index_(.+)",
"rename_replacement": "restored_index_$1"
}
禁用碎片分配
PUT _cluster/settings
{
"persistent": {
"cluster.routing.allocation.enable": "none"
}
}
停止非必要的索引並執行同步刷新(可選)
POST _flush/synced
關閉節點
kill 1231
下載6.1版本包 並更新配置文件