title: How to create a script that stops Hive service on my cluster?
body: <p>I need to create a script shell that stops the Hive Metastore and HiveServer2 service from any node of cluster and I need to know where Hive services are hosted in my cluster in order to run this command:</p>
  
  <p><code>ssh nodename:ps aux | awk '{print $1,$2}' | grep hive | awk '{print $2}' | xargs kill &gt;/dev/null 2&gt;&amp;1</code></p>
  
  <p>How can I find out which nodes host the Hive services?</p>