Please make the following change as given below.
1) Login as root
2) Enter the given command to edit sudoers file:
3) Change the following as per screen-shot and to save the change press Esc >> Shift:wq
Step 2 : Format the namenode
hadoop namenode -format
Step 3 : Delete data directory mentioned in hdfs-site.xml
rm -rf directory_path
Step 4 : Again re-create the data directory and give chmod 755 permission to all the data directory
chmod 755 directory_path
Please let me know if you have any further issue regarding this.