zoukankan      html  css  js  c++  java
  • 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'
    
  • 相关阅读:
    【BZOJ1029】[JSOI2007] 建筑抢修(堆优化贪心)
    【CF799B】T-shirt buying(一道很水的小根堆)
    【BZOJ1076】[SCOI2008] 奖励关(状压DP)
    【BZOJ1087】[SCOI2005] 互不侵犯King(状压DP)
    【BZOJ3209】花神的数论题(数位DP)
    【BZOJ1833】[ZJOI2010] count 数字计数(数位DP)
    【洛谷】CYJian的水题大赛 解题报告
    【洛谷3959】宝藏(随机算法乱搞)
    【洛谷2709】小B的询问(莫队模板题)
    【洛谷2403】[SDOI2010] 所驼门王的宝藏(Tarjan+dfs遍历)
  • 原文地址:https://www.cnblogs.com/xzlive/p/9714624.html
Copyright © 2011-2022 走看看