zoukankan      html  css  js  c++  java
  • es集群

    参考:
    https://www.cnblogs.com/michael-xiang/p/13715692.html(详尽的es7.x集群搭建教程)

    https://blog.csdn.net/asty9000/article/details/97028658(es7升级后的配置属性变化)

    https://segmentfault.com/a/1190000022740186(其他配置属性)

    创建集群

    实验机器有限,我们在同一台机器上创建三个 ES 实例来创建集群,分别明确指定了这些实例的 http.port 和 transport.portdiscovery.seed_hosts明确指定实例的端口对测试集群的高可用性很关键。

    如果后期有新节点加入,新节点的 discovery.seed_hosts 没必要包含所有的节点,只要它里面包含集群中已有的节点信息,新节点就能发现整个集群了。

    集群配置预览

    分别进入es-7.3.0-node-1es-7.3.0-node-2 和 es-7.3.0-node-3 的文件夹,config/elasticsearch.yml 设置如下:

    # es-7.3.0-node-1
    cluster.name: search-7.3.2
    node.name: node-1
    node.master: true
    node.data: false
    node.ingest: false
    network.host: 0.0.0.0
    http.port: 9200
    transport.port: 9300
    discovery.seed_hosts: ["127.0.0.1:9300","127.0.0.1:9301","127.0.0.1:9302"]
    cluster.initial_master_nodes: ["node-1"]
    
    # es-7.3.0-node-2
    cluster.name: search-7.3.2
    node.name: node-2
    node.master: true
    node.data: true
    node.ingest: false
    network.host: 0.0.0.0
    http.port: 9201
    transport.port: 9301
    discovery.seed_hosts: ["127.0.0.1:9300","127.0.0.1:9301","127.0.0.1:9302"]
    
    # es-7.3.0-node-3
    cluster.name: search-7.3.2
    node.name: node-3
    node.master: true
    node.data: true
    node.ingest: false
    network.host: 0.0.0.0
    http.port: 9202
    transport.port: 9302
    discovery.seed_hosts: ["127.0.0.1:9300","127.0.0.1:9301","127.0.0.1:9302"]
    node-1 节点仅仅是一个 master 节点,它不是一个数据节点。

    经过上面的配置,可以通过命令 egrep -v "^#|^$" config/elasticsearch.yml 检查配置项。

    先启动 node-1 节点,因为它设置了初始主节点的列表。这时候就可以使用 http://<host IP>:9200/ 看到结果了。然后逐一启动 node-2 和 node-3。通过访问 http://127.0.0.1:9200/_cat/nodes 查看集群是否 OK:

    192.168.3.112 25 87 13 4.29   dm - node-3
    192.168.3.112 26 87 16 4.29   dm - node-2
    192.168.3.112 35 87 16 4.29   m  * node-1
  • 相关阅读:
    python 购物车和三级菜单
    python-装饰器
    day3 python 函数
    day3 python 集合 文件
    two day python基础知识
    python-day 1
    Cordova 环境搭建
    javascript在html直接传值
    JavaScript疑难点
    Javascript创建对象的方法
  • 原文地址:https://www.cnblogs.com/tkzc2013/p/15030764.html
Copyright © 2011-2022 走看看