Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

elasticsearch.service: main process exited, code=exited, status=1/FAILURE #25505

Closed
521xueweihan opened this issue Jul 1, 2017 · 17 comments
Closed

Comments

@521xueweihan
Copy link

521xueweihan commented Jul 1, 2017

desciption

I use rpm installed elasticsearch-1.7.3, It work, then I use rpm uninstall it. Because I want to install 5.xx.
So I use the same way to install elasticsearch-5.4.3, But when I restart elasticsearch, It don't work.

elasticsearch.yml

# ======================== Elasticsearch Configuration =========================       
#                                                                                      
# NOTE: Elasticsearch comes with reasonable defaults for most settings.                
#       Before you set out to tweak and tune the configuration, make sure you          
#       understand what are you trying to accomplish and the consequences.             
#                                                                                      
# The primary way of configuring a node is via this file. This template lists          
# the most important settings you may want to configure for a production cluster.      
#                                                                                      
# Please consult the documentation for further information on configuration options:   
# https://www.elastic.co/guide/en/elasticsearch/reference/index.html                   
#                                                                                      
# ---------------------------------- Cluster -----------------------------------       
#                                                                                      
# Use a descriptive name for your cluster:                                             
#                                                                                      
#cluster.name: my-application                                                          
#                                                                                      
# ------------------------------------ Node ------------------------------------       
#                                                                                      
# Use a descriptive name for the node:                                                 
#                                                                                      
#node.name: node-1                                                                     
#                                                                                      
# Add custom attributes to the node:                                                   
#                                                                                      
#node.attr.rack: r1                                                                    
#                                                                                      
# ----------------------------------- Paths ------------------------------------       
#                                                                                      
# Path to directory where to store the data (separate multiple locations by comma):    
#                                                                                      
#path.data: /path/to/data                                                              
#                                                                                      
# Path to log files:                                                                   
#                                                                                      
#path.logs: /path/to/logs                                                              
#                                                                                      
# ----------------------------------- Memory -----------------------------------
#
# Lock the memory on startup:
#
#bootstrap.memory_lock: true
#
# Make sure that the heap size is set to about half the memory available
# on the system and that the owner of the process is allowed to use this
# limit.
#
# Elasticsearch performs poorly when the system is swapping the memory.
#
# ---------------------------------- Network -----------------------------------
#
# Set the bind address to a specific IP (IPv4 or IPv6):
#
#network.host: 192.168.0.1
#
# Set a custom port for HTTP:
#
#http.port: 9200
#
# For more information, consult the network module documentation.
#
# --------------------------------- Discovery ----------------------------------
#
# Pass an initial list of hosts to perform discovery when new node is started:
# The default list of hosts is ["127.0.0.1", "[::1]"]
#
#discovery.zen.ping.unicast.hosts: ["host1", "host2"]
#
# Prevent the "split brain" by configuring the majority of nodes (total number of master-eligible nodes / 2 + 1):
#
#discovery.zen.minimum_master_nodes: 3
#
# For more information, consult the zen discovery module documentation.
# ---------------------------------- Gateway -----------------------------------
#
# Block initial recovery after a full cluster restart until N nodes are started:
#
#gateway.recover_after_nodes: 3
#
# For more information, consult the gateway module documentation.
#
# ---------------------------------- Various -----------------------------------
#
# Require explicit names when deleting indices:
#
#action.destructive_requires_name: true                                                                                       

elasticsearch.log

[2017-07-01T17:52:12,513][ERROR][o.e.g.GatewayMetaState ] [YPTbq-O] failed to read local state, exiting... org.elasticsearch.ElasticsearchException: java.io.IOException: failed to read [id:0, legacy:false, file:/var/lib/elasticsearch/elasticsearch/nodes/0/indices/jobbole/_state/state-0.st]

Status

● elasticsearch.service - Elasticsearch
   Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since 六 2017-07-01 17:25:19 CST; 55s ago
     Docs: http://www.elastic.co
  Process: 2100 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: 2086 ExecStartPre=/usr/share/elasticsearch/bin/elasticsearch-systemd-pre-exec (code=exited, status=0/SUCCESS)
 Main PID: 2100 (code=exited, status=1/FAILURE)

