DEV Community

Lisa Sy (she/her)
Lisa Sy (she/her)

Posted on

Debugging my installation of Elasticsearch

Frustration

Yesterday, I was running into much frustration installing Elasticsearch on my Mac machine. After a lot of Googling, I patchworked a solution that worked for and want to share it with you.

After installing Elasticsearch with Homebrew and running elasticsearch, I ran into this issue:

org.elasticsearch.bootstrap.StartupException: java.lang.IllegalStateException: Unable to access 'path.data' (/usr/local/var/lib/elasticsearch)
Enter fullscreen mode Exit fullscreen mode

Hmm. I googled this line and found that others encountered a similar issue. When I attempted to locate this folder, it did not exist, so I learned that I needed to 1) create it and 2) give myself permission to write into it. I did this by running these two commands:

sudo mkdir /usr/local/var/lib/elasticsearch/
chmod -R $USER /usr/local/var/lib/elasticsearch
Enter fullscreen mode Exit fullscreen mode

After attempting to run elastic search this next time, it worked!

elasticsearch
Enter fullscreen mode Exit fullscreen mode

Phew, that worked! I was happy to resume the work I'd been doing. I hope this is helpful to anyone who is experiencing the same issue I had.

Happy

Other links I tried

Discussion (3)

Collapse
buinauskas profile image
Evaldas Buinauskas • Edited on

I'd suggest using Docker to spin up Elasticsearch locally. You'll be able to create and recreate cluster easily without impacting or trashing rest of the system. 🙂

Collapse
lisasy profile image
Lisa Sy (she/her) Author

Ooo super helpful. I'll look into this. Thanks a bunch!

Collapse
jalorenci profile image
Jasmine Florencio

Thank you for posting! I had the same error and your fix worked for me too.