工程包含 HDFS 的读写操作示例
首先需要启动 HDFS,启动 HDFS 的命令为 $HADOOP_HOME/sbin/start-dfs.sh。
-
运行写程序
修改运行配置,在 Program arguments 中依次填入
hdfs://localhost:9000/ecnu/hdfs/example.txt和src/main/resources/example/example.txt -
运行读程序
修改运行配置,在 Program arguments 中填入
hdfs://localhost:9000/ecnu/hdfs/example.txt和src/main/resources/example/output.txt