上一篇我们已经搭建好hadoop集群,之后我们可以访问2个地址
我们在hadoop102上创建文件
[root@hadoop102 hadoop-3.1.3]# hadoop fs -mkdir /wcinput
上传文件
[root@hadoop102 hadoop-3.1.3]# hadoop fs -put wcinput/word.txt /wcinput
2022-10-15 14:42:26,228 INFO sasl.SaslDataTransferClient: SASL encryption trust check: localHostTrusted = false, remoteHostTrusted = false
[root@hadoop102 hadoop-3.1.3]#
[root@hadoop102 hadoop-3.1.3]# hadoop fs -put /opt/software/jdk-8u251-linux-x64.tar.gz /
2022-10-15 14:45:04,690 INFO sasl.SaslDataTransferClient: SASL encryption trust check: localHostTrusted = false, remoteHostTrusted = false
2022-10-15 14:45:07,333 INFO sasl.SaslDataTransferClient: SASL encryption trust check: localHostTrusted = false, remoteHostTrusted = false
[root@hadoop102 hadoop-3.1.3]#
[root@hadoop102 hadoop-3.1.3]# hadoop fs -mkdir /input
[root@hadoop102 hadoop-3.1.3]# hadoop jar share/hadoop/mapreduce/hadoop-mapreduce-examples-3.1.3.jar wordcount /input /output
如果不小心杀死进程的话,需要删除data和log文件夹,每台机器都要运行,先停止再删除