docker-compose 搭建elasticsearch出现问题
例子如下
version: '3' services: elasticsearch: image: elasticsearch:7.14.0 container_name: elasticsearch environment: - "discovery.type=single-node" - "xpack.security.enabled=false" - "ES_JAVA_OPTS=-Xms512m -Xmx512m" ulimits: memlock: soft: -1 hard: -1 volumes: - ./data/elasticsearch:/usr/share/elasticsearch/data ports: - 9200:9200 - 9300:9300 volumes: esdata: driver: local
"Caused by: java.nio.file.AccessDeniedException: /usr/share/elasticsearch/data/nodes
是因为目录权限不足的原因,
解决办法:
在挂载的pv目录添加权限
chmod -R 777 /data/elasticsearch
记得要加上-R
标签:java,nio,Caused,share,elasticsearch,usr,file,data,9200 From: https://blog.51cto.com/u_14045290/7705133