首页 > 其他分享 >elasticsearch镜像启动时报错

elasticsearch镜像启动时报错

时间:2022-11-24 15:04:25浏览次数:47  
标签:时报 mydata share elasticsearch usr 镜像 config yml


报错:

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.

elasticsearch镜像启动时报错_大数据

 这个问题,真是的傻逼了。

百度的时候,只复制了第一句话就上了,结果说是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

解决:

elasticsearch镜像启动时报错_linux_02

 最终的结果是这样的,只需要这样操作即可。

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/

elasticsearch镜像启动时报错_linux_03

 

标签:时报,mydata,share,elasticsearch,usr,镜像,config,yml
From: https://blog.51cto.com/u_15890333/5883999

相关文章