Start elasticsearch according to the configuration file and report error creating overlay mount to...init/merged: no such file or directory

The thing is like this, I used the elascticsearch.yml configuration file + elasticsearch:7.5.0 mirror to start the elasticsearch service, my elasticsearch.yml configuration file is shown below:
Insert picture description here
I also downloaded and installed elasticsearch:7.5. 0 mirror resources, and then I plan to start the elastcisearch container and then start the es service through the following command,

docker run -e ES_JAVA_OPTS="-Xms512m -Xmx512m" -d \
-p 9200:9200 -p 9300:9300 \
-v /data/es/config/es.yml:/data/share/elasticsearch/config/elasticsearch.yml \
-v /data/es/data:/data/share/elasticsearch/data \
--name ES \
elasticsearch:7.5.0

At this time the error occurred, and the
Insert picture description here
error was reported: The specific error message is: docker: Error response from daemon: error creating overlay mount to /data/docker/overlay2/4990314e174cb3d6cd0d51af63da5bacab46c8f77c7dcc23ee782bf323c6ae4f-init/merged: no such file or directory.
Reason: possible It was because the previous installation of elasticsearch failed, and then when I uninstalled es, I used find / -name elasticsearch.yml to find the container files under /data/docker/overlay2/, and then deleted the container files related to es. However, this may contain es related configuration files (some es container files should be downloaded together or loaded as docker container files when downloading the elasticsearch:7.5.0 image). Some container files related to es cannot be deleted (because some container files may contain configuration files related to es mirroring), in addition, it is not necessary to delete these container files related to es, because the es container is used docker stop ESand docker rmi ES -fdeleted At that time, many container files related to es are automatically deleted, so there is no need to manually delete container files related to es.
Solution: 1. Uninstall the es image (elasticsearch:7.5.0) in the local docker warehouse and re-download the elasticsearch:7.5.0 image. In this way, some missing es container files will be automatically loaded in. (This method was effective before, and I myself was successful, but I don’t know why it didn’t work afterwards)
2. Uninstall the es mirror (elasticsearch:7.5.0) in the local docker warehouse and download againelasticsearch:7.6.0Mirror, that is, a mirror version is replaced. At this time, the command to start the es service should be slightly modified:

docker run -e ES_JAVA_OPTS="-Xms512m -Xmx512m" -d \
-p 9200:9200 -p 9300:9300 \
-v /data/es/config/es.yml:/data/share/elasticsearch/config/elasticsearch.yml \
-v /data/es/data:/data/share/elasticsearch/data \
--name ES \
elasticsearch:7.6.0

Through these two solutions, this problem should be able to be resolved.


Note: Do not use the docker pull elasticsearch:7.5.0command to pull the mirror, because sometimes the download speed of this mirror is too slow, I recommend you to download and pull the es mirror from the domestic mirror source, the command is docker pull docker.elastic.co/elasticsearch/elasticsearch:7.5.0.

Guess you like

Origin blog.csdn.net/weixin_666888/article/details/108693688