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'
    

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

    集群搭建完成。

      

      

  • 相关阅读:
    事务管理思考
    sleep、yield、wait的区别
    线程异常
    线程
    JAVA线程中断
    volatile synchronized在线程安全上的区别
    jms amqp activemq rabbitmq的区别
    servlet不是线程安全的
    雪花算法
    个人税收申报时候对于“全年一次性奖金“的处理
  • 原文地址:https://www.cnblogs.com/gezifeiyang/p/11009212.html
Copyright © 2011-2022 走看看