报错:
Error response from daemon: OCI runtime create failed: container_linux.go:380: starting container process caused: process_linux.go:545: container init caused: rootfs_linux.go:76: mounting “/mydata/elasticsearch/config/elasticsearch.yml” to rootfs at “/usr/share/elasticsearch/config/elasticsearch.yml” caused: mount through procfd: not a directory: unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type.
这个问题,真是的傻逼了。
百度的时候,只复制了第一句话就上了,结果说是yum update;docker重启,centos版本和es的版本不匹配,各种就上了。删除了镜像重新下载也不能运行。直到我看到了后面几句话,挂在的文件不对呀。elasticsearch.yml应该是配置文件,结果挂载的时候是路径。
docker容器的启动命令:
docker run --name elasticsearch -p 9200:9200 -p 9300:9300 \
-e "discovery.type=single-node" \
-e ES_JAVA_OPTS="-Xms64m -Xmx128m" \
-v /mydata/elasticsearch/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml \
-v /mydata/elasticsearch/data:/usr/share/elasticsearch/data \
-v /mydata/elasticsearch/plugins:/usr/share/elasticsearch/plugins \
-d elasticsearch:7.4.2
解决:
最终的结果是这样的,只需要这样操作即可。
echo "http.host: 0.0.0.0" >> /mydata/elasticsearch/config/elasticsearch.yml
报错
["org.elasticsearch.bootstrap.StartupException: ElasticsearchException[failed to bind service]; nested: AccessDeniedException[/usr/share/elasticsearch/data/nodes];"
修改目录权限即可
chmod -R 777 elasticsearch/
标签:时报,mydata,share,elasticsearch,usr,镜像,config,yml From: https://blog.51cto.com/u_15890333/5883999