docker compose 启用elasticSearch 报错:Failed to created node environment
elasticsearch1:
image: docker.elastic.co/elasticsearch/elasticsearch:6.2.3
container_name: elasticsearch1
environment:
- cluster.name=docker-cluster
- bootstrap.memory_lock=true
- xpack.security.enabled=false
- "ES_JAVA_OPTS=-Xms128m -Xmx128m"
ulimits:
memlock:
soft: -1
hard: -1
volumes:
- ./db/elasticsearch/data:/usr/share/elasticsearch/data
ports:
- 9200:9200
networks:
- code-network
这是因为elasticSearch的账户不是root,因此,需要将 ./db/elasticsearch/data
设置为可写