• ElasticSearch集群配置


    因机器有限,本文只做单机3个节点的集群测试。

    1、集群测试信息

      elasticsearch版本:elasticsearch-2.4.1

      windowns版本:win10

    2、解压elasticsearch-2.4.1.zip到任意目录下,安装elasticsearch-head插件。

      在${ESHOME}in目录下执行命令:plugin install mobz/elasticsearch-head

    3、单节点启动后可查看到以下信息(在添加数据后的效果)

    4、将elasticsearch复制3份,分别命名为elasticsearch-2.4.1-1、elasticsearch-2.4.1-2、elasticsearch-2.4.1-3

    5、修改各个节点的配置信息

      1)修改elasticsearch-2.4.1-1configelasticsearch.yml,添加以下信息:

    cluster.name: elasticsearch
    
    node.name: node-1
    node.master: true
    node.data: true
    
    network.host: 127.0.0.1
    http.port: 9201
    transport.tcp.port: 9301
    
    discovery.zen.ping.multicast.enabled: false
    discovery.zen.ping.unicast.hosts: ["127.0.0.1:9301",  "127.0.0.1:9302", "127.0.0.1:9303"]

      2)修改elasticsearch-2.4.1-2configelasticsearch.yml,添加以下信息:cluster.name: elasticsearch

    cluster.name: elasticsearch
    
    node.name: node-2
    node.master: true
    node.data: true
    
    network.host: 127.0.0.1
    http.port: 9202
    transport.tcp.port: 9302
    
    discovery.zen.ping.multicast.enabled: false
    discovery.zen.ping.unicast.hosts: ["127.0.0.1:9301",  "127.0.0.1:9302", "127.0.0.1:9303"]

      3)修改elasticsearch-2.4.1-3configelasticsearch.yml,添加以下信息:

    cluster.name: elasticsearch

    node.name: node-3 node.master: true node.data: true network.host: 127.0.0.1 http.port: 9203 transport.tcp.port: 9303 discovery.zen.ping.multicast.enabled: false discovery.zen.ping.unicast.hosts: ["127.0.0.1:9301", "127.0.0.1:9302", "127.0.0.1:9303"]

    6、登录任意一个节点,都可以看到如下信息:

      3个索引的数据被分布到3个节点下,每个分片有2个备份,node-2为master服务。

    7、关闭节点node-3,登录前2个节点可看到如下信息(需等待一段时间):

      分片被转移到node-1和node-2节点上。

    8、重新打开node-3节点,数据又被均分到3个节点上。

  • 相关阅读:
    单点登录cas常见问题(八)
    11G新特性 -- variable size extents
    11G新特性 -- ASM Fast Mirror Resync
    redhat 6.4 安装VirtualBox自动增强功能功:unable to find the sources of your current Linux kernel
    LINUX使用DVD光盘或者ISO作为本地YUM源
    数据库报ORA-00600: 内部错误代码, 参数: [17059],并产生大量trace日志文件
    Putty设置删除
    ssh/scp 远程连接ssh非默认端口方法
    查看LINUX版本
    RHCE7 -- systemctl命令
  • 原文地址:https://www.cnblogs.com/zhi-leaf/p/6180289.html
Copyright © 2020-2023  润新知