Unable to start elasticsearch on CentOs

initially elastic search was working but due to some update its stop working and giving such error message while checking status.

systemctl status elasticsearch.service
ā— elasticsearch.service - Elasticsearch
   Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Thu 2016-10-27 11:26:43 PKT; 21min ago
     Docs: http://www.elastic.co
  Process: 10038 ExecStart=/usr/share/elasticsearch/bin/elasticsearch -Des.pidfile=${PID_DIR}/elasticsearch.pid -Des.default.path.home=${ES_HOME} -Des.default.path.logs=${LOG_DIR} -Des.default.path.data=${DATA_DIR} -Des.default.path.conf=${CONF_DIR} (code=exited, status=1/FAILURE)
  Process: 10032 ExecStartPre=/usr/share/elasticsearch/bin/elasticsearch-systemd-pre-exec (code=exited, status=0/SUCCESS)
 Main PID: 10038 (code=exited, status=1/FAILURE)

Oct 27 11:26:43 ELK-*** elasticsearch[10038]: #
Oct 27 11:26:43 ELK-UMIR elasticsearch[10038]: # Block initial recovery after a full cluster restart until N nodes are started:
Oct 27 11:26:43 ELK-UMIR elasticsearch[10038]: #
Oct 27 11:26:43 ELK-UMIR elasticsearch[10038]: # gateway.recover_after_nodes: 3
Oct 27 11:26:43 ELK-UMIR elasticsearch[10038]: #
Oct 27 11:26:43 ELK-UMIR elasticsearch[10038]: # For more information, see the documentation at:
Oct 27 11:26:43 ELK-UMIR elasticsearch[10038]: # <http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-gateway.html>
Oct 27 11:26:43 ELK-UMIR systemd[1]: elasticsearch.service: main process exited, code=exited, status=1/FAILURE
Oct 27 11:26:43 ELK-UMIR systemd[1]: Unit elasticsearch.service entered failed state.
Oct 27 11:26:43 ELK-UMIR systemd[1]: elasticsearch.service failed.
2 Likes

Hi, can you provide the end of the Elasticsearch log ?

Something like :
tail -f /var/log/elasticsearch/your_cluster_name.log

on tail -f /var/log/elasticsearch/elasticsearch.log

 java.lang.IllegalArgumentException: invalid port range: localhost
            at java.net.SocketPermission.init(SocketPermission.java:436)
            at java.net.SocketPermission.<init>(SocketPermission.java:291)
            at org.elasticsearch.bootstrap.Security.addBindPermissions(Security.java:277)
            at org.elasticsearch.bootstrap.Security.createPermissions(Security.java:213)
            at org.elasticsearch.bootstrap.Security.configure(Security.java:118)
            at org.elasticsearch.bootstrap.Bootstrap.setupSecurity(Bootstrap.java:212)
            at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:183)
            at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:286)
            at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:35)

I seems that there is something wrong in your configuration file, lool at /etc/elasticsearch/elasticsearch.yml

check transport.tcp.port or http.port

elasticsearch.yml

I try to do some settings for nginx from then it's stop working btw

localhost is not a valid port number for the http.port setting. Comment this out to use the default 9200 port.

Your error :
http.port = localhost

set:
http.port: 9200

1 Like

Thanks! its working now.