1)禁止分片自动分布
curl -H "Content-Type: application/json" -XPUT '192.168.68.128:9202/_cluster/settings' -d '{"transient":{able": "none"}}'
2)执行同步刷新
curl -H "Content-Type: application/json" -XPOST '192.168.68.128:9202/_flush/synced'
3)查看进程
ps -ef | grep elastic
4)停止es的进程
Kill -9 4844
1)分别修改三个ES的l
l
po: [“/opt/es-cluster/bh_backup”]
2)创建 bh_backup目录
cd /opt/es-clustermkdir -r bh_backup/groupmkdir -r bh_backup/controller
3)给目录赋权
chown elasticsearch:elasticsearch bh_backup
1)重启集群
cd /opt/es-cluster/es1/bin
./elasticsearch -d
cd /opt/es-cluster/es2/bin
./elasticsearch -d
cd /opt/es-cluster/es3/bin
./elasticsearch -d
2)查看集群状态和分片情况
curl -H "Content-Type: application/json" -X GET "192.168.68.128:9202/_cat/health?pretty"
curl -H "Content-Type: application/json" -X GET "192.168.68.128:9202/_cat/recovery?pretty"
3)启用分片自动分片
curl -H "Content-Type: application/json" -XPUT '192.168.68.128:9202/_cluster/settings' -d '{"transient":{able": "all"}}'
1)创建集团的快照仓库
curl -H "Content-Type: application/json" -XPUT '192.168.68.128:9202/_snapshot/group' -d '{"type": "fs","settings": {"location": "/opt/es-cluster/bh_backup/group","compress": true}
}'
2)创建实际控制人的快照仓库
curl -H "Content-Type: application/json" -XPUT '192.168.68.128:9202/_snapshot/controller' -d '{"type": "fs","settings": {"location": "/opt/es-cluster/bh_backup/controller","compress": true}
}'
1)解压快照文件
up_v2.zip
ller.zip
cp -r ./back_new/* /opt/es-cluster/bh_backup/group
cp -r ./kg.controller/* /opt/es-cluster/bh_backup/controller
2)赋权给快照路径
chown -R elasticsearch:elasticsearch /opt/es-cluster/bh_backup/group
chown -R elasticsearch:elasticsearch /opt/es-cluster/bh_backup/controller
1)查询group仓库下的快照信息
curl -XGET "192.168.68.128:9202/_snapshot/group/_all?pretty"
2)恢复快照数据
curl -H "Content-Type: application/json" -XPOST '192.168.68.128:9202/_snapshot/group/es_snapshot/_restore' -d '{"indices": up_v2_20201029","index_settings": {"index.number_of_replicas": 1},"ignore_index_settings": [fresh_interval"]
}'
本文发布于:2024-01-29 10:43:33,感谢您对本站的认可!
本文链接:https://www.4u4v.net/it/170649621514712.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
留言与评论(共有 0 条评论) |