2

Yesterday, I completed the installation of ElasticSearch on Windows Server 2012 R2 and was able to start the ElasticSearch service w/o issue.

Today, I installed Kibana and X-Pack, and am now getting an error when trying to start the ElasticSearch service.

C:\Program Files\Elastic\Elasticsearch\bin>elasticsearch
[2017-07-27T14:47:24,033][INFO ][o.e.n.Node               ] [VSMAIN-01] ini
tializing ...
[2017-07-27T14:47:24,080][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [V
S-SQL-MAIN-01] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: java.lang.IllegalStateException: f
ailed to obtain node locks, tried [[F:\Elastic\Elasticsearch\Data\elasticsearch-
vd]] 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:127
) ~[elasticsearch-5.5.0.jar:5.5.0]
        at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:
114) ~[elasticsearch-5.5.0.jar:5.5.0]
        at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwar
eCommand.java:67) ~[elasticsearch-5.5.0.jar:5.5.0]
        at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:1
22) ~[elasticsearch-5.5.0.jar:5.5.0]
        at org.elasticsearch.cli.Command.main(Command.java:88) ~[elasticsearch-5
.5.0.jar:5.5.0]
        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:91)
 ~[elasticsearch-5.5.0.jar:5.5.0]
        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:84)
 ~[elasticsearch-5.5.0.jar:5.5.0]
Caused by: java.lang.IllegalStateException: failed to obtain node locks, tried [
[F:\Elastic\Elasticsearch\Data\elasticsearch-vd]] with lock id [0]; maybe these
 locations are not writable or multiple nodes were started without increasing [n
ode.max_local_storage_nodes] (was [1])?
        at org.elasticsearch.env.NodeEnvironment.<init>(NodeEnvironment.java:261
) ~[elasticsearch-5.5.0.jar:5.5.0]
        at org.elasticsearch.node.Node.<init>(Node.java:264) ~[elasticsearch-5.5
.0.jar:5.5.0]
        at org.elasticsearch.node.Node.<init>(Node.java:244) ~[elasticsearch-5.5
.0.jar:5.5.0]
        at org.elasticsearch.bootstrap.Bootstrap$5.<init>(Bootstrap.java:232) ~[
elasticsearch-5.5.0.jar:5.5.0]
        at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:232) ~[ela
sticsearch-5.5.0.jar:5.5.0]
        at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:351) ~[elas
ticsearch-5.5.0.jar:5.5.0]
        at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:123
) ~[elasticsearch-5.5.0.jar:5.5.0]
        ... 6 more

I don't even know where to begin to diagnose this and am hoping someone with ElasticSearch on Windows experience may be able to assist.

Currently running Java 8.0.141.

Any advice would be greatly appreciated.

EDIT #1: I should make it clear I have only one ES installation running (trying to run!) I've bypassed the above-mentioned error by increasing node.max_local_storage_nodesto 2. The issue now is a new error, and the fact that increasing the max local storage nodes is discouraged.

Here is the new error that comes up while trying to start ElasticSearch:

