Did you try manually leaving Namenode from command line.
Run below command at the time you start your namenode:
sudo su - hdfs hdfs dfsadmin -safemode leave
Again this is not the best practice but helps your namenode come back.
Thank you @Sridhar Reddy.......I followed these commands but I got connection refused error,I tried changing the permission of hadoop folder to 777 temporarily,now i could able to start the applications.