0
votes

What is the right configuration of hdfs-site.xml file while configuring Hadoop. On all the websites I see this :

<property>
<name>dfs.replication</name>
<value>1</value>
</property>
<property>
<name>dfs.namenode.name.dir</name>
<value>file:/usr/local/hadoop_store/hdfs/namenode</value>
</property>
<property>
<name>dfs.datanode.data.dir</name>
<value>file:/usr/local/hadoop_store/hdfs/datanode</value>
</property>    

I used the same configuration but was unable to start the datanode. later I changed the configuration of datanode to

<name>dfs.datanode.name.dir</name>

instead of

<name>dfs.datanode.data.dir</name>

and it worked. which one is right name.dir or data.dir?

because all the websites say the data.dir but that does not work in my case. Thanks guys.

1
remove the **'s. They don't bold string inside a codeblock !blackSmith

1 Answers

0
votes

The options are dfs.namenode.name.dir and dfs.datanode.data.dir. The first defines the directory where namenode information will be held. Second defines where datanode information will be held.

If the node is a namenode, you need the namenode folder configuration. If it's a datanode, you need the datanode folder configuration. If it's a single-node cluster, you need both, as the node acts as both namenode and datanode.

If that doesn't work, what is the error message you get? Have you formatted the namenode?