Hadoop hdfs: input/output error when creating user folder

Viewed 9573

I've followed the instructions in Hadoop the definitive guide, 4th edition : Appendix A to configure Hadoop in pseudo-distributed mode. Everything is working good, except for when I try to make a directory :

hadoop fs -mkdir -p /user/$USER

The commande is returning the following message : mkdir: /user/my_user_name': Input/output error.

Although, when I first log into my root account sudo -s and then type the hadoop fs -mkdir -p /user/$USER commande, the directory 'user/root'is created (all directories in the path).

I think I'm having Hadoop permission issues.

Any help would be really appreciated, Thanks.

2 Answers

It means that you have a mistake in the 'core-site.xml' file. For instance, I had an error in the first line (name) in which I wrote 'fa.defaultFS' instead 'fs.defaultFS'.

After that, you have to execute the script 'stop-all.sh' to stop Hadoop. Probably, here, you will have to format the namenode with the commands: 'rm -Rf /app/tmp/your-username/*' and 'hdfs namenode -format'. Next, you have to start Hadoop with the 'start-all.sh' script.

Maybe, you have to reboot the system when you have executed the stop script.

After these steps, I could run that command again.

I Corrected the core-site.xml file based on standard commands and it works fine now.

<property>
        <name>hadoop.tmp.dir</name>
        <value>/home/your_user_name/hadooptmpdata</value>
        <description>Where Hadoop will place all of its working files</description>
    </property>
    <property>
        <name>fs.defaultFS</name>
        <value>hdfs://localhost:9000</value>
        <description>Where HDFS NameNode can be found on the network</description>
</prosperty>
Related