docker 部署es 集群

docker pull elasticsearch:6.7.1


docker run -e ES_JAVA_OPTS="-Xms256m -Xmx256m" -d -p 9200:9200 -p 9300:9300 -v /es/config/es1.yml:/config/elasticsearch.yml -v /root/es/data:/elasticsearch/data --name es elasticsearch:6.7.1


cluster.name: "docker-cluster"
node.name: es-node1
network.bind_host: 0.0.0.0
network.publish_host: 172.16.200.2
http.port: 9200
transport.tcp.port: 9300
http.cors.enabled: true
http.cors.allow-origin: "*"
node.master: true 
node.data: true  
discovery.zen.ping.unicast.hosts: ["172.16.200.2:9300","172.16.200.3:9301","172.16.200.4:9302"]
discovery.zen.minimum_master_nodes: 2


 docker run -e ES_JAVA_OPTS="-Xms256m -Xmx256m" -d -p 9201:9201 -p 9301:9301 -v /es/config/es2.yml:/config/elasticsearch.yml -v /root/es/data:/elasticsearch/data --name es2 elasticsearch:6.7.1

cluster.name: "docker-cluster"
node.name: es-node2
network.bind_host: 0.0.0.0
network.publish_host: 172.16.200.3
http.port: 9201
transport.tcp.port: 9301
http.cors.enabled: true
http.cors.allow-origin: "*"
node.master: true 
node.data: true  
discovery.zen.ping.unicast.hosts: ["172.16.200.2:9300","172.16.200.3:9301","172.16.200.4:9302"]
discovery.zen.minimum_master_nodes: 2


cluster.name: "docker-cluster"
node.name: es-node3
network.bind_host: 0.0.0.0
network.publish_host: 172.16.200.4
http.port: 9202
transport.tcp.port: 9302
http.cors.enabled: true
http.cors.allow-origin: "*"
node.master: true 
node.data: true  
discovery.zen.ping.unicast.hosts: ["172.16.200.2:9300","172.16.200.3:9301","172.16.200.4:9302"]
discovery.zen.minimum_master_nodes: 2

 

 

参考:https://blog.csdn.net/belonghuang157405/article/details/83301937

你可能感兴趣的:(es,Centos7)