使用hadoop-mapreduce-examples-2.7.7.jar

时间:2018-11-02 17:59:42

标签: java hadoop hdfs

我有Hadoop

  

hadoop @ nodo1:/ opt / hadoop $ hadoop版本Hadoop 2.7.7 Subversion   未知-r c1aad84bd27cd79c3d1a7dd58202a8c3ee1ed3ac由stevel编译   于2018-07-18T22:47Z编译为protoc 2.5.0   校验和792e15d20b12c74bd6f19a1fb886490使用以下命令运行   /opt/hadoop/share/hadoop/common/hadoop-common-2.7.7.jar

根据课程学习,我使用

/opt/hadoop/share/hadoop/mapreduce/hadoop-mapreduce-examples-2.7.7.jar wordcount 

但是当我运行它时,显示下一个错误:

  

hadoop @ nodo1:/ opt / hadoop $ hadoop jar   /opt/hadoop/share/hadoop/mapreduce/hadoop-mapreduce-examples-2.7.7.jar   字数统计/ libros / output3

     

org.apache.hadoop.mapred.FileAlreadyExistsException:输出目录   hdfs:// nodo1:9000 / output3已经存在           在org.apache.hadoop.mapreduce.lib.output.FileOutputFormat.checkOutputSpecs(FileOutputFormat.java:146)           在org.apache.hadoop.mapreduce.JobSubmitter.checkSpecs(JobSubmitter.java:266)           在org.apache.hadoop.mapreduce.JobSubmitter.submitJobInternal(JobSubmitter.java:139)           在org.apache.hadoop.mapreduce.Job $ 10.run(Job.java:1290)           在org.apache.hadoop.mapreduce.Job $ 10.run(Job.java:1287)           在java.security.AccessController.doPrivileged(本机方法)           在javax.security.auth.Subject.doAs(Subject.java:422)           在org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1762)           在org.apache.hadoop.mapreduce.Job.submit(Job.java:1287)           在org.apache.hadoop.mapreduce.Job.waitForCompletion(Job.java:1308)           在org.apache.hadoop.examples.WordCount.main(WordCount.java:87)           在sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)处           在sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)           在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)           在java.lang.reflect.Method.invoke(Method.java:498)           在org.apache.hadoop.util.ProgramDriver $ ProgramDescription.invoke(ProgramDriver.java:71)           在org.apache.hadoop.util.ProgramDriver.run(ProgramDriver.java:144)           在org.apache.hadoop.examples.ExampleDriver.main(ExampleDriver.java:74)           在sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)处           在sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)           在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)           在java.lang.reflect.Method.invoke(Method.java:498)           在org.apache.hadoop.util.RunJar.run(RunJar.java:226)           在org.apache.hadoop.util.RunJar.main(RunJar.java:141)

在路上我有一本书

  

hadoop @ nodo1:/ opt / hadoop $ hdfs dfs -ls / libros /共找到1条   -rw-r--r-- 1个hadoop超级组2198927 2018-11-02 10:22 /libros/quijote.txt

TNK在您的帮助下

1 个答案:

答案 0 :(得分:1)

首先要做

android:usesCleartextTraffic="true"

如果有文件,

删除,输出目录hdfs dfs -ls /output3

使用不同的文件名

hdfs://nodo1:9000/output3