title: How to restart Elasticsearch cluster
body: <p>Hello all actually this question is very old and wherever i have read i have found two solutions one is to use <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-nodes-shutdown.html" rel="nofollow">shutdown api</a> which is now deprecated so i am wondering how to do it now, the second solution i found was to use below command </p>
  
  <blockquote>
    <p>sudo service elasticsearch restart</p>
  </blockquote>
  
  <p>which i did use but above command is not starting all of my nodes. I have 3 nodes i ran above command on my first node and it restarted but i tried the same command on my other two nodes but then when i tried to connect to my elasticsearch then i got below error.</p>
  
  <blockquote>
    <p>Failed to connect to localhost port 9200: Connection refused</p>
  </blockquote>
  
  <p>Now can anyone please tell me why i am getting above connection refused error i have also set </p>
  
  <blockquote>
    <p>network.host: 0.0.0.0</p>
  </blockquote>
  
  <p>in my elasticsearch.yml file, also as <strong>shutdown api</strong> is deprecated what can be the proper way of restarting an elastic cluster.</p>
  
  <p>Please help me wherever i go i find only these two things and they are not working for me.</p>