【漏洞修复】ES漏洞-ES集群小版本升级及对应kibana升级方案

一、快速下载对应版本


https://artifacts.elastic.co/downloads/kibana/kibana-7.17.26-linux-x86_64.tar.gz
https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.17.26-linux-x86_64.tar.gz

二、ES升级步骤


1、查看es集群节点信息


curl http://localhost:9200/_cat/nodes?pretty
curl http://localhost:9200/_cluster/health

2、禁用副本分配


curl -X PUT "localhost:9200/_cluster/settings?pretty" -H 'Content-Type: application/json' -d' { "persistent": { "cluster.routing.allocation.enable": "primaries"  }}'

3、停止不必要的建立索引操作和使用异步刷新。


curl -X POST "localhost:9200/_flush/synced?pretty"

4、es版本升级


ps -ef | grep elasticsearch
kill -9 

cp -r /app/elasticsearch-7.2.0/data /app/elasticsearch-7.17.26/
cp -r /app/elasticsearch-7.2.0/config/elasticsearch.yml /app/elasticsearch-7.17.26/config/
cp -r /app/elasticsearch-7.2.0/config/jvm.options /app/elasticsearch-7.17.26/config/
cp -r /app/elasticsearch-7.2.0/logs  /app/elasticsearch-7.17.26/
cp -r /app/elasticsearch-7.2.0-data  /app/elasticsearch-7.17.26-data
cp -r /app/elasticsearch-7.2.0-logs  /app/elasticsearch-7.17.26-logs

/app/elasticsearch-7.17.26/bin/elasticsearch -d

5、重新启用分片分配


curl -X PUT "localhost:9200/_cluster/settings?pretty" -H 'Content-Type: application/json' -d' { "persistent": {  "cluster.routing.allocation.enable": null  }}'

6、等待节点恢复


查看进度
curl -X GET "localhost:9200/_cat/health?v=true&pretty"
各个分片的恢复状态
curl -X GET "localhost:9200/_cat/recovery?pretty" 
查看版本
curl -X GET "localhost:9200/_cat/nodes?h=ip,name,version&v=true&pretty"

7、最终结果


curl http://localhost:9200/_cat/nodes?pretty

三、kibana升级步骤


1、版本升级


ps -ef | grep kibana
kill -9 

cp /app/kibana-7.17.26-linux-x86_64/cfg/kibana.yml  /app/kibana-7.17.26-linux-x86_64/cfg/kibana.yml  

mkdir /app/kibana-7.17.26-linux-x86_64/logs

nohup /app/kibana-7.17.26-linux-x86_64/bin/kibana 1> /app/kibana-7.17.26-linux-x86_64/logs/start.log 2> /app/kibana-7.17.26-linux-x86_64/logs/start.err &

2、手动分片(如果节点异常)


curl -X POST "http://localhost:9200/_cluster/reroute" -H 'Content-Type: application/json' -d '{"commands":[{"allocate_empty_primary":{"index":".kibana_task_manager_7.17.26_001","shard":0,"node":"es7_node_03","accept_data_loss":true}}]}'
【es7_node_03为分配节点名称】

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值