Now the cluster is working fine.

We can use start-dfs.sh and start-yarn.sh scripts for setting up the cluster.