Hadoop installation: Namenode cannot be started
This problem arise when mistaken I specified wrong path for namenode and datanode in hdfs-site.xml and tmp dir path in core-site.xml,Path should be well formatted, for example-
<property> <name>dfs.namenode.edits.dir</name> <value>file:///home/hadoop/hadoop-content/hdfs/namenode</value></property><property> <name>dfs.datanode.data.dir</name> <value>file:///home/hadoop/hadoop-content/hdfs/datanode</value></property>
and for temp dir in core-site.xml it is like -
<configuration><property> <name>fs.defaultFS</name> <value>hdfs://localhost:9000</value></property><property> <name>hadoop.tmp.dir</name> <value>/home/hadoop/hadoop-content/tmp</value></property>
sometimes we make mistake in specifying - file:///
In /etc/hosts
:
1. Add this line:
your-ip-address your-host-name
example: 192.168.1.8 master
In /etc/hosts
:
2. Delete the line with 127.0.1.1
(This will cause loopback)
3. In your core-site, change localhost
to your-ip
or your-hostname
Now, restart the cluster.