C:\Program Files\Elastic\Elasticsearch\bin>elasticsearch
[2017-07-27T17:01:05,785][INFO ][o.e.n.Node               ] [VSMAIN-01] ini
tializing ...
[2017-07-27T17:01:05,863][INFO ][o.e.e.NodeEnvironment    ] [VSMAIN-01] usi
ng [1] data paths, mounts [[SQLVMDATA1 (F:)]], net usable_space [1.2tb], net tot
al_space [1.9tb], spins? [unknown], types [NTFS]
[2017-07-27T17:01:05,863][INFO ][o.e.e.NodeEnvironment    ] [VSMAIN-01] hea
p size [9.9gb], compressed ordinary object pointers [true]
[2017-07-27T17:01:05,863][INFO ][o.e.n.Node               ] [VSMAIN-01] nod
e name [VS-SQL-MAIN-01], node ID [d8V7e27_SzG4tPpUnVQEUg]
[2017-07-27T17:01:05,863][INFO ][o.e.n.Node               ] [VSMAIN-01] ver
sion[5.5.0], pid[5412], build[260387d/2017-06-30T23:16:05.735Z], OS[Windows Serv
er 2012 R2/6.3/amd64], JVM[Oracle Corporation/Java HotSpot(TM) 64-Bit Server VM/
1.8.0_141/25.141-b15]
[2017-07-27T17:01:05,863][INFO ][o.e.n.Node               ] [VSMAIN-01] JVM
 arguments [-XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:
+UseCMSInitiatingOccupancyOnly, -XX:+DisableExplicitGC, -XX:+AlwaysPreTouch, -Xs
s1m, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djna.nosys=true, -Djdk.io
.permissionsUseCanonicalPath=true, -Dio.netty.noUnsafe=true, -Dio.netty.noKeySet
Optimization=true, -Dio.netty.recycler.maxCapacityPerThread=0, -Dlog4j.shutdownH
ookEnabled=false, -Dlog4j2.disable.jmx=true, -Dlog4j.skipJansi=true, -XX:+HeapDu
mpOnOutOfMemoryError, -Xmx10240m, -Xms10240m, -Delasticsearch, -Des.path.home=C:
\Program Files\Elastic\Elasticsearch]
[2017-07-27T17:01:06,677][INFO ][o.e.p.PluginsService     ] [VSMAIN-01] loa
ded module [aggs-matrix-stats]
[2017-07-27T17:01:06,677][INFO ][o.e.p.PluginsService     ] [VSMAIN-01] loa
ded module [ingest-common]
[2017-07-27T17:01:06,677][INFO ][o.e.p.PluginsService     ] [VSMAIN-01] loa
ded module [lang-expression]
[2017-07-27T17:01:06,677][INFO ][o.e.p.PluginsService     ] [VSMAIN-01] loa
ded module [lang-groovy]
[2017-07-27T17:01:06,677][INFO ][o.e.p.PluginsService     ] [VSMAIN-01] loa
ded module [lang-mustache]
[2017-07-27T17:01:06,677][INFO ][o.e.p.PluginsService     ] [VSMAIN-01] loa
ded module [lang-painless]
[2017-07-27T17:01:06,677][INFO ][o.e.p.PluginsService     ] [VSMAIN-01] loa
ded module [parent-join]
[2017-07-27T17:01:06,677][INFO ][o.e.p.PluginsService     ] [VSMAIN-01] loa
ded module [percolator]
[2017-07-27T17:01:06,677][INFO ][o.e.p.PluginsService     ] [VSMAIN-01] loa
ded module [reindex]
[2017-07-27T17:01:06,677][INFO ][o.e.p.PluginsService     ] [VSMAIN-01] loa
ded module [transport-netty3]
[2017-07-27T17:01:06,677][INFO ][o.e.p.PluginsService     ] [VSMAIN-01] loa
ded module [transport-netty4]
[2017-07-27T17:01:06,677][INFO ][o.e.p.PluginsService     ] [VSMAIN-01] no
plugins loaded
[2017-07-27T17:01:08,099][INFO ][o.e.d.DiscoveryModule    ] [VSMAIN-01] usi
ng discovery type [zen]
[2017-07-27T17:01:08,537][INFO ][o.e.n.Node               ] [VSMAIN-01] ini
tialized
[2017-07-27T17:01:08,537][INFO ][o.e.n.Node               ] [VSMAIN-01] sta
rting ...
[2017-07-27T17:01:08,897][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [V
S-SQL-MAIN-01] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: BindTransportException[Failed to b
ind to [9300]]; nested: BindException[Address already in use: bind];
        at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:127
) ~[elasticsearch-5.5.0.jar:5.5.0]
        at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:
114) ~[elasticsearch-5.5.0.jar:5.5.0]
        at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwar
eCommand.java:67) ~[elasticsearch-5.5.0.jar:5.5.0]
        at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:1
22) ~[elasticsearch-5.5.0.jar:5.5.0]
        at org.elasticsearch.cli.Command.main(Command.java:88) ~[elasticsearch-5
.5.0.jar:5.5.0]
        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:91)
 ~[elasticsearch-5.5.0.jar:5.5.0]
        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:84)
 ~[elasticsearch-5.5.0.jar:5.5.0]
Caused by: org.elasticsearch.transport.BindTransportException: Failed to bind to
 [9300]
        at org.elasticsearch.transport.TcpTransport.bindToPort(TcpTransport.java
:793) ~[elasticsearch-5.5.0.jar:5.5.0]
        at org.elasticsearch.transport.TcpTransport.bindServer(TcpTransport.java
:758) ~[elasticsearch-5.5.0.jar:5.5.0]
        at org.elasticsearch.transport.netty4.Netty4Transport.doStart(Netty4Tran
sport.java:173) ~[?:?]
        at org.elasticsearch.common.component.AbstractLifecycleComponent.start(A
bstractLifecycleComponent.java:69) ~[elasticsearch-5.5.0.jar:5.5.0]
        at org.elasticsearch.transport.TransportService.doStart(TransportService
.java:209) ~[elasticsearch-5.5.0.jar:5.5.0]
        at org.elasticsearch.common.component.AbstractLifecycleComponent.start(A
bstractLifecycleComponent.java:69) ~[elasticsearch-5.5.0.jar:5.5.0]
        at org.elasticsearch.node.Node.start(Node.java:692) ~[elasticsearch-5.5.
0.jar:5.5.0]
        at org.elasticsearch.bootstrap.Bootstrap.start(Bootstrap.java:277) ~[ela
sticsearch-5.5.0.jar:5.5.0]
        at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:360) ~[elas
ticsearch-5.5.0.jar:5.5.0]
        at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:123
) ~[elasticsearch-5.5.0.jar:5.5.0]
        ... 6 more
