为什么启动hadoop后在hdfs上系统里创建input的文件夹的命令没有用 命令为hadoop

2024-12-25 22:19:15
推荐回答(2个)
回答1:

首先hadoop2以后 命令有所变化 启动hdfs服务后
建立文件夹应该使用dfs
例如 hdfs dfs -mkdir /filename
其次需要在文件前加 / 代表建立在根目录,也可以加其他目录 ,比如 、/usr/local/

不加 / 会报错

回答2:

mkdir

Usage: hadoop fs -mkdir [-p]

Takes path uri’s as argument and creates directories.

Options:

The -p option behavior is much like Unix mkdir -p, creating parent directories along the path.
Example:

hadoop fs -mkdir /user/hadoop/dir1 /user/hadoop/dir2
hadoop fs -mkdir hdfs://nn1.example.com/user/hadoop/dir hdfs://nn2.example.com/user/hadoop/dir
Exit Code:

Returns 0 on success and -1 on error.