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'
    
  • 相关阅读:
    event事件对象
    移动端布局模式
    事件冒泡和事件捕获
    移动web缓存介绍 ---摘录
    this的运用
    第一次演讲准备篇--css
    jquery内部技术分析
    java 编程思想笔记(五)——接口
    java 编程思想笔记(四)——多态
    java 编程思想笔记(三)——类的复用
  • 原文地址:https://www.cnblogs.com/xzlive/p/9714624.html
Copyright © 2011-2022 走看看