Elasticsearch installation and configuration issue

but the problem is still happening, see below output:
[2020-09-02T20:20:18,939][INFO ][o.e.p.PluginsService ] [ElasticEDT] loaded module [x-pack-rollup]
[2020-09-02T20:20:18,939][INFO ][o.e.p.PluginsService ] [ElasticEDT] loaded module [x-pack-security]
[2020-09-02T20:20:18,940][INFO ][o.e.p.PluginsService ] [ElasticEDT] loaded module [x-pack-sql]
[2020-09-02T20:20:18,940][INFO ][o.e.p.PluginsService ] [ElasticEDT] loaded module [x-pack-voting-only-node]
[2020-09-02T20:20:18,940][INFO ][o.e.p.PluginsService ] [ElasticEDT] loaded module [x-pack-watcher]
[2020-09-02T20:20:18,940][INFO ][o.e.p.PluginsService ] [ElasticEDT] no plugins loaded
[2020-09-02T20:20:18,994][ERROR][o.e.b.ElasticsearchUncaughtExceptionHandler] [ElasticEDT] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: java.lang.IllegalStateException: failed to obtain node locks, tried [[/var/lib/elasticsearch]] 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.8.1.jar:7.8.1]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:161) ~[elasticsearch-7.8.1.jar:7.8.1]
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) ~[elasticsearch-7.8.1.jar:7.8.1]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:127) ~[elasticsearch-cli-7.8.1.jar:7.8.1]
at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-cli-7.8.1.jar:7.8.1]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:126) ~[elasticsearch-7.8.1.jar:7.8.1]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92) ~[elasticsearch-7.8.1.jar:7.8.1]
Caused by: java.lang.IllegalStateException: failed to obtain node locks, tried [[/var/lib/elasticsearch]] 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.(NodeEnvironment.java:301) ~[elasticsearch-7.8.1.jar:7.8.1]
at org.elasticsearch.node.Node.(Node.java:335) ~[elasticsearch-7.8.1.jar:7.8.1]
at org.elasticsearch.node.Node.(Node.java:266) ~[elasticsearch-7.8.1.jar:7.8.1]
at org.elasticsearch.bootstrap.Bootstrap$5.(Bootstrap.java:227) ~[elasticsearch-7.8.1.jar:7.8.1]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:227) ~[elasticsearch-7.8.1.jar:7.8.1]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:393) ~[elasticsearch-7.8.1.jar:7.8.1]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:170) ~[elasticsearch-7.8.1.jar:7.8.1]
... 6 more
Caused by: java.io.IOException: failed to obtain lock on /var/lib/elasticsearch/nodes/0
at org.elasticsearch.env.NodeEnvironment$NodeLock.(NodeEnvironment.java:223) ~[elasticsearch-7.8.1.jar:7.8.1]
at org.elasticsearch.env.NodeEnvironment.(NodeEnvironment.java:271) ~[elasticsearch-7.8.1.jar:7.8.1]
at org.elasticsearch.node.Node.(Node.java:335) ~[elasticsearch-7.8.1.jar:7.8.1]
at org.elasticsearch.node.Node.(Node.java:266) ~[elasticsearch-7.8.1.jar:7.8.1]
at org.elasticsearch.bootstrap.Bootstrap$5.(Bootstrap.java:227) ~[elasticsearch-7.8.1.jar:7.8.1]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:227) ~[elasticsearch-7.8.1.jar:7.8.1]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:393) ~[elasticsearch-7.8.1.jar:7.8.1]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:170) ~[elasticsearch-7.8.1.jar:7.8.1]
... 6 more
Caused by: java.nio.file.NoSuchFileException: /var/lib/elasticsearch/nodes/0/node.lock
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:92) ~[?:?]
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111) ~[?:?]
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116) ~[?:?]
at sun.nio.fs.UnixPath.toRealPath(UnixPath.java:860) ~[?:?]
at org.apache.lucene.store.NativeFSLockFactory.obtainFSLock(NativeFSLockFactory.java:108) ~[lucene-core-8.5.1.jar:8.5.1 edb9fc409398f2c3446883f9f80595c884d245d0 - ivera - 2020-04-08 08:55:42]
at org.apache.lucene.store.FSLockFactory.obtainLock(FSLockFactory.java:41) ~[lucene-core-8.5.1.jar:8.5.1 edb9fc409398f2c3446883f9f80595c884d245d0 - ivera - 2020-04-08 08:55:42]
at org.apache.lucene.store.BaseDirectory.obtainLock(BaseDirectory.java:45) ~[lucene-core-8.5.1.jar:8.5.1 edb9fc409398f2c3446883f9f80595c884d245d0 - ivera - 2020-04-08 08:55:42]
at org.elasticsearch.env.NodeEnvironment$NodeLock.(NodeEnvironment.java:216) ~[elasticsearch-7.8.1.jar:7.8.1]
at org.elasticsearch.env.NodeEnvironment.(NodeEnvironment.java:271) ~[elasticsearch-7.8.1.jar:7.8.1]
at org.elasticsearch.node.Node.(Node.java:335) ~[elasticsearch-7.8.1.jar:7.8.1]
at org.elasticsearch.node.Node.(Node.java:266) ~[elasticsearch-7.8.1.jar:7.8.1]
at org.elasticsearch.bootstrap.Bootstrap$5.(Bootstrap.java:227) ~[elasticsearch-7.8.1.jar:7.8.1]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:227) ~[elasticsearch-7.8.1.jar:7.8.1]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:393) ~[elasticsearch-7.8.1.jar:7.8.1]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:170) ~[elasticsearch-7.8.1.jar:7.8.1]
... 6 more
Suppressed: java.nio.file.AccessDeniedException: /var/lib/elasticsearch/nodes/0/node.lock
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:90) ~[?:?]
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111) ~[?:?]
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116) ~[?:?]
at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:219) ~[?:?]
at java.nio.file.Files.newByteChannel(Files.java:370) ~[?:?]
at java.nio.file.Files.createFile(Files.java:647) ~[?:?]
at org.apache.lucene.store.NativeFSLockFactory.obtainFSLock(NativeFSLockFactory.java:98) ~[lucene-core-8.5.1.jar:8.5.1 edb9fc409398f2c3446883f9f80595c884d245d0 - ivera - 2020-04-08 08:55:42]
at org.apache.lucene.store.FSLockFactory.obtainLock(FSLockFactory.java:41) ~[lucene-core-8.5.1.jar:8.5.1 edb9fc409398f2c3446883f9f80595c884d245d0 - ivera - 2020-04-08 08:55:42]
at org.apache.lucene.store.BaseDirectory.obtainLock(BaseDirectory.java:45) ~[lucene-core-8.5.1.jar:8.5.1 edb9fc409398f2c3446883f9f80595c884d245d0 - ivera - 2020-04-08 08:55:42]
at org.elasticsearch.env.NodeEnvironment$NodeLock.(NodeEnvironment.java:216) ~[elasticsearch-7.8.1.jar:7.8.1]
at org.elasticsearch.env.NodeEnvironment.(NodeEnvironment.java:271) ~[elasticsearch-7.8.1.jar:7.8.1]
at org.elasticsearch.node.Node.(Node.java:335) ~[elasticsearch-7.8.1.jar:7.8.1]
at org.elasticsearch.node.Node.(Node.java:266) ~[elasticsearch-7.8.1.jar:7.8.1]
at org.elasticsearch.bootstrap.Bootstrap$5.(Bootstrap.java:227) ~[elasticsearch-7.8.1.jar:7.8.1]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:227) ~[elasticsearch-7.8.1.jar:7.8.1]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:393) ~[elasticsearch-7.8.1.jar:7.8.1]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:170) ~[elasticsearch-7.8.1.jar:7.8.1]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:161) ~[elasticsearch-7.8.1.jar:7.8.1]
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) ~[elasticsearch-7.8.1.jar:7.8.1]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:127) ~[elasticsearch-cli-7.8.1.jar:7.8.1]
at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-cli-7.8.1.jar:7.8.1]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:126) ~[elasticsearch-7.8.1.jar:7.8.1]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92) ~[elasticsearch-7.8.1.jar:7.8.1]
uncaught exception in thread [main]
java.lang.IllegalStateException: failed to obtain node locks, tried [[/var/lib/elasticsearch]] 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.NoSuchFileException: /var/lib/elasticsearch/nodes/0/node.lock
at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:92)
at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116)
at java.base/sun.nio.fs.UnixPath.toRealPath(UnixPath.java:860)
at org.apache.lucene.store.NativeFSLockFactory.obtainFSLock(NativeFSLockFactory.java:108)
at org.apache.lucene.store.FSLockFactory.obtainLock(FSLockFactory.java:41)
at org.apache.lucene.store.BaseDirectory.obtainLock(BaseDirectory.java:45)
at org.elasticsearch.env.NodeEnvironment$NodeLock.(NodeEnvironment.java:216)
at org.elasticsearch.env.NodeEnvironment.(NodeEnvironment.java:271)
at org.elasticsearch.node.Node.(Node.java:335)
at org.elasticsearch.node.Node.(Node.java:266)
at org.elasticsearch.bootstrap.Bootstrap$5.(Bootstrap.java:227)
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:227)
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:393)
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:127)
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)
For complete error details, refer to the log at /var/log/elasticsearch/elasticsearch.log
bash-4.4$

Remove all /var/lib/elasticsearch/* and start again elasticsearch

hi Yassine, I have removed /var/lib/elasticsearch/* contents below:
[root@ElasticEDT elasticsearch]# id
uid=0(root) gid=0(root) groups=0(root) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
[root@ElasticEDT elasticsearch]# pwd
/var/lib/elasticsearch
[root@ElasticEDT elasticsearch]# ll
total 0
[root@ElasticEDT elasticsearch]#
and I have again started Elasticsearch analytics engine

I think it is working correctly now since I am getting this output below:
[2020-09-02T20:54:46,583][INFO ][o.e.c.m.MetadataIndexTemplateService] [ElasticEDT] adding template [.ml-state] for index patterns [.ml-state*]
[2020-09-02T20:54:46,619][INFO ][o.e.c.m.MetadataIndexTemplateService] [ElasticEDT] adding template [.monitoring-logstash] for index patterns [.monitoring-logstash-7-]
[2020-09-02T20:54:46,662][INFO ][o.e.c.m.MetadataIndexTemplateService] [ElasticEDT] adding template [.monitoring-es] for index patterns [.monitoring-es-7-
]
[2020-09-02T20:54:46,745][INFO ][o.e.c.m.MetadataIndexTemplateService] [ElasticEDT] adding template [.monitoring-beats] for index patterns [.monitoring-beats-7-]
[2020-09-02T20:54:46,777][INFO ][o.e.c.m.MetadataIndexTemplateService] [ElasticEDT] adding template [.monitoring-alerts-7] for index patterns [.monitoring-alerts-7]
[2020-09-02T20:54:46,815][INFO ][o.e.c.m.MetadataIndexTemplateService] [ElasticEDT] adding template [.monitoring-kibana] for index patterns [.monitoring-kibana-7-
]
[2020-09-02T20:54:46,856][INFO ][o.e.x.i.a.TransportPutLifecycleAction] [ElasticEDT] adding index lifecycle policy [watch-history-ilm-policy]
[2020-09-02T20:54:46,898][INFO ][o.e.x.i.a.TransportPutLifecycleAction] [ElasticEDT] adding index lifecycle policy [ml-size-based-ilm-policy]
[2020-09-02T20:54:46,937][INFO ][o.e.x.i.a.TransportPutLifecycleAction] [ElasticEDT] adding index lifecycle policy [ilm-history-ilm-policy]
[2020-09-02T20:54:46,964][INFO ][o.e.x.i.a.TransportPutLifecycleAction] [ElasticEDT] adding index lifecycle policy [slm-history-ilm-policy]
[2020-09-02T20:54:47,069][INFO ][o.e.l.LicenseService ] [ElasticEDT] license [a8fd0044-d4db-408d-b384-795fdf6a1e94] mode [basic] - valid
[2020-09-02T20:54:47,071][INFO ][o.e.x.s.s.SecurityStatusChangeListener] [ElasticEDT] Active license is now [BASIC]; Security is disabled

and also, checking if the Elasticsearch daemon is up and running, by sending an HTTP GET request on port 9200, shows that it is indeed running:
[root@ElasticEDT elasticsearch]# id
uid=0(root) gid=0(root) groups=0(root) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
[root@ElasticEDT elasticsearch]# pwd
/var/lib/elasticsearch
[root@ElasticEDT elasticsearch]# ll
total 0
drwx--S---. 3 elasticsearch elasticsearch 15 Sep 2 20:54 nodes
[root@ElasticEDT elasticsearch]# curl http://127.0.0.1:9200
{
"name" : "ElasticEDT",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "v6IRQYCRRP6LZzX9L6rnjw",
"version" : {
"number" : "7.8.1",
"build_flavor" : "default",
"build_type" : "rpm",
"build_hash" : "b5ca9c58fb664ca8bf9e4057fc229b3396bf3a89",
"build_date" : "2020-07-21T16:40:44.668009Z",
"build_snapshot" : false,
"lucene_version" : "8.5.1",
"minimum_wire_compatibility_version" : "6.8.0",
"minimum_index_compatibility_version" : "6.0.0-beta1"
},
"tagline" : "You Know, for Search"
}
[root@ElasticEDT elasticsearch]#

So I think these series of changes finally did it: we now have Elasticsearch engine running on port 9200 on our EasyDO Linux CentOS server: thanks a lot, I will put in a good word for you with your colleagues Kate Presnukhina, Tatjana Frank and Max Muensterteicher: good job Yassine!

1 Like

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