Failed to start Elasticsearch

Hello ! I'm try to run elasticsearch on my linux computer to download Magento 2

when I try sudo systemctl start elasticsearch I get an error and I dont know how to solve it :confused:

Error : `avril 15 10:34:55 demont-MS-7B38 systemd-entrypoint[73662]: at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
avril 15 10:34:55 demont-MS-7B38 systemd-entrypoint[73662]: at java.base/sun.nio.fs.UnixFileSystemProvider.createDirectory(UnixFileSystemProvider.java:397)
avril 15 10:34:55 demont-MS-7B38 systemd-entrypoint[73662]: at java.base/java.nio.file.Files.createDirectory(Files.java:700)
avril 15 10:34:55 demont-MS-7B38 systemd-entrypoint[73662]: at java.base/java.nio.file.Files.createAndCheckIsDirectory(Files.java:807)
avril 15 10:34:55 demont-MS-7B38 systemd-entrypoint[73662]: at java.base/java.nio.file.Files.createDirectories(Files.java:793)
avril 15 10:34:55 demont-MS-7B38 systemd-entrypoint[73662]: at org.elasticsearch.bootstrap.Security.ensureDirectoryExists(Security.java:318)
avril 15 10:34:55 demont-MS-7B38 systemd-entrypoint[73662]: at org.elasticsearch.bootstrap.FilePermissionUtils.addDirectoryPath(FilePermissionUtils.java:64)
avril 15 10:34:55 demont-MS-7B38 systemd-entrypoint[73662]: at org.elasticsearch.bootstrap.Security.addFilePermissions(Security.java:214)
avril 15 10:34:55 demont-MS-7B38 systemd-entrypoint[73662]: at org.elasticsearch.bootstrap.Security.createPermissions(Security.java:168)
avril 15 10:34:55 demont-MS-7B38 systemd-entrypoint[73662]: at org.elasticsearch.bootstrap.Security.configure(Security.java:115)
avril 15 10:34:55 demont-MS-7B38 systemd-entrypoint[73662]: at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:229)
avril 15 10:34:55 demont-MS-7B38 systemd-entrypoint[73662]: at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:434)
avril 15 10:34:55 demont-MS-7B38 systemd-entrypoint[73662]: at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:169)
avril 15 10:34:55 demont-MS-7B38 systemd-entrypoint[73662]: at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:160)
avril 15 10:34:55 demont-MS-7B38 systemd-entrypoint[73662]: at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:77)
avril 15 10:34:55 demont-MS-7B38 systemd-entrypoint[73662]: at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:112)
avril 15 10:34:55 demont-MS-7B38 systemd-entrypoint[73662]: at org.elasticsearch.cli.Command.main(Command.java:77)
avril 15 10:34:55 demont-MS-7B38 systemd-entrypoint[73662]: at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:125)
avril 15 10:34:55 demont-MS-7B38 systemd-entrypoint[73662]: at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:80)
avril 15 10:34:55 demont-MS-7B38 systemd-entrypoint[73662]: For complete error details, refer to the log at /usr/share/elasticsearch/logs/elasticsearch.log
avril 15 10:34:55 demont-MS-7B38 systemd[1]: elasticsearch.service: Main process exited, code=exited, status=1/FAILURE
-- Subject: Unit process exited
-- Defined-By: systemd
-- Support: Enterprise open source support | Ubuntu

-- An ExecStart= process belonging to unit elasticsearch.service has exited.

-- The process' exit code is 'exited' and its exit status is 1.
avril 15 10:34:55 demont-MS-7B38 systemd[1]: elasticsearch.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: Enterprise open source support | Ubuntu

-- The unit elasticsearch.service has entered the 'failed' state with result 'exit-code'.
avril 15 10:34:55 demont-MS-7B38 systemd[1]: Failed to start Elasticsearch.
-- Subject: L'unité (unit) elasticsearch.service a échoué
-- Defined-By: systemd
-- Support: Enterprise open source support | Ubuntu

-- L'unité (unit) elasticsearch.service a échoué, avec le résultat failed.
avril 15 10:34:55 demont-MS-7B38 sudo[73659]: pam_unix(sudo:session): session closed for user root
avril 15 10:35:12 demont-MS-7B38 rtkit-daemon[1101]: Supervising 6 threads of 3 processes of 1 users.
avril 15 10:35:12 demont-MS-7B38 rtkit-daemon[1101]: Supervising 6 threads of 3 processes of 1 users.
`

and I just modify this file : /etc/elasticsearch/elasticsearch.yml
with `# ---------------------------------- Network -----------------------------------

Set the bind address to a specific IP (IPv4 or IPv6):

network.host: localhost

Set a custom port for HTTP:

http.port: 9200
`

Thank you for your possible help (And sorry I'm French student so my english is not good ! )

what is your elasticsearch.yml file looks like?
do you have any log in /var/log/elasticsearch/ ?

or may be at /usr/share/elasticsearch/logs/

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