Starting Elasticsearch 8.0.1 in Docker

I am running the following docker run command

docker run --name es01 --net elastic -p 9200:9200 -v /home/cbryan/Elasticsearch.yml:/usr/share/Elasticsearch/config/Elasticsearch.yml -it docker.elastic.co/elasticsearch/elasticsearch:8.0.1

In the Elasticsearch.yml, I have specified the cluster-name and network.host IP Address (e.g 192.168.50.109). However, I get the following error:

Exception in thread "main" java.nio.file.FileSystemException: /usr/share/elasticsearch/config/elasticsearch.yml.iZQ49kUURkq03BAtb4I-bQ.tmp -> /usr/share/elasticsearch/config/elasticsearch.yml: Device or resource busy
        at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:100)
        at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)
        at java.base/sun.nio.fs.UnixCopyFile.move(UnixCopyFile.java:416)
        at java.base/sun.nio.fs.UnixFileSystemProvider.move(UnixFileSystemProvider.java:266)
        at java.base/java.nio.file.Files.move(Files.java:1432)
        at org.elasticsearch.xpack.security.cli.AutoConfigureNode.fullyWriteFile(AutoConfigureNode.java:1136)
        at org.elasticsearch.xpack.security.cli.AutoConfigureNode.fullyWriteFile(AutoConfigureNode.java:1148)
        at org.elasticsearch.xpack.security.cli.AutoConfigureNode.execute(AutoConfigureNode.java:687)
        at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:77)
        at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:112)
        at org.elasticsearch.cli.Command.main(Command.java:77)
        at org.elasticsearch.xpack.security.cli.AutoConfigureNode.main(AutoConfigureNode.java:157)

I am assuming that when I set the network.hosts, the generated http_ca.crt will get generated with those values.

I am not sure why I am getting the error above?

Thank you

Chuck

1 Like

Thanks for bringing this up. We were able to reproduce this and looking into it. You can track progress in Elasticsearch fails to start in Docker, when `elasticsearch.yml` is bind mount · Issue #85463 · elastic/elasticsearch · GitHub

1 Like

In the meantime, you can pass both network.host and cluster.name as parameters in your docker run command ( -e "network.host=something" -e "cluster.name=somethingelse" ) so that you don't need to bind mount an Elasticsearch.yml` file

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.