Reputation: 23
I did fresh setup of hadoop2.9.
To create a directory, I tried:
> hadoop fs -mkdir test
mkdir: 'test': No such file or directory
To list its content, I tried:
> hadoop fs -ls/
not listing directories or files
Please help me to understand the issue.
Upvotes: 2
Views: 7132
Reputation: 15
For listing we can use
hadoop fs -mkdir /
e.g
hadoop fs -mkdir /hadoop/schema/test
For listing if its a file we can access hadoop fs -cat /
e.g
hadoop fs -cat /hadoop/schema/test.txt
Upvotes: 0
Reputation: 191701
Without a fully qualified path, you are required to make a user folder first
hdfs dfs -mkdir -p /user/$(whoami)
hdfs dfs -chown -R $(whoami) /user/$(whoami)
hdfs dfs -chmod -R 750 /user/$(whoami)
Then, the first command will work so will put
and ls
without an otherwise fully qualified path
Upvotes: 0
Reputation: 1360
When you just setup hadoop, HDFS is empty. make some file and directories like below with a full path:
hadoop fs -mkdir /test
Upvotes: 1