Hadoop hdfs showing ls: `/home/hduser/input/':

2019-02-27 08:58发布

问题:

I have installed Hadoop 2.6 on single machine using This Tutorial. I am using Ubuntu 12.04 machine and Java version 1.6.0_27.

I have created separate user as hduser for Hadoop operations. I have set HADOOP_HOME envrioment variable's value /usr/local/hadoop where I have extracted the Hadoop distribution.

Now I am following an example. But when I execute the command $HADOOP_HOME/bin/hdfs dfs -ls /home/hduser/input/ it gives following error -

15/01/02 18:32:38 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable ls: `/home/hduser/input/': No such file or directory

Also I have tried command- $HADOOP_HOME/bin/hdfs dfs -mkdir /home/hduser/input/ , but still getting same error.

When I run the command jps it shows - 16023 SecondaryNameNode 16200 ResourceManager 16432 NodeManager 18971 Jps 15503 NameNode

It is not showing any process for JobTracker and TaskTracker.

Can anybody please help me to resolve the issue of ls: `/home/hduser/input/': No such file or directory and to start/list the process for JobTracker and TaskTracker.

Thanks in Advance.

回答1:

You are trying to access you local directory using hdfs. Try following steps:

export PATH=$HADOOP_HOME/bin:$PATH ##Make this entry in your ~/.bashrc file
hdfs dfs -mkdir /user
hdfs dfs -mkdir /user/hduser
hdfs dfs -mkdir /user/hduser/input
hdfs dfs -ls /user/hduser/input
echo "Hello World" > file01
hadoop fs -copyFromLocal /user/hduser/input
hadoop fs -cat /user/hduser/input/file01