# ElasticSearch stop on Centos 7

**URL:** https://discuss.elastic.co/t/elasticsearch-stop-on-centos-7/189894
**Category:** Elasticsearch
**Created:** [July 11, 2019, 2:31am UTC](https://discuss.elastic.co/t/elasticsearch-stop-on-centos-7/189894 "2019-07-11T02:31:26Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![skazhikadyadya](https://avatars.discourse-cdn.com/v4/letter/s/8491ac/32.png) [@skazhikadyadya](https://discuss.elastic.co/u/skazhikadyadya)
#### Post date: [July 11, 2019, 2:31am UTC](https://discuss.elastic.co/t/elasticsearch-stop-on-centos-7/189894/1 "2019-07-11T02:31:27Z")

</div>

Hi. I have installed ES 5.6.16 on my Centos 7.3 from yum.

After installation I was check status with `service elasticsearch status`:  
● elasticsearch.service - Elasticsearch  
Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; disabled; vendor preset: disabled)  
Active: failed (Result: exit-code) since Thu 2019-07-11 04:20:07 CEST; 8min ago  
Docs: [http://www.elastic.co](http://www.elastic.co)  
Process: 30621 ExecStart=/usr/share/elasticsearch/bin/elasticsearch -p {PID\_DIR}/elasticsearch.pid --quiet -Edefault.path.logs={LOG\_DIR} -Edefault.path.data={DATA\_DIR} -Edefault.path.conf={CONF\_DIR} (code=exited, status=1/FAILURE)  
Process: 30618 ExecStartPre=/usr/share/elasticsearch/bin/elasticsearch-systemd-pre-exec (code=exited, status=0/SUCCESS)  
Main PID: 30621 (code=exited, status=1/FAILURE)

Ok. In /var/log/elasticsearch/elasticsearch.log I see:

```
1) Error injecting constructor, ElasticsearchException[java.io.IOException: failed to read [id:12, legacy:false, file:/var/lib/elasticsearch/nodes/0/indices/_L3XAhS3TFu3I8r0lyXm0Q/_state/state-12.st]]; nested: IOException[failed to read [id:12, legacy:false, file:/var/lib/elasticsearch/nodes/0/indices/_L3XAhS3TFu3I8r0lyXm0Q/_state/state-12.st]]; nested: IllegalArgumentException[Unexpected field [mapping_version]];
  at org.elasticsearch.gateway.GatewayMetaState.<init>(Unknown Source)
  while locating org.elasticsearch.gateway.GatewayMetaState
    for parameter 4 at org.elasticsearch.gateway.GatewayService.<init>(Unknown Source)
  while locating org.elasticsearch.gateway.GatewayService
Caused by: ElasticsearchException[java.io.IOException: failed to read [id:12, legacy:false, file:/var/lib/elasticsearch/nodes/0/indices/_L3XAhS3TFu3I8r0lyXm0Q/_state/state-12.st]]; nested: IOException[failed to read [id:12, legacy:false, file:/var/lib/elasticsearch/nodes/0/indices/_L3XAhS3TFu3I8r0lyXm0Q/_state/state-12.st]]; nested: IllegalArgumentException[Unexpected field [mapping_version]];
        at org.elasticsearch.ExceptionsHelper.maybeThrowRuntimeAndSuppress(ExceptionsHelper.java:196)
        at org.elasticsearch.gateway.MetaDataStateFormat.loadLatestState(MetaDataStateFormat.java:335)
        at org.elasticsearch.common.util.IndexFolderUpgrader.upgrade(IndexFolderUpgrader.java:90)
        at org.elasticsearch.common.util.IndexFolderUpgrader.upgradeIndicesIfNeeded(IndexFolderUpgrader.java:128)
        at org.elasticsearch.gateway.GatewayMetaState.<init>(GatewayMetaState.java:91)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
        at org.elasticsearch.common.inject.DefaultConstructionProxyFactory$1.newInstance(DefaultConstructionProxyFactory.java:49)
        at org.elasticsearch.common.inject.ConstructorInjector.construct(ConstructorInjector.java:86)
        at org.elasticsearch.common.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:116)
        at org.elasticsearch.common.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:47)
        at org.elasticsearch.common.inject.InjectorImpl.callInContext(InjectorImpl.java:825)
        at org.elasticsearch.common.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:43)
        at org.elasticsearch.common.inject.Scopes$1$1.get(Scopes.java:59)
        at org.elasticsearch.common.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:50)
        at org.elasticsearch.common.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
        at org.elasticsearch.common.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
        at org.elasticsearch.common.inject.ConstructorInjector.construct(ConstructorInjector.java:85)
        at org.elasticsearch.common.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:116)

```

How I can fix it?

Thanks!

---

<div class="post-metadata">

### Author: ![rugenl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rugenl/32/12887_2.png) [@rugenl](https://discuss.elastic.co/u/rugenl)
#### Post date: [July 11, 2019, 2:56am UTC](https://discuss.elastic.co/t/elasticsearch-stop-on-centos-7/189894/2 "2019-07-11T02:56:28Z")

</div>

Has any other version of elastic ever been installed on this server?

Are there files in the data directory? Is the owner and permissions correct? If this is a new stack, you could just delete everything in the data directory and start over.

I think I've seen this in a lab where Elastic was started from the command line (as root), created files in the data directory owned by root, so it would fail started as elastic by systemctl.

---

<div class="post-metadata">

### Author: ![skazhikadyadya](https://avatars.discourse-cdn.com/v4/letter/s/8491ac/32.png) [@skazhikadyadya](https://discuss.elastic.co/u/skazhikadyadya)
#### Post date: [July 11, 2019, 3:10am UTC](https://discuss.elastic.co/t/elasticsearch-stop-on-centos-7/189894/3 "2019-07-11T03:10:18Z")

</div>

Thank you for reply.

> Has any other version of elastic ever been installed on this server?  
> No.

> Are there files in the data directory? Is the owner and permissions correct? If this is a new stack, you could just delete everything in the data directory and start over.  
> Where I can find that? Is it normal?  
> [root@shop ~]# ls -al /var/lib/elasticsearch/  
> total 12  
> drwxrwx--- 3 elasticsearch elasticsearch 4096 Mar 13 16:34 .  
> drwxr-xr-x. 37 root root 4096 Jul 2 23:23 ..  
> drwxrwsr-x 3 elasticsearch elasticsearch 4096 Jul 2 23:23 nodes

> I think I've seen this in a lab where Elastic was started from the command line (as root), created files in the data directory owned by root, so it would fail started as elastic by systemctl.  
> I can't install ES without root, am i wrong?

---

<div class="post-metadata">

### Author: ![skazhikadyadya](https://avatars.discourse-cdn.com/v4/letter/s/8491ac/32.png) [@skazhikadyadya](https://discuss.elastic.co/u/skazhikadyadya)
#### Post date: [July 11, 2019, 3:13am UTC](https://discuss.elastic.co/t/elasticsearch-stop-on-centos-7/189894/4 "2019-07-11T03:13:19Z")

</div>

I deleted the data in `/var/lib/elasticsearch` and started ES again. It works! Thank you!

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [August 8, 2019, 3:13am UTC](https://discuss.elastic.co/t/elasticsearch-stop-on-centos-7/189894/5 "2019-08-08T03:13:28Z")

</div>

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