Failed to start Elasticsearch on centos 7

OS: Centos 7

My installation step of elasticsearch was following the command from the website (Install Elasticsearch with RPM | Elasticsearch Guide [7.5] | Elastic):

> wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.5.1-x86_64.rpm
> wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.5.1-x86_64.rpm.sha512
> shasum -a 512 -c elasticsearch-7.5.1-x86_64.rpm.sha512 
> sudo rpm --install elasticsearch-7.5.1-x86_64.rpm

I also have used the chown command for each relative elasticsearch directory for my current user.

> sudo chown -R myuser:myuser /etc/elasticsearch/
> sudo chown -R myuser:myuser /usr/share/elasticsearch/
> sudo chown -R myuser:myuser /var/log/elasticsearch/
> sudo chown -R myuser:myuser /var/lib/elasticsearch/

When I executed the start command, the system output the error message:

> ● elasticsearch.service - Elasticsearch
>    Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; enabled; vendor preset: disabled)
>    Active: failed (Result: exit-code) since Wed 2020-01-08 14:00:24 CST; 16s ago
>      Docs: http://www.elastic.co
>   Process: 97334 ExecStart=/usr/share/elasticsearch/bin/elasticsearch -p ${PID_DIR}/elasticsearch.pid --quiet (code=exited, status=1/FAILURE)
>  Main PID: 97334 (code=exited, status=1/FAILURE)
> 
> Jan 08 14:00:24 node3 elasticsearch[97334]: at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvi...:214)
> Jan 08 14:00:24 node3 elasticsearch[97334]: at java.nio.file.Files.newByteChannel(Files.java:361)
> Jan 08 14:00:24 node3 elasticsearch[97334]: at java.nio.file.Files.newByteChannel(Files.java:407)
> Jan 08 14:00:24 node3 elasticsearch[97334]: at java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvid...:384)
> Jan 08 14:00:24 node3 elasticsearch[97334]: at java.nio.file.Files.newInputStream(Files.java:152)
> Jan 08 14:00:24 node3 elasticsearch[97334]: at org.elasticsearch.tools.launchers.JvmOptionsParser.main(JvmOptionsPa...a:62)
> Jan 08 14:00:24 node3 systemd[1]: elasticsearch.service: main process exited, code=exited, status=1/FAILURE
> Jan 08 14:00:24 node3 systemd[1]: Failed to start Elasticsearch.
> Jan 08 14:00:24 node3 systemd[1]: Unit elasticsearch.service entered failed state.
> Jan 08 14:00:24 node3 systemd[1]: elasticsearch.service failed.

In my elasticsearch.yml file, I only changed the following configuration:

cluster.name: elasticsearch
node.name: node3
path.data: /usr/data/elasticsearch/data
path.logs: /usr/data/elasticsearch/logs
network.host: node3
http.port: 9200
discovery.seed_hosts: ["node3"]
cluster.initial_master_nodes: ["node-3"]

How to handle "Failed to start Elasticsearch" of my issue?

as you seem to run with systemd, can you use journalctl to extract the log output of Elasticsearch when starting, put it in a pastebin/gist and put the link here. The log contains hopefully the reason why ES did not start.

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