报错:
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容器的启动命令:
解决:
最终的结果是这样的,只需要这样操作即可。
报错
["org.elasticsearch.bootstrap.StartupException: ElasticsearchException[failed to bind service]; nested: AccessDeniedException[/usr/share/elasticsearch/data/nodes];"
修改目录权限即可
chmod -R 777 elasticsearch/