ELK-B 5.x升级6.x

来源:互联网 发布:淘宝联盟机器人免费版 编辑:程序博客网 时间:2024/06/06 03:04

ELK-B 升级

Author : Janloong Do_O

5.x 升级6.x 官方文档

备份恢复数据

详细请阅读参考文档 , 本人只在这里做了一些基本的使用,针对的是单机环境

备份数据需要cluster有一个共享的文件系统,在这里需要配置一个repo.path

elasticsearch.ymlpath.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_1GET /_snapshot/my_backup/_all

查看备份操作执行状态

GET /_snapshot/my_fs_backup/snapshot_1/_status

重新读取数据

POST /_snapshot/my_backup/snapshot_1/_restorePOST /_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版本包 并更新配置文件