# Failed to start Elasticsearch

**URL:** <https://discuss.elastic.co/t/failed-to-start-elasticsearch/330061>\
**Category:** Elasticsearch\
**Created:** [April 15, 2023, 8:47am UTC](https://discuss.elastic.co/t/failed-to-start-elasticsearch/330061 "2023-04-15T08:47:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hugo\_Demont](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hugo_demont/32/119854_2.png) [@Hugo\_Demont](https://discuss.elastic.co/u/Hugo_Demont)\
**Post date:** [April 15, 2023, 8:47am UTC](https://discuss.elastic.co/t/failed-to-start-elasticsearch/330061/1 "2023-04-15T08:47:33Z")

</div>

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 😕

## 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: [http://www.ubuntu.com/support](http://www.ubuntu.com/support)

## -- 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: [http://www.ubuntu.com/support](http://www.ubuntu.com/support)

## -- 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: [http://www.ubuntu.com/support](http://www.ubuntu.com/support)

-- 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 ! )

---

<div class="post-metadata">

**Author:** ![elasticforme](https://avatars.discourse-cdn.com/v4/letter/e/f05b48/32.png) [@elasticforme](https://discuss.elastic.co/u/elasticforme)\
**Post date:** [April 17, 2023, 1:03pm UTC](https://discuss.elastic.co/t/failed-to-start-elasticsearch/330061/2 "2023-04-17T13:03:10Z")

</div>

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/

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 15, 2023, 1:04pm UTC](https://discuss.elastic.co/t/failed-to-start-elasticsearch/330061/3 "2023-05-15T13:04:10Z")

</div>

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