We sorted this problem. Basically we have to manually install Ambari-agent. We followed the steps explained in the following link:
http://docs.hortonworks.com/HDPDocuments/Ambari-2.1.0.0/bk_ambari_troubleshooting/content/_resolving_cluster_deployment_problems.html
But we also faced problem with the THP. Explained in the same page 4.9. But the resolution that is given there is not right. We are using CentOS 6.x.
# The followinglines are added because above
# commands explained at HW 4.9 to disable THP are not working.. – MKT
echo never > /sys/kernel/mm/redhat_transparent_hugepage/enabled
echo never > /sys/kernel/mm/redhat_transparent_hugepage/defrag