I ran namenode -format.This is my output. I tried changing the file permissions chmod 777 hadoop.
I believe this line is the error ERROR namenode.NameNode: java.io
Following steps resolved my problem -
1- sudo su
Enter your password.
2-/usr/local/hadoop/bin/hdfs namenode -format.
This has been done for hadoop2.5 in which "hadoop namenode -format" has beendeprecated hence using "hdfs namenode -format"
try with sudo (I realize you changed permissions) but I would still try sudo and check if that resolves the problem.
Check hdfs-site.xml configuration, it may has a wrong path for properties dfs.namenode.name.dir and dfs.datanode.data.dir In my case it was the cause of the problem (directory was situated in other then current user's home folder).
This is a permissions issue. Either you can use 1. sudo 2. login as root
But the best solution is
sudo chown $HADOOP_HOME
hadoop namenode -format
Where HADOOP_HOME is your hadoop installation directory
sudo is broken in this situation, but pkexec
(the command-line frontend to PolicyKit) still works, so you can fix it with a single command. No rebooting is necessary.
pkexec chmod 0440 /etc/sudoers
This assumes PolicyKit
is installed. If this is a desktop system (rather than a server with no GUI), it is.