I am unable to start Elasticsearch when path.data was set to a location on Ramdisk (Imdisk). It throws the following error:
elasticsearch-7.6.0-windows-x86_64\elasticsearch-7.6.0\bin>.\elasticsearch.bat
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
[2020-03-04T15:55:49,124][ERROR][o.e.b.ElasticsearchUncaughtExceptionHandler] [ALH-MAW7-DT] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: java.lang.IllegalStateException: failed to obtain node locks, tried [[R:\elasticsearch7.6-data]] with lock id [0]; maybe these locations are not writable or multiple nodes were started without increasing [node.max_local_storage_nodes] (was [1])?
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:174) ~[elasticsearch-7.6.0.jar:7.6.0]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:161) ~[elasticsearch-7.6.0.jar:7.6.0]
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) ~[elasticsearch-7.6.0.jar:7.6.0]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:125) ~[elasticsearch-cli-7.6.0.jar:7.6.0]
at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-cli-7.6.0.jar:7.6.0]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:126) ~[elasticsearch-7.6.0.jar:7.6.0]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92) ~[elasticsearch-7.6.0.jar:7.6.0]
Caused by: java.lang.IllegalStateException: failed to obtain node locks, tried [[R:\elasticsearch7.6-data]] with lock id [0]; maybe these locations are not writable or multiple nodes were started without increasing [node.max_local_storage_nodes] (was [1])?
at org.elasticsearch.env.NodeEnvironment.<init>(NodeEnvironment.java:301) ~[elasticsearch-7.6.0.jar:7.6.0]
at org.elasticsearch.node.Node.<init>(Node.java:277) ~[elasticsearch-7.6.0.jar:7.6.0]
at org.elasticsearch.node.Node.<init>(Node.java:257) ~[elasticsearch-7.6.0.jar:7.6.0]
at org.elasticsearch.bootstrap.Bootstrap$5.<init>(Bootstrap.java:221) ~[elasticsearch-7.6.0.jar:7.6.0]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:221) ~[elasticsearch-7.6.0.jar:7.6.0]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:349) ~[elasticsearch-7.6.0.jar:7.6.0]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:170) ~[elasticsearch-7.6.0.jar:7.6.0]
... 6 more
Caused by: java.io.IOException: failed to obtain lock on R:\elasticsearch7.6-data\nodes\0
at org.elasticsearch.env.NodeEnvironment$NodeLock.<init>(NodeEnvironment.java:223) ~[elasticsearch-7.6.0.jar:7.6.0]
at org.elasticsearch.env.NodeEnvironment.<init>(NodeEnvironment.java:271) ~[elasticsearch-7.6.0.jar:7.6.0]
at org.elasticsearch.node.Node.<init>(Node.java:277) ~[elasticsearch-7.6.0.jar:7.6.0]
at org.elasticsearch.node.Node.<init>(Node.java:257) ~[elasticsearch-7.6.0.jar:7.6.0]
at org.elasticsearch.bootstrap.Bootstrap$5.<init>(Bootstrap.java:221) ~[elasticsearch-7.6.0.jar:7.6.0]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:221) ~[elasticsearch-7.6.0.jar:7.6.0]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:349) ~[elasticsearch-7.6.0.jar:7.6.0]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:170) ~[elasticsearch-7.6.0.jar:7.6.0]
... 6 more
Caused by: java.nio.file.FileSystemException: R:\elasticsearch7.6-data\nodes\0: Incorrect function.
at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:92) ~[?:?]
at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103) ~[?:?]
at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:108) ~[?:?]
at sun.nio.fs.WindowsLinkSupport.getFinalPath(WindowsLinkSupport.java:82) ~[?:?]
at sun.nio.fs.WindowsFileStore.create(WindowsFileStore.java:87) ~[?:?]
at sun.nio.fs.WindowsFileSystemProvider.getFileStore(WindowsFileSystemProvider.java:484) ~[?:?]
at java.nio.file.Files.getFileStore(Files.java:1491) ~[?:?]
at org.elasticsearch.env.Environment.getFileStore(Environment.java:327) ~[elasticsearch-7.6.0.jar:7.6.0]
at org.elasticsearch.env.NodeEnvironment$NodePath.<init>(NodeEnvironment.java:112) ~[elasticsearch-7.6.0.jar:7.6.0]
at org.elasticsearch.env.NodeEnvironment$NodeLock.<init>(NodeEnvironment.java:217) ~[elasticsearch-7.6.0.jar:7.6.0]
at org.elasticsearch.env.NodeEnvironment.<init>(NodeEnvironment.java:271) ~[elasticsearch-7.6.0.jar:7.6.0]
at org.elasticsearch.node.Node.<init>(Node.java:277) ~[elasticsearch-7.6.0.jar:7.6.0]
at org.elasticsearch.node.Node.<init>(Node.java:257) ~[elasticsearch-7.6.0.jar:7.6.0]
at org.elasticsearch.bootstrap.Bootstrap$5.<init>(Bootstrap.java:221) ~[elasticsearch-7.6.0.jar:7.6.0]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:221) ~[elasticsearch-7.6.0.jar:7.6.0]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:349) ~[elasticsearch-7.6.0.jar:7.6.0]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:170) ~[elasticsearch-7.6.0.jar:7.6.0]
... 6 more
uncaught exception in thread [main]
java.lang.IllegalStateException: failed to obtain node locks, tried [[R:\elasticsearch7.6-data]] with lock id [0]; maybe these locations are not writable or multiple nodes were started without increasing [node.max_local_storage_nodes] (was [1])?
Likely root cause: java.nio.file.FileSystemException: R:\elasticsearch7.6-data\nodes\0: Incorrect function.
at java.base/sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:92)
at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103)
at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:108)
at java.base/sun.nio.fs.WindowsLinkSupport.getFinalPath(WindowsLinkSupport.java:82)
at java.base/sun.nio.fs.WindowsFileStore.create(WindowsFileStore.java:87)
at java.base/sun.nio.fs.WindowsFileSystemProvider.getFileStore(WindowsFileSystemProvider.java:484)
at java.base/java.nio.file.Files.getFileStore(Files.java:1491)
at org.elasticsearch.env.Environment.getFileStore(Environment.java:327)
at org.elasticsearch.env.NodeEnvironment$NodePath.<init>(NodeEnvironment.java:112)
at org.elasticsearch.env.NodeEnvironment$NodeLock.<init>(NodeEnvironment.java:217)
at org.elasticsearch.env.NodeEnvironment.<init>(NodeEnvironment.java:271)
at org.elasticsearch.node.Node.<init>(Node.java:277)
at org.elasticsearch.node.Node.<init>(Node.java:257)
at org.elasticsearch.bootstrap.Bootstrap$5.<init>(Bootstrap.java:221)
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:221)
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:349)
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:170)
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:161)
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86)
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:125)
at org.elasticsearch.cli.Command.main(Command.java:90)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:126)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92)
Are there any workarounds for this issue? I never had this issue on elasticsearch-5.5.0.