ELK 集群升级操作

1.配置项变更  
2.禁用自动分片 disabled shard allocation

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

3.将内存数据同步到磁盘

curl -XPOST 'localhost:9200/_flush/synced?pretty'

A synced flush request is a “best effort” operation. It will fail if there are any pending indexing operations, but it is safe to reissue the request multiple times if necessary.

4.关闭节点,执行升级

升级详细步骤:
tips:这里是源码包升级 也可以是硬件设备升级
(1)解压到安装目录,不要覆盖原程序目录
(2)从老程序复制config下面的文件到新程序中
Either copy the files in the directory from your old installation to your new installation, or set the environment variable to the location of the file and use the option on the command line to point to an external config directory.
(3)复制老程序/data目录下的数据到新目录到新的数据目录或者改改路径到老目录
Either copy the files in the directory from your old installation to your new installation, or configure the location of the data directory in the file, with the setting.
(4)更新所有插件
Elasticsearch plugins must be upgraded when upgrading a node. Use the script to install the correct version of any plugins that you need.

5.启用节点,开始自动分片(会先变为yellow状态,最后变绿),查看是否加入集群

Start the now upgraded node and confirm that it joins the cluster by checking the log file or by checking the output of this request:

curl -XGET 'localhost:9200/_cat/nodes?pretty'

6.重新开始分片Reenable shard allocation

Once the node has joined the cluster, reenable shard allocation to start using the node:

curl -XPUT 'localhost:9200/_cluster/settings?pretty' -H 'Content-Type: application/json' -d'
{
     "transient": {
     "cluster.routing.allocation.enable": "all"
     }
}'

7.等集群恢复 Wait for the node to recover
ou should wait for the cluster to finish shard allocation before upgrading the next node. You can check on progress with the request。
查看集群状态是否正确:

curl -XGET 'localhost:9200/_cat/health?pretty'

 

转载于:https://www.cnblogs.com/xzlive/p/9714624.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值