• 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'
    
  • 相关阅读:
    CSRF 攻击
    PHP中HTTP_X_FORWARDED_FOR 和 REMOTE_ADDR的使用
    PHP PDO函数库详解
    STK基础
    opnet统计结果的采集模式——capture mode
    一个博客园代码高亮的方案
    博客园TinyMCE编辑器中插入的代码块使用HTML编辑器再编辑
    local statistics和global statistics的区别
    opnet的函数中FIN、FRET和FOUT
    福昕阅读器默认打开pdf文件视图大小
  • 原文地址:https://www.cnblogs.com/xzlive/p/9714624.html
Copyright © 2020-2023  润新知