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'
    

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

    集群搭建完成。

      

      

  • 相关阅读:
    Spring 原生SQL查询
    Spring 使用注解查询 JPQL 按对象查询
    JAVA 判断输入流是否为空
    Spring-AOP教程
    错误笔记5, Spring datatable Error creating bean with name 'userController'
    Spring 分页查询
    前端传数据到servlet数据乱码
    sql 分页查询
    移动APP性能测试
    【8】接口、多态
  • 原文地址:https://www.cnblogs.com/gezifeiyang/p/11009212.html
Copyright © 2011-2022 走看看