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'
    
  • 相关阅读:
    委托和异步方法
    线程池_ThreadPool
    委托_deleget
    一步一步实现视频播放器client(二)
    mysql忘记password
    POJ 2456 Aggressive cows (二分 基础)
    Fragment小结
    Cocos2d-x粒子系统
    淘宝数据库OceanBase SQL编译器部分 源代码阅读--解析SQL语法树
    C与C++在形參的一点小差别
  • 原文地址:https://www.cnblogs.com/xzlive/p/9714624.html
Copyright © 2011-2022 走看看