7月 01 17:24:14 localhost.localdomain systemd[1]: Starting Elasticsearch...
7月 01 17:24:15 localhost.localdomain systemd[1]: Started Elasticsearch.
7月 01 17:25:19 localhost.localdomain systemd[1]: elasticsearch.service: main process exited, code=exited, status=1/FAILURE
7月 01 17:25:19 localhost.localdomain systemd[1]: Unit elasticsearch.service entered failed state.
7月 01 17:25:19 localhost.localdomain systemd[1]: elasticsearch.service failed.
@521xueweihan
Copy link
Author

Solution

[2017-07-01T17:52:12,513][ERROR][o.e.g.GatewayMetaState ] [YPTbq-O] failed to read local state, exiting... org.elasticsearch.ElasticsearchException: java.io.IOException: failed to read [id:0, legacy:false, file:/var/lib/elasticsearch/elasticsearch/nodes/0/indices/jobbole/_state/state-0.st]

Delete the state-0.st fille : sudo rm -rf /var/lib/elasticsearch/elasticsearch/nodes/0/

@jasontedor
Copy link
Member

You can not upgrade from 1.x to 5.x, we offer zero backwards compatibility guarantees here. We only support upgrading from major version N to major version N + 1.

@aruna09
Copy link

aruna09 commented Dec 13, 2017

I am not able to start elasticsearch. The same error curl(7) failed to localhost.
I did try the solution mentioned above but to no avail!
Help ASAP!

@sukhmel
Copy link

sukhmel commented Dec 14, 2017

@ArunaMaurya221B this description is not nearly sufficient. Is there something in logs? What version do you run, on which OS, do you use systemctl, if so then what does systemctl status elasticsearch.service show?

@WomBoss
Copy link

WomBoss commented Feb 24, 2018

elasticsearch.service: Main process exited, code=exited, status=1/FAILURE
elasticsearch.service: Unit entered failed state.
elasticsearch.service: Failed with result 'exit-code'.

@WomBoss
Copy link

WomBoss commented Feb 24, 2018

Somebody have more details about this ?

@lfxch
Copy link

lfxch commented Feb 25, 2018

I have the same Problem, complete details from elasticsearch.log after starting service:

[2018-02-25T11:04:56,383][INFO ][o.e.n.Node ] [] initializing ...
[2018-02-25T11:04:56,431][INFO ][o.e.e.NodeEnvironment ] [vvPQzWL] using [1] data paths, mounts [[/ (/dev/sdb5)]], net usable_space [306.4gb], net total_space [456.9gb], spins? [no], types [ext4]
[2018-02-25T11:04:56,431][INFO ][o.e.e.NodeEnvironment ] [vvPQzWL] heap size [1.9gb], compressed ordinary object pointers [true]
[2018-02-25T11:04:56,432][INFO ][o.e.n.Node ] node name [vvPQzWL] derived from node ID [vvPQzWLxTc-J-cg_MDW5lw]; set [node.name] to override
[2018-02-25T11:04:56,433][INFO ][o.e.n.Node ] version[5.2.2], pid[14674], build[f9d9b74/2017-02-24T17:26:45.835Z], OS[Linux/4.13.0-32-generic/amd64], JVM[Oracle Corporation/OpenJDK 64-Bit Server VM/1.8.0_151/25.151-b12]
[2018-02-25T11:04:56,868][INFO ][o.e.p.PluginsService ] [vvPQzWL] loaded module [aggs-matrix-stats]
[2018-02-25T11:04:56,868][INFO ][o.e.p.PluginsService ] [vvPQzWL] loaded module [ingest-common]
[2018-02-25T11:04:56,868][INFO ][o.e.p.PluginsService ] [vvPQzWL] loaded module [lang-expression]
[2018-02-25T11:04:56,868][INFO ][o.e.p.PluginsService ] [vvPQzWL] loaded module [lang-groovy]
[2018-02-25T11:04:56,868][INFO ][o.e.p.PluginsService ] [vvPQzWL] loaded module [lang-mustache]
[2018-02-25T11:04:56,868][INFO ][o.e.p.PluginsService ] [vvPQzWL] loaded module [lang-painless]
[2018-02-25T11:04:56,868][INFO ][o.e.p.PluginsService ] [vvPQzWL] loaded module [percolator]
[2018-02-25T11:04:56,868][INFO ][o.e.p.PluginsService ] [vvPQzWL] loaded module [reindex]
[2018-02-25T11:04:56,868][INFO ][o.e.p.PluginsService ] [vvPQzWL] loaded module [transport-netty3]
[2018-02-25T11:04:56,868][INFO ][o.e.p.PluginsService ] [vvPQzWL] loaded module [transport-netty4]
[2018-02-25T11:04:56,869][INFO ][o.e.p.PluginsService ] [vvPQzWL] no plugins loaded
[2018-02-25T11:04:57,205][ERROR][o.e.b.Bootstrap ] Exception
java.lang.IllegalStateException: No match found
at java.util.regex.Matcher.group(Matcher.java:536) ~[?:1.8.0_151]
at org.elasticsearch.monitor.os.OsProbe.getControlGroups(OsProbe.java:216) ~[elasticsearch-5.2.2.jar:5.2.2]
at org.elasticsearch.monitor.os.OsProbe.getCgroup(OsProbe.java:414) ~[elasticsearch-5.2.2.jar:5.2.2]
at org.elasticsearch.monitor.os.OsProbe.osStats(OsProbe.java:466) ~[elasticsearch-5.2.2.jar:5.2.2]
at org.elasticsearch.monitor.os.OsService.(OsService.java:45) ~[elasticsearch-5.2.2.jar:5.2.2]
at org.elasticsearch.monitor.MonitorService.(MonitorService.java:45) ~[elasticsearch-5.2.2.jar:5.2.2]
at org.elasticsearch.node.Node.(Node.java:345) ~[elasticsearch-5.2.2.jar:5.2.2]
at org.elasticsearch.node.Node.(Node.java:232) ~[elasticsearch-5.2.2.jar:5.2.2]
at org.elasticsearch.bootstrap.Bootstrap$6.(Bootstrap.java:241) ~[elasticsearch-5.2.2.jar:5.2.2]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:241) ~[elasticsearch-5.2.2.jar:5.2.2]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:333) [elasticsearch-5.2.2.jar:5.2.2]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:121) [elasticsearch-5.2.2.jar:5.2.2]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:112) [elasticsearch-5.2.2.jar:5.2.2]
at org.elasticsearch.cli.SettingCommand.execute(SettingCommand.java:54) [elasticsearch-5.2.2.jar:5.2.2]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:122) [elasticsearch-5.2.2.jar:5.2.2]
at org.elasticsearch.cli.Command.main(Command.java:88) [elasticsearch-5.2.2.jar:5.2.2]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:89) [elasticsearch-5.2.2.jar:5.2.2]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:82) [elasticsearch-5.2.2.jar:5.2.2]
[2018-02-25T11:04:57,209][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: java.lang.IllegalStateException: No match found
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:125) ~[elasticsearch-5.2.2.jar:5.2.2]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:112) ~[elasticsearch-5.2.2.jar:5.2.2]
at org.elasticsearch.cli.SettingCommand.execute(SettingCommand.java:54) ~[elasticsearch-5.2.2.jar:5.2.2]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:122) ~[elasticsearch-5.2.2.jar:5.2.2]
at org.elasticsearch.cli.Command.main(Command.java:88) ~[elasticsearch-5.2.2.jar:5.2.2]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:89) ~[elasticsearch-5.2.2.jar:5.2.2]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:82) ~[elasticsearch-5.2.2.jar:5.2.2]
Caused by: java.lang.IllegalStateException: No match found
at java.util.regex.Matcher.group(Matcher.java:536) ~[?:1.8.0_151]
at org.elasticsearch.monitor.os.OsProbe.getControlGroups(OsProbe.java:216) ~[elasticsearch-5.2.2.jar:5.2.2]
at org.elasticsearch.monitor.os.OsProbe.getCgroup(OsProbe.java:414) ~[elasticsearch-5.2.2.jar:5.2.2]
at org.elasticsearch.monitor.os.OsProbe.osStats(OsProbe.java:466) ~[elasticsearch-5.2.2.jar:5.2.2]
at org.elasticsearch.monitor.os.OsService.(OsService.java:45) ~[elasticsearch-5.2.2.jar:5.2.2]
at org.elasticsearch.monitor.MonitorService.(MonitorService.java:45) ~[elasticsearch-5.2.2.jar:5.2.2]
at org.elasticsearch.node.Node.(Node.java:345) ~[elasticsearch-5.2.2.jar:5.2.2]
at org.elasticsearch.node.Node.(Node.java:232) ~[elasticsearch-5.2.2.jar:5.2.2]
at org.elasticsearch.bootstrap.Bootstrap$6.(Bootstrap.java:241) ~[elasticsearch-5.2.2.jar:5.2.2]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:241) ~[elasticsearch-5.2.2.jar:5.2.2]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:333) ~[elasticsearch-5.2.2.jar:5.2.2]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:121) ~[elasticsearch-5.2.2.jar:5.2.2]
... 6 more

@romseygeek
Copy link
Contributor

Please don't add comments on a closed issue - instead raise this on our forums at discuss.elastic.co where we can give better support.

@WomBoss
Copy link

WomBoss commented Feb 25, 2018

Hello, you can see best details on journalctl, for me it was just jvm memory adjustment.

@bqayyum
Copy link

bqayyum commented May 30, 2018

I am new to elasticsearch and facing the below issue:
[elastic@elsqw1 elastic]$ systemctl status elasticsearch.service
â elasticsearch.service - Elasticsearch
Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; disabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Wed 2018-05-30 12:42:49 AST; 6min ago
Docs: http://www.elastic.co
Process: 42859 ExecStart=/usr/share/elasticsearch/bin/elasticsearch -p ${PID_DIR}/elasticsearch.pid --quiet (code=exited, status=1/FAILURE)
Main PID: 42859 (code=exited, status=1/FAILURE)

I increase the heap size even though the same situation.
################################################################

You should always set the min and max JVM heap

size to the same value. For example, to set

the heap to 4 GB, set:

-Xms8g
-Xmx8g

See https://www.elastic.co/guide/en/elasticsearch/reference/current/heap-size.html

for more information

################################################################
I also changed the data and log location. I have a mounted volume which I want to use for the data and log.

----------------------------------- Paths ------------------------------------

Path to directory where to store the data (separate multiple locations by comma):

path.data: /u001/elastic/data/elasticsearch

Path to log files:

path.logs: /u001/elastic/log/elasticsearch

@dadoonet
Copy link
Member

@bqayyum better chance to ask on discuss.elastic.co where we can give a better help.

@simonjcarr
Copy link

for me I got the status of the service sudo service elasticsearch status this gave me the amongst other things the command that was run to start elasticsearch. I just ran that command manually at the command line and it gave me the full set of error messages as to why it could not start. In my case I had put the my mysql.jar file in the modules folder and elasticsearch didn't like that.

@sarisam99
Copy link

Solution

[2017-07-01T17:52:12,513][ERROR][o.e.g.GatewayMetaState ] [YPTbq-O] failed to read local state, exiting... org.elasticsearch.ElasticsearchException: java.io.IOException: failed to read [id:0, legacy:false, file:/var/lib/elasticsearch/elasticsearch/nodes/0/indices/jobbole/_state/state-0.st]

Delete the state-0.st fille : sudo rm -rf /var/lib/elasticsearch/elasticsearch/nodes/0/

Worked like charm!!!

@ssaurabh
Copy link

SUPER

@simplenotezy
Copy link

In my case I had to run: sudo rm -rf /var/lib/elasticsearch/* before it would work. I had previously had installed version 7.8, but had to downgrade to 6.5, and then I started facing these issues.

But beware, it might delete any data you have, but in my case, it was a fresh install.

@chernigoff
Copy link

same problem, everything worked after sudo dpkg --configure -a

@adamrzky
Copy link

same problem, everything worked after sudo dpkg --configure -a

thank uuu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests