zoukankan      html  css  js  c++  java
  • Elasticsearch 集群配置

    分别在3台机器上安装 elasticsearch, ip 分别为 

    192.168.48.137, 192.168.48.138, 192.168.48.140

    配置 elasticsearch.yml

    192.168.48.137 机器配置

    cluster.name: my-application
    node.name: node-137
    #指定了该节点可能成为 master 节点,还可以是数据节点
    node.master: true
    node.data: true
    network.host: 0.0.0.0
    http.port: 9200
    transport.tcp.port: 9300
    discovery.zen.ping.unicast.hosts: ["192.168.48.137", "192.168.48.138", "192.168.48.140"]
     
     

    192.168.48.138 机器配置

    cluster.name: my-application
    node.name: node-138
    #指定了该节点可能成为 master 节点,还可以是数据节点
    node.master: true
    node.data: true
    network.host: 0.0.0.0
    http.port: 9200
    transport.tcp.port: 9300
    discovery.zen.ping.unicast.hosts: ["192.168.48.137", "192.168.48.138", "192.168.48.140"]
     

    192.168.48.140 机器配置

    cluster.name: my-application
    node.name: node-140
    #指定了该节点可能成为 master 节点,还可以是数据节点
    node.master: true
    node.data: true
    network.host: 0.0.0.0
    http.port: 9200
    transport.tcp.port: 9300
    discovery.zen.ping.unicast.hosts: ["192.168.48.137", "192.168.48.138", "192.168.48.140"]

    ------------------------------

     改完配置之后重启 elasticsearch

    systemctl restart elasticsearch.service
    

    在 138, 140 机器上 查看当前节点的所有Index

    curl -X GET 'http://localhost:9200/_cat/indices?v'
    

    显示如下,说明集群搭建成功,数据已同步

    集群搭建完成。

      

      

  • 相关阅读:
    【bzoj1191】 HNOI2006—超级英雄Hero
    【poj3020】 Antenna Placement
    【poj1274】 The Perfect Stall
    【poj2724】 Purifying Machine
    【poj2226】 Muddy Fields
    【codevs1257】 打砖块
    【poj2186】 Popular Cows
    【poj1236】 Network of Schools
    【poj1144】 Network
    【poj3177】 Redundant Paths
  • 原文地址:https://www.cnblogs.com/gezifeiyang/p/11009212.html
Copyright © 2011-2022 走看看