title: Brew shows elasticsearch server is running, but request to elasticsearch server keeps failing
body: <p>I am not sure if elasticsearch is installed in my Mac.
  macOS: 10.14
  elasticsearch: 5.6</p>
  
  <p>This is what I tried:</p>
  
  <ol>
  <li><p><strong>Bash Command:</strong> <code>elasticsearch</code></p>
  
  <p><strong>Result:</strong> <code>-bash: elasticsearch: command not found</code></p></li>
  <li><p><strong>Bash Command:</strong> <code>brew search elasticsearch</code></p>
  
  <p><strong>Result:</strong>
  <code>==&gt; Formulae elasticsearch    elasticsearch@2.4   elasticsearch@5.6✔</code></p></li>
  <li><p><strong>Bash Command:</strong>  <code>brew services start elasticsearch</code></p>
  
  <p><strong>Result:</strong></p>
  
  <pre><code>Service `elasticsearch@5.6` already started, use `brew services restart elasticsearch@5.6` to restart.
  </code></pre></li>
  <li><p><strong>Bash Command:</strong> <code>brew services restart elasticsearch@5.6</code></p>
  
  <p><strong>Result:</strong></p>
  
  <pre><code>==&gt; Successfully ran `elasticsearch@5.6` (label: homebrew.mxcl.elasticsearch@5.6)
  </code></pre></li>
  </ol>
  
  <p>But when I tried to curl <a href="http://localhost:9200/" rel="nofollow noreferrer">http://localhost:9200/</a>
  I get <em>curl: (7) Failed to connect to localhost port 9200: Connection refused</em></p>
  
  <p>My app server throws this error:
  <em>Faraday::ConnectionFailed (Failed to open TCP connection to localhost:9200 (Connection refused - connect(2) for "localhost" port 9200)):</em></p>
  
  <p>Even when I reinstalled elasticsearch, I am running into this problem again.</p>
  
  <p><strong>Where am I going wrong?</strong></p>