elasticsearch7.0 集群配置 学习二

我的环境是ubuntu16.04  内存2g

我配置了两台机器,建议不过最好是N/2+1个节点

 

这个是配置详细数据官网

https://www.elastic.co/guide/en/elasticsearch/reference/current/install-elasticsearch.html

 

这个是java客户端的详细官网

https://www.elastic.co/guide/en/elasticsearch/reference/current/integration-tests.html

 

我的两台机器配置方式

这个是  192.168.1.116:9300    从节点


 cluster.name: elasticsearchkplbug
 node.name: node-2
 network.host: 0.0.0.0
 http.port: 9200
 node.master: false
# node.data: true
 discovery.seed_hosts:
    -  192.168.1.117:9300
    -  192.168.1.116:9300

 cluster.initial_master_nodes:
    - 192.168.1.116:9300


这个是  192.168.1.117:9300   主节点



 cluster.name: elasticsearchkplbug
 node.name: node-2
 network.host: 0.0.0.0
 http.port: 9200
# node.master: true
# node.data: true
 discovery.seed_hosts:
    -  192.168.1.117:9300
    -  192.168.1.116:9300

 cluster.initial_master_nodes:
    - 192.168.1.116:9300

 

 

java的maven配置

 

      

  
        
            org.elasticsearch
            elasticsearch
             6.7.0
        

       
        
            org.elasticsearch.client
            transport
             6.7.0
        

        
            junit
            junit
            4.12
            test
        

     
      

        
            org.projectlombok
            lombok
            1.16.18
        

       
        
            com.alibaba
            fastjson
            1.2.54
        

     
        
            org.elasticsearch.plugin
            transport-netty4-client
           6.7.0
        


    

如果单机不会配置的,可以参考我这篇文章

elasticsearch7.0 单机搭建遇到的问题

 

你可能感兴趣的:(java)