docke启动elasticsearch容器挂载数据目录报 AccessDeniedException: /usr/share/elasticsearch/data/nodes错误

执行docker启动es容器命令如下:

docker run --name elasticsearch -p 9200:9200 -p 9300:9300  -e "discovery.type=single-node" -e ES_JAVA_OPTS="-Xms64m -Xmx128m" -v /data1/environment/elasticsearch/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml -v /data1/environment/elasticsearch/data:/usr/share/elasticsearch/data -v /data1/environment/elasticsearch/plugins:/usr/share/elasticsearch/plugins -d elasticsearch:7.16.2

报错内容如下:

docke启动elasticsearch容器挂载数据目录报 AccessDeniedException: /usr/share/elasticsearch/data/nodes错误_第1张图片

 原因是容器对宿主机目录data没有写入权限,执行如下命令进行授权.

chmod 777 /data1/qz-projects/environment/elasticsearch/data

你可能感兴趣的:(elasticsearch,elasticsearch,容器,docker)