title: How to shutdown and start cloudera cluster safely
body: <p>I am using CDH 5.3 on muiltinode cluster and on top of this I have installed Hive, Hbase, Pig and zookeeper. It has total 5 nodes.
  Recently server was shutdown to upgrade number of cores in each node. First all datanodes' services were stopped and later name node services. </p>
  
  <p>Below commands were used to stop all services:</p>
  
  <p><strong>DataNode:</strong></p>
  
  <ol>
  <li>sudo service hbase-regionserver stop</li>
  <li>sudo service hadoop-yarn-nodemanager stop</li>
  <li>sudo service hadoop-hdfs-datanode stop</li>
  </ol>
  
  <p><strong>Name Node:</strong></p>
  
  <ol>
  <li>sudo service  mysql stop</li>
  <li>sudo service  hive-metastore stop</li>
  <li>sudo service  zookeeper-server stop</li>
  <li>sudo service  hbase-master stop</li>
  <li>sudo service  hadoop-yarn-resourcemanager stop</li>
  <li>sudo service hadoop-mapreduce-historyserver stop</li>
  <li>sudo service hadoop-hdfs-namenode stop</li>
  </ol>
  
  <p>While starting this cluster, name node was started first and then all datanodes.
  But when it was started, name node was not coming out of safe mode, even when all datanodes were up. Almost all the files in HDFS were corrupted. Hive metastore and hbase name space was corrupted. Due to this all data got removed from cluster. </p>
  
  <p>Could anyone please give me steps on how to stop all the services and start the cluster back.
  Thanks in advance.</p>