Elasticsearch server stops right after start

I've just installed the elasticsearch 5.5.2 via rpm. When I try to start the server using service elasticsearch start, I got the following message
Starting elasticsearch (via systemctl): [ OK ]

But then when I try curl -X GET 'http://localhost:9200', it seems the server stopped because I received the following message
curl: (7) Failed connect to localhost:9200; Connection refused

Below is a part of log file

[2017-09-06T20:19:09,799][INFO ][o.e.n.Node ] [] initializing ...
[2017-09-06T20:19:09,856][INFO ][o.e.e.NodeEnvironment ] [qRCrJ_z] using [1] data paths, mounts [[/ (rootfs)]], net usable_space [252.7gb], net total_space [385.7gb], spins? [unknown], types [rootfs]
[2017-09-06T20:19:09,856][INFO ][o.e.e.NodeEnvironment ] [qRCrJ_z] heap size [1.9gb], compressed ordinary object pointers [true]
[2017-09-06T20:19:09,879][INFO ][o.e.n.Node ] node name [qRCrJ_z] derived from node ID [qRCrJ_zHQaiKiYo-kErQSw]; set [node.name] to override
[2017-09-06T20:19:09,879][INFO ][o.e.n.Node ] version[5.5.2], pid[8346], build[b2f0c09/2017-08-14T12:33:14.154Z], OS[Linux/3.10.0-514.26.2.el7.x86_64/amd64], JVM[Oracle Corporation/OpenJDK 64-Bit Server VM/1.8.0_141/25.141-b16]
[2017-09-06T20:19:09,880][INFO ][o.e.n.Node ] JVM arguments [-Xms2g, -Xmx2g, -XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -XX:+AlwaysPreTouch, -Xss1m, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djna.nosys=true, -Djdk.io.permissionsUseCanonicalPath=true, -Dio.netty.noUnsafe=true, -Dio.netty.noKeySetOptimization=true, -Dio.netty.recycler.maxCapacityPerThread=0, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Dlog4j.skipJansi=true, -XX:+HeapDumpOnOutOfMemoryError, -Des.path.home=/usr/share/elasticsearch]
[2017-09-06T20:19:10,491][INFO ][o.e.p.PluginsService ] [qRCrJ_z] loaded module [aggs-matrix-stats]
[2017-09-06T20:19:10,491][INFO ][o.e.p.PluginsService ] [qRCrJ_z] loaded module [ingest-common]
[2017-09-06T20:19:10,491][INFO ][o.e.p.PluginsService ] [qRCrJ_z] loaded module [lang-expression]
[2017-09-06T20:19:10,491][INFO ][o.e.p.PluginsService ] [qRCrJ_z] loaded module [lang-groovy]
[2017-09-06T20:19:10,491][INFO ][o.e.p.PluginsService ] [qRCrJ_z] loaded module [lang-mustache]
[2017-09-06T20:19:10,491][INFO ][o.e.p.PluginsService ] [qRCrJ_z] loaded module [lang-painless]
[2017-09-06T20:19:10,491][INFO ][o.e.p.PluginsService ] [qRCrJ_z] loaded module [parent-join]
[2017-09-06T20:19:10,491][INFO ][o.e.p.PluginsService ] [qRCrJ_z] loaded module [percolator]
[2017-09-06T20:19:10,491][INFO ][o.e.p.PluginsService ] [qRCrJ_z] loaded module [reindex]
[2017-09-06T20:19:10,492][INFO ][o.e.p.PluginsService ] [qRCrJ_z] loaded module [transport-netty3]
[2017-09-06T20:19:10,492][INFO ][o.e.p.PluginsService ] [qRCrJ_z] loaded module [transport-netty4]
[2017-09-06T20:19:10,492][INFO ][o.e.p.PluginsService ] [qRCrJ_z] no plugins loaded
[2017-09-06T20:19:11,750][INFO ][o.e.d.DiscoveryModule ] [qRCrJ_z] using discovery type [zen]
[2017-09-06T20:19:12,116][ERROR][o.e.g.GatewayMetaState ] [qRCrJ_z] failed to read local state, exiting...
org.elasticsearch.ElasticsearchException: java.io.IOException: failed to read [id:17, legacy:false, file:/var/lib/elasticsearch/elasticsearch/nodes/0/indices/ebay2vn_vn_idx2/_state/state-17.st]
at org.elasticsearch.ExceptionsHelper.maybeThrowRuntimeAndSuppress(ExceptionsHelper.java:150) ~[elasticsearch-5.5.2.jar:5.5.2]
at org.elasticsearch.gateway.MetaDataStateFormat.loadLatestState(MetaDataStateFormat.java:334) ~[elasticsearch-5.5.2.jar:5.5.2]
at org.elasticsearch.common.util.IndexFolderUpgrader.upgrade(IndexFolderUpgrader.java:90) ~[elasticsearch-5.5.2.jar:5.5.2]
at org.elasticsearch.common.util.IndexFolderUpgrader.upgradeIndicesIfNeeded(IndexFolderUpgrader.java:128) ~[elasticsearch-5.5.2.jar:5.5.2]
at org.elasticsearch.gateway.GatewayMetaState.(GatewayMetaState.java:91) [elasticsearch-5.5.2.jar:5.5.2]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:?]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) [?:1.8.0_141]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [?:1.8.0_141]
at java.lang.reflect.Constructor.newInstance(Constructor.java:423) [?:1.8.0_141]
at org.elasticsearch.common.inject.DefaultConstructionProxyFactory$1.newInstance(DefaultConstructionProxyFactory.java:49) [elasticsearch-5.5.2.jar:5.5.2]
at org.elasticsearch.common.inject.ConstructorInjector.construct(ConstructorInjector.java:86) [elasticsearch-5.5.2.jar:5.5.2]
at org.elasticsearch.common.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:116) [elasticsearch-5.5.2.jar:5.5.2]
at org.elasticsearch.common.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:47) [elasticsearch-5.5.2.jar:5.5.2]
at org.elasticsearch.common.inject.InjectorImpl.callInContext(InjectorImpl.java:825) [elasticsearch-5.5.2.jar:5.5.2]
at org.elasticsearch.common.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:43) [elasticsearch-5.5.2.jar:5.5.2]
at org.elasticsearch.common.inject.Scopes$1$1.get(Scopes.java:59) [elasticsearch-5.5.2.jar:5.5.2]
at org.elasticsearch.common.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:50) [elasticsearch-5.5.2.jar:5.5.2]
at org.elasticsearch.common.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42) [elasticsearch-5.5.2.jar:5.5.2]
at org.elasticsearch.common.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66) [elasticsearch-5.5.2.jar:5.5.2]
at org.elasticsearch.common.inject.ConstructorInjector.construct(ConstructorInjector.java:85) [elasticsearch-5.5.2.jar:5.5.2]
at org.elasticsearch.common.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:116) [elasticsearch-5.5.2.jar:5.5.2]
at org.elasticsearch.common.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:47) [elasticsearch-5.5.2.jar:5.5.2]
at org.elasticsearch.common.inject.InjectorImpl.callInContext(InjectorImpl.java:825) [elasticsearch-5.5.2.jar:5.5.2]
at org.elasticsearch.common.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:43) [elasticsearch-5.5.2.jar:5.5.2]

What can I do ?

Regards

After you installed it did you do anything, change configs etc?
What happens if you ls -l /var/lib/elasticsearch/?

Hey!

Where is the data being written to by ES? Does that path exist and if so, is it writable?

After looking at the logs, i found that there is unable to connect your cluster. not able to resolve node name.
Have you edit your node name as per your machine 's host name?
and do following checks in the configuration file:
Mention node.name as per your machine name
Make sure cluster.name is uncommented.

Also check the permission of /var/lib/elasticsearch location

Thanks guys, I fixed the problem. It turned out that I installed the new
elastic version (5.5) without completely removing all data of the old
version (1.7). After removing the old version completely, the server starts
fine.

Mai

1 Like

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