Reputation: 2699
I am not sure if elasticsearch is installed in my Mac. macOS: 10.14 elasticsearch: 5.6
This is what I tried:
Bash Command: elasticsearch
Result: -bash: elasticsearch: command not found
Bash Command: brew search elasticsearch
Result:
==> Formulae elasticsearch [email protected] [email protected]✔
Bash Command: brew services start elasticsearch
Result:
Service `[email protected]` already started, use `brew services restart [email protected]` to restart.
Bash Command: brew services restart [email protected]
Result:
==> Successfully ran `[email protected]` (label: [email protected])
But when I tried to curl http://localhost:9200/ I get curl: (7) Failed to connect to localhost port 9200: Connection refused
My app server throws this error: Faraday::ConnectionFailed (Failed to open TCP connection to localhost:9200 (Connection refused - connect(2) for "localhost" port 9200)):
Even when I reinstalled elasticsearch, I am running into this problem again.
Where am I going wrong?
Upvotes: 4
Views: 4056
Reputation: 2699
In logs I could find 'All shards failed' this error.
Running brew info [email protected]
I got this:
Data: /usr/local/var/elasticsearch/elasticsearch_suryapandian/
Logs: /usr/local/var/log/elasticsearch/elasticsearch_suryapandian.log
Plugins: /usr/local/opt/[email protected]/libexec/plugins/
Config: /usr/local/etc/elasticsearch/
plugin script: /usr/local/opt/[email protected]/libexec/bin/elasticsearch-plugin
After uninstalling elastic search using brew
brew uninstall [email protected]
Manually I checked in all these locations if any of elasticsearch was still present and removed all of it.To make sure that all the old shards gets deleted.
Then I installed elasticsearch again. Now elasticsearch is running smoothly.
Upvotes: 3