3

Does anyone has successfully ran Elasticsearch on Docker for Windows? Haven't found any information for this combination.

I've had insufficient memory issues with microsoft/windowsservercore image at boot time, although with microsoft/nanoserver at least it's possible to boot, not yet tested under load.

Also, there's some funky problems with using volume mounts where elaticsearch throw exception: "Unable to access 'path.data'", although the mount is perfectly writable from shell inside container:

docker volume create log

docker run --rm -it -p 15000:15000 -v log:c:/log/elasticsearch/data microsoft/windowsservercore powershell

or with host binding:

docker run --rm -it -p 15000:15000 -v C:/temp/log:c:/log/elasticsearch/data microsoft/windowsservercore powershell

And calling:

c:/log/elasticsearch/bin/elasticsearch.bat -Ecluster.name=log_cluster -Enode.name=${HOSTNAME} -Enetwork.host="0.0.0.0" -Ehttp.port=15000

I get:

[2017-04-28T15:40:25,501][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [644FE5A1B514] uncaught exception in thread [main] org.elasticsearch.bootstrap.StartupException: java.lang.IllegalStateException: Unable to access 'path.data' (C:\log\elasticsearch\data) at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:127) ~[elasticsearch-5.3.1.jar:5.3.1] at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:114) ~[elasticsearch-5.3.1.jar:5.3.1] at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:58) ~[elasticsearch-5.3.1.jar:5.3.1] at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:122) ~[elasticsearch-5.3.1.jar:5.3.1] at org.elasticsearch.cli.Command.main(Command.java:88) ~[elasticsearch-5.3.1.jar:5.3.1] at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:91) ~[elasticsearch-5.3.1.jar:5.3.1] at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:84) ~[elasticsearch-5.3.1.jar:5.3.1] Caused by: java.lang.IllegalStateException: Unable to access 'path.data' (C:\log\elasticsearch\data) at org.elasticsearch.bootstrap.Security.addPath(Security.java:397) ~[elasticsearch-5.3.1.jar:5.3.1] at org.elasticsearch.bootstrap.Security.addFilePermissions(Security.java:252) ~[elasticsearch-5.3.1.jar:5.3.1] at org.elasticsearch.bootstrap.Security.createPermissions(Security.java:208) ~[elasticsearch-5.3.1.jar:5.3.1] at org.elasticsearch.bootstrap.Security.configure(Security.java:114) ~[elasticsearch-5.3.1.jar:5.3.1] at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:237) ~[elasticsearch-5.3.1.jar:5.3.1] at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:360) ~[elasticsearch-5.3.1.jar:5.3.1] at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:123) ~[elasticsearch-5.3.1.jar:5.3.1] ... 6 more Caused by: java.nio.file.NoSuchFileException: C:\log\elasticsearch\data at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:79) ~[?:1.8.0_131] at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97) ~[?:1.8.0_131] at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102) ~[?:1.8.0_131] at sun.nio.fs.WindowsLinkSupport.getFinalPath(WindowsLinkSupport.java:82) ~[?:1.8.0_131] at sun.nio.fs.WindowsLinkSupport.getRealPath(WindowsLinkSupport.java:242) ~[?:1.8.0_131] at sun.nio.fs.WindowsPath.toRealPath(WindowsPath.java:836) ~[?:1.8.0_131] at sun.nio.fs.WindowsPath.toRealPath(WindowsPath.java:44) ~[?:1.8.0_131] at org.elasticsearch.bootstrap.Security.ensureDirectoryExists(Security.java:435) ~[elasticsearch-5.3.1.jar:5.3.1] at org.elasticsearch.bootstrap.Security.addPath(Security.java:395) ~[elasticsearch-5.3.1.jar:5.3.1] at org.elasticsearch.bootstrap.Security.addFilePermissions(Security.java:252) ~[elasticsearch-5.3.1.jar:5.3.1] at org.elasticsearch.bootstrap.Security.createPermissions(Security.java:208) ~[elasticsearch-5.3.1.jar:5.3.1] at org.elasticsearch.bootstrap.Security.configure(Security.java:114) ~[elasticsearch-5.3.1.jar:5.3.1] at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:237) ~[elasticsearch-5.3.1.jar:5.3.1] at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:360) ~[elasticsearch-5.3.1.jar:5.3.1] at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:123) ~[elasticsearch-5.3.1.jar:5.3.1] ... 6 more

Elasticsearch 5.3.1 Tried with docker version 17.03 and 17.05rc1/2

4

2 回答 2

5

我在这里找到了解决方法的解释。

我发布了一个关于我提出的问题的解决方案,该问题与这里的问题相同

此外,我在 Github 上发布了一个包含解决方法的 Dockerfile: https ://github.com/SharpSeeEr/Dockerfiles

于 2017-05-11T19:50:27.083 回答
0

您是否尝试过使用其中一种内存选项明确指定更大的内存量?

于 2017-05-09T19:35:35.143 回答