1、首先从https://github.com/steveloughran/winutils中下载winutils,这个是编译hadoopwindow版本,可以使用:git clone https://github.com/steveloughran/winutils 或者从
链接:https://pan.baidu.com/s/1Az-BPugE0cIDOrh51JL7rA
提取码:9q8i
进行下载,如下图所示:
2、然后从集群上拷贝一个hadoop目录。
3、将winutils的对应版本的bin目录覆盖到拷贝过来的bin目录中,如下图所示:
4、首先加入HADOOP_HOME目录,如下图所示:
5、然后将其中的bin目录添加到环境变量中,如下图所示:
6、然后打开dos窗口执行:hadoop fs -ls hdfs://master:9000/,如下图所示:
注意:hdfs://master:9000/我是搭建在虚拟机里的,master已经加入到hosts中了。