version: '3'
services:
elasticsearch6_n0:
image: elasticsearch:6.8.10
container_name: elasticsearch6_n0
privileged: true
environment:
- cluster.name=elasticsearch6-cluster
- node.name=node0
- node.master=true
- node.data=true
- bootstrap.memory_lock=true
- http.cors.enabled=true
- http.cors.allow-origin=*
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
- "discovery.zen.ping.unicast.hosts=elasticsearch6_n0,elasticsearch6_n1,elasticsearch6_n2"
- "discovery.zen.minimum_master_nodes=2"
ulimits:
memlock:
soft: -1
hard: -1
volumes:
- ./data/node0:/usr/share/elasticsearch/data
- ./logs/node0:/usr/share/elasticsearch/logs
ports:
- 9200:9200
networks:
- esnet
elasticsearch6_n1:
image: elasticsearch:6.8.10
container_name: elasticsearch6_n1
privileged: true
environment:
- cluster.name=elasticsearch6-cluster
- node.name=node1
- node.master=true
- node.data=true
- bootstrap.memory_lock=true
- http.cors.enabled=true
- http.cors.allow-origin=*
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
- "discovery.zen.ping.unicast.hosts=elasticsearch6_n0,elasticsearch6_n1,elasticsearch6_n2"
- "discovery.zen.minimum_master_nodes=2"
ulimits:
memlock:
soft: -1
hard: -1
volumes:
- ./data/node1:/usr/share/elasticsearch/data
- ./logs/node1:/usr/share/elasticsearch/logs
ports:
- 9201:9200
networks:
- esnet
elasticsearch6_n2:
image: elasticsearch:6.8.10
container_name: elasticsearch6_n2
privileged: true
environment:
- cluster.name=elasticsearch6-cluster
- node.name=node1
- node.master=true
- node.data=true
- bootstrap.memory_lock=true
- http.cors.enabled=true
- http.cors.allow-origin=*
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
- "discovery.zen.ping.unicast.hosts=elasticsearch6_n0,elasticsearch6_n1,elasticsearch6_n2"
- "discovery.zen.minimum_master_nodes=2"
ulimits:
memlock:
soft: -1
hard: -1
volumes:
- ./data/node2:/usr/share/elasticsearch/data
- ./logs/node2:/usr/share/elasticsearch/logs
ports:
- 9202:9200
networks:
- esnet
kibana:
image: kibana:6.8.10
container_name: kibana6
environment:
- ELASTICSEARCH_HOSTS=http://elasticsearch6_n0:9200
ports:
- 5602:5601
networks:
- esnet
networks:
esnet:
driver: bridge
踩坑1:
更改权限:
踩坑2: