Unable to start elasticsearch on CentOs

/bin/systemctl status elasticsearch.service
ā— elasticsearch.service - Elasticsearch
Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; enabled; vendo r preset: disabled)
Active: failed (Result: exit-code) since Fri 2021-08-27 21:33:43 IST; 13s ago
Docs: http://www.elastic.co
Process: 6481 ExecStart=/usr/share/elasticsearch/bin/elasticsearch -p ${PID_DI R}/elasticsearch.pid --quiet (code=exited, status=1/FAILURE)
Main PID: 6481 (code=exited, status=1/FAILURE)

/bin/systemctl status elasticsearch.service
ā— elasticsearch.service - Elasticsearch
   Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; enabled; vendo                                                                   r preset: disabled)
   Active: failed (Result: exit-code) since Fri 2021-08-27 21:33:43 IST; 13s ago
     Docs: http://www.elastic.co
  Process: 6481 ExecStart=/usr/share/elasticsearch/bin/elasticsearch -p ${PID_DI                                                                   R}/elasticsearch.pid --quiet (code=exited, status=1/FAILURE)
 Main PID: 6481 (code=exited, status=1/FAILURE)

Getting Error Like This

This Is My elastic Search Confirguration

 vim /etc/elasticsearch/elasticsearch.yml
#bootstrap.memory_lock: true

bootstrap.system_call_filter: false
#
# 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: 74.208.203.170
#
# 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"]
#
discovery.seed_hosts: 74.208.203.170
#
# 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

You need to provide the elasticsearch logs, also look at /var/log/messages for more information about why the service can't start.

It Is Showing me Error Like This

Job for elasticsearch.service failed because the control process exited with error code. S               ee "systemctl status elasticsearch.service" and "journalctl -xe" for details.

You need to look the logs for the elasticsearch service, normally in /var/log/elasticsearch/cluster-name.log, you also need to look at the server logs, normally in /var/log/messages.

Try to start elasticsearch again and check the logs to get more recent information.

Also try to run systemctl status elasticsearch -l to get more verbose logs information.

What is The solution For This

Can You Please Drop Your Email So that I Mail server Credentials

Hi @mirza_muhriz

I think there is some confusion.

This is a community discussion forum, not technical support with support personel.

Everyone on this site is a volunteer, we are not paid support and a thread does not constitue a support ticket.

Also, please do not ever request or send credentials on this site.

If you require dedicated support I suggest you contact sales@elastic.co or below to discuss licensing and support option.

If you want help on this forum I suggest you figure out how to get to your logs

@leandrojmp Suggested one method

Or perhaps you should use the following as shown here

sudo journalctl --unit elasticsearch

FYI : @warkolm

2 Likes

let see elasticsearch.yml

Got this type of Error

 Starting Elasticsearch...
Aug 27 23:21:20 784a2f7.online-server.cloud systemd-entrypoint[20913]: uncaught exception in thread [main]
Aug 27 23:21:20 784a2f7.online-server.cloud systemd-entrypoint[20913]: ElasticsearchException[failed to bind service]; nested: IndexFormatTooNewExceptio
Aug 27 23:21:20 784a2f7.online-server.cloud systemd-entrypoint[20913]: Likely root cause: org.apache.lucene.index.IndexFormatTooNewException: Format ver
Aug 27 23:21:20 784a2f7.online-server.cloud systemd-entrypoint[20913]: at org.apache.lucene.codecs.CodecUtil.checkHeaderNoMagic(CodecUtil.java:216)
Aug 27 23:21:20 784a2f7.online-server.cloud systemd-entrypoint[20913]: at org.apache.lucene.index.SegmentInfos.readCommit(SegmentInfos.java:305)
Aug 27 23:21:20 784a2f7.online-server.cloud systemd-entrypoint[20913]: at org.apache.lucene.index.SegmentInfos.readCommit(SegmentInfos.java:289)
Aug 27 23:21:20 784a2f7.online-server.cloud systemd-entrypoint[20913]: at org.apache.lucene.index.StandardDirectoryReader$1.doBody(StandardDirectoryRead
Aug 27 23:21:20 784a2f7.online-server.cloud systemd-entrypoint[20913]: at org.apache.lucene.index.StandardDirectoryReader$1.doBody(StandardDirectoryRead
Aug 27 23:21:20 784a2f7.online-server.cloud systemd-entrypoint[20913]: at org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:68
Aug 27 23:21:20 784a2f7.online-server.cloud systemd-entrypoint[20913]: at org.apache.lucene.index.StandardDirectoryReader.open(StandardDirectoryReader.j
Aug 27 23:21:20 784a2f7.online-server.cloud systemd-entrypoint[20913]: at org.apache.lucene.index.DirectoryReader.open(DirectoryReader.java:76)
Aug 27 23:21:20 784a2f7.online-server.cloud systemd-entrypoint[20913]: at org.apache.lucene.index.DirectoryReader.open(DirectoryReader.java:64)
Aug 27 23:21:20 784a2f7.online-server.cloud systemd-entrypoint[20913]: at org.elasticsearch.gateway.PersistedClusterStateService.nodeMetadata(PersistedC
Aug 27 23:21:20 784a2f7.online-server.cloud systemd-entrypoint[20913]: at org.elasticsearch.env.NodeEnvironment.loadNodeMetadata(NodeEnvironment.java:40
Aug 27 23:21:20 784a2f7.online-server.cloud systemd-entrypoint[20913]: at org.elasticsearch.env.NodeEnvironment.<init>(NodeEnvironment.java:329)
Aug 27 23:21:20 784a2f7.online-server.cloud systemd-entrypoint[20913]: at org.elasticsearch.node.Node.<init>(Node.java:335)
Aug 27 23:21:20 784a2f7.online-server.cloud systemd-entrypoint[20913]: at org.elasticsearch.node.Node.<init>(Node.java:266)
Aug 27 23:21:20 784a2f7.online-server.cloud systemd-entrypoint[20913]: at org.elasticsearch.bootstrap.Bootstrap$5.<init>(Bootstrap.java:227)
Aug 27 23:21:20 784a2f7.online-server.cloud systemd-entrypoint[20913]: at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:227)
Aug 27 23:21:20 784a2f7.online-server.cloud systemd-entrypoint[20913]: at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:393)
Aug 27 23:21:20 784a2f7.online-server.cloud systemd-entrypoint[20913]: at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:170)
Aug 27 23:21:20 784a2f7.online-server.cloud systemd-entrypoint[20913]: at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:161)
Aug 27 23:21:20 784a2f7.online-server.cloud systemd-entrypoint[20913]: at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.
Aug 27 23:21:20 784a2f7.online-server.cloud systemd-entrypoint[20913]: at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:127)
Aug 27 23:21:20 784a2f7.online-server.cloud systemd-entrypoint[20913]: at org.elasticsearch.cli.Command.main(Command.java:90)
Aug 27 23:21:20 784a2f7.online-server.cloud systemd-entrypoint[20913]: at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:126)
Aug 27 23:21:20 784a2f7.online-server.cloud systemd-entrypoint[20913]: at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92)
Aug 27 23:21:20 784a2f7.online-server.cloud systemd-entrypoint[20913]: For complete error details, refer to the log at /var/log/elasticsearch/elasticsea
Aug 27 23:21:20 784a2f7.online-server.cloud systemd[1]: elasticsearch.service: main process exited, code=exited, status=1/FAILURE
Aug 27 23:21:20 784a2f7.online-server.cloud systemd[1]: Failed to start Elasticsearch.
Aug 27 23:21:20 784a2f7.online-server.cloud systemd[1]: Unit elasticsearch.service entered failed state.
Aug 27 23:21:20 784a2f7.online-server.cloud systemd[1]: elasticsearch.service failed.

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