Caused by: java.net.BindException: Address already in use: bind
        at sun.nio.ch.Net.bind0(Native Method) ~[?:?]
        at sun.nio.ch.Net.bind(Unknown Source) ~[?:?]
        at sun.nio.ch.Net.bind(Unknown Source) ~[?:?]
        at sun.nio.ch.ServerSocketChannelImpl.bind(Unknown Source) ~[?:?]
        at io.netty.channel.socket.nio.NioServerSocketChannel.doBind(NioServerSo
cketChannel.java:128) ~[?:?]
        at io.netty.channel.AbstractChannel$AbstractUnsafe.bind(AbstractChannel.
java:554) ~[?:?]
        at io.netty.channel.DefaultChannelPipeline$HeadContext.bind(DefaultChann
elPipeline.java:1258) ~[?:?]
        at io.netty.channel.AbstractChannelHandlerContext.invokeBind(AbstractCha
nnelHandlerContext.java:501) ~[?:?]
        at io.netty.channel.AbstractChannelHandlerContext.bind(AbstractChannelHa
ndlerContext.java:486) ~[?:?]
        at io.netty.channel.DefaultChannelPipeline.bind(DefaultChannelPipeline.j
ava:980) ~[?:?]
        at io.netty.channel.AbstractChannel.bind(AbstractChannel.java:250) ~[?:?
]
        at io.netty.bootstrap.AbstractBootstrap$2.run(AbstractBootstrap.java:365
) ~[?:?]
        at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEv
entExecutor.java:163) ~[?:?]
        at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(Single
ThreadEventExecutor.java:403) ~[?:?]
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:462) ~[?:?]
        at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThread
EventExecutor.java:858) ~[?:?]
        at java.lang.Thread.run(Unknown Source) [?:1.8.0_141]
[2017-07-27T17:01:09,631][INFO ][o.e.n.Node               ] [VSMAIN-01] sto
pping ...
[2017-07-27T17:01:09,631][INFO ][o.e.n.Node               ] [VSMAIN-01] sto
pped
[2017-07-27T17:01:09,631][INFO ][o.e.n.Node               ] [VSMAIN-01] clo
sing ...
[2017-07-27T17:01:09,631][INFO ][o.e.n.Node               ] [VSMAIN-01] clo
sed
Stpete111
  • 3,109
  • 4
  • 34
  • 74

4 Answers4

5

From command line

I also face the same issue and I used following steps to get rid of.

Step 1: check if default elastic search port 9300 is still occupied

lsof -i:9300

Yes, it's occupied then

Step 2: Kill the process id

kill -9 38744

Now, its good to launch.

Screenshot for reference.

enter image description here

Amitesh Bharti
  • 14,264
  • 6
  • 62
  • 62
1

The problem is explained here:

By default, Elasticsearch is configured to prevent more than one node from sharing the same data path. To allow for more than one node (e.g., on your development machine), use the setting node.max_local_storage_nodes and set this to a positive integer larger than one.

If you have more than one ES install running on the same node and configured with the same data folder, then you need to either change the data path of one of your ES server, or increase the node.max_local_storage_nodes setting, but this is discouraged.

Val
  • 207,596
  • 13
  • 358
  • 360
  • Thank you Val for your reply. The strange thing about all this is I only have 1 ES install running. Just to test, I increased the max local storage nodes and it got past that error, but now there's another error. Shall I create a new post for this new error (to keep the Stack Overflow gods happy) or should I edit my post here? And I still need to figure out this issue, as increasing max local storage nodes is not recommended as you've pointed out. – Stpete111 Jul 27 '17 at 16:55
  • 1
    I suppose you can update your question by explaining what you did and the new error you get since it's related. – Val Jul 27 '17 at 16:56
  • 1
    `Address already in use` is clearly an indication that another ES process is running on port 9200, which reinforces my initial idea. What does your process explorer say? – Val Jul 27 '17 at 17:08
  • Ok got it now. It was another instance of the Java Runtime that was still hung up and running in the background. I killed that and now I can start ES. I can also put max nodes back down to 1. Thanks Val! I have one more question: it appears that if I close the cmd line window that I used to start ES, it kills the ES service. Is this right? Yesterday I'm pretty sure it didn't do this. – Stpete111 Jul 27 '17 at 17:25
  • I wouldn't bet on that, especially not on Windows ;-) Glad you figured the issue, though. – Val Jul 27 '17 at 17:59
1

This worked for me (on a windows machine):

I opened 'Task manager', and disabled another elastic search service (this could be a different version, or existing process id).

PS: Looks like this issue occurs when there is another elastic search service already running on same server/instance.

sɐunıɔןɐqɐp
  • 3,332
  • 15
  • 36
  • 40
PavanD
  • 11
  • 1
0

This seems to be a permission issue, log says it cannot obtain nodes locks. That means it has no write permission on your folder F:\Elastic\Elasticsearch\Data\elasticsearch-vd. That said, I'm not an expert about ES on Windows.

Good luck on that problem, IMO it's not that terrible :)

Gramatiik
  • 122
  • 1
  • 11