这里es 没办法修改,需要docker run 单机模式启动测试没问题,修改好参数,在用docker stack 启动
version: '3.6'
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:6.2.4
environment:
- cluster.name=docker-cluster
- bootstrap.memory_lock=false
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
volumes:
- /home/elasticsearch/data:/usr/share/elasticsearch/data
#- /home/elasticsearch/etc/sysctl.conf:/etc/sysctl.conf:rw
ports:
- 9200:9200
networks:
- esnet
deploy:
placement:
constraints:
- node.role == manager
elasticsearch2:
image: docker.elastic.co/elasticsearch/elasticsearch:6.2.4
environment:
- cluster.name=docker-cluster
- bootstrap.memory_lock=false
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
- "discovery.zen.ping.unicast.hosts=elasticsearch"
volumes:
- /home/elasticsearch/data:/usr/share/elasticsearch/data
# - /home/elasticsearch/etc/sysctl.conf:/etc/sysctl.conf:rw
networks:
- esnet
deploy:
placement:
constraints:
- node.role == worker
logstash:
image: docker.elastic.co/logstash/logstash:6.2.4
environment:
- "LS_JAVA_OPTS=-Xms256m -Xmx256m"
networks:
- esnet
deploy:
replicas: 2
placement:
constraints:
- node.role == worker
logstash2:
image: docker.elastic.co/logstash/logstash:6.2.4
environment:
- "LS_JAVA_OPTS=-Xms256m -Xmx256m"
networks:
- esnet
deploy:
replicas: 2
placement:
constraints:
- node.role == manager
kibana:
image: docker.elastic.co/kibana/kibana:6.2.4
ports:
- "5601:5601"
networks:
- esnet
deploy:
placement:
constraints:
- node.role == worker
networks:
esnet:
driver: "overlay"
点波关注 系统搭建(docker)
网友评论