运行时提示错误,当文件已存在时,无法创建该文件。

来源:4-8 词频统计之本地方式运行

慕斯1347104

2020-06-13

已经复制bin的全部文件了,但是还是报错。

`[DEBUG] 2020-06-13 23:34:23,894 method:org.apache.htrace.core.TracerBuilder.loadSamplers(Tracer.java:106)sampler.classes=;loadednosamplers[TRACE]2020−06−1323:34:24,131method:org.apache.htrace.core.TracerId.<init>(TracerId.java:134)ProcessID(fmt=[TRACE]2020−06−1323:34:24,133method:org.apache.htrace.core.TracerPool.addTracer(TracerPool.java:264)TracerPool(Global):addingtracerTracer(FSClient/192.168.50.66)[DEBUG]2020−06−1323:34:24,133method:org.apache.htrace.core.TracerBuilder.loadSamplers(Tracer.java:106) sampler.classes = ; loaded no samplers [TRACE] 2020-06-13 23:34:24,131 method:org.apache.htrace.core.TracerId.<init>(TracerId.java:134) ProcessID(fmt=%{tname}/%{ip}): computed process ID of "FSClient/192.168.50.66" [TRACE] 2020-06-13 23:34:24,133 method:org.apache.htrace.core.TracerPool.addTracer(TracerPool.java:264) TracerPool(Global): adding tracer Tracer(FSClient/192.168.50.66) [DEBUG] 2020-06-13 23:34:24,133 method:org.apache.htrace.core.TracerBuilder.loadSamplers(Tracer.java:106)sampler.classes=;loadednosamplers[TRACE]2020061323:34:24,131method:org.apache.htrace.core.TracerId.<init>(TracerId.java:134)ProcessID(fmt=[TRACE]2020061323:34:24,133method:org.apache.htrace.core.TracerPool.addTracer(TracerPool.java:264)TracerPool(Global):addingtracerTracer(FSClient/192.168.50.66)[DEBUG]2020061323:34:24,133method:org.apache.htrace.core.TracerBuilder.loadSpanReceivers(Tracer.java:128)
span.receiver.classes = ; loaded no span receivers
[TRACE] 2020-06-13 23:34:24,133 method:org.apache.htrace.core.Tracer$Builder.build(Tracer.java:165)
Created Tracer(FSClient/192.168.50.66) for FSClient
[DEBUG] 2020-06-13 23:34:25,263 method:org.apache.hadoop.fs.RawLocalFileSystem.mkOneDirWithMode(RawLocalFileSystem.java:538)
NativeIO.createDirectoryWithMode error, path = \tmp\hadoop\mapred\staging\hadoop45363004.staging\job_local45363004_0001, mode = 755
183: 当文件已存在时,无法创建该文件。

at org.apache.hadoop.io.nativeio.NativeIO$Windows.createDirectoryWithMode0(Native Method)
at org.apache.hadoop.io.nativeio.NativeIO$Windows.createDirectoryWithMode(NativeIO.java:560)
at org.apache.hadoop.fs.RawLocalFileSystem.mkOneDirWithMode(RawLocalFileSystem.java:534)
at org.apache.hadoop.fs.RawLocalFileSystem.mkdirsWithOptionalPermission(RawLocalFileSystem.java:587)
at org.apache.hadoop.fs.RawLocalFileSystem.mkdirs(RawLocalFileSystem.java:559)
at org.apache.hadoop.fs.ChecksumFileSystem.mkdirs(ChecksumFileSystem.java:705)
at org.apache.hadoop.fs.ChecksumFileSystem.create(ChecksumFileSystem.java:456)
at org.apache.hadoop.fs.ChecksumFileSystem.create(ChecksumFileSystem.java:443)
at org.apache.hadoop.fs.FileSystem.create(FileSystem.java:1118)
at org.apache.hadoop.fs.FileSystem.create(FileSystem.java:1098)
at org.apache.hadoop.fs.FileSystem.create(FileSystem.java:987)
at org.apache.hadoop.fs.FileSystem.create(FileSystem.java:975)
at org.apache.hadoop.fs.FileSystem.create(FileSystem.java:652)
at org.apache.hadoop.mapreduce.split.JobSplitWriter.createFile(JobSplitWriter.java:102)
at org.apache.hadoop.mapreduce.split.JobSplitWriter.createSplitFiles(JobSplitWriter.java:78)
at org.apache.hadoop.mapreduce.JobSubmitter.writeNewSplits(JobSubmitter.java:316)
at org.apache.hadoop.mapreduce.JobSubmitter.writeSplits(JobSubmitter.java:327)
at org.apache.hadoop.mapreduce.JobSubmitter.submitJobInternal(JobSubmitter.java:200)
at org.apache.hadoop.mapreduce.Job$11.run(Job.java:1570)
at org.apache.hadoop.mapreduce.Job$11.run(Job.java:1567)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:422)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1730)
at org.apache.hadoop.mapreduce.Job.submit(Job.java:1567)
at org.apache.hadoop.mapreduce.Job.waitForCompletion(Job.java:1588)
at com.xinke.bigdata.hadoop.mr.wc.WordCountApp.main(WordCountApp.java:50)

[DEBUG] 2020-06-13 23:34:25,266 method:org.apache.hadoop.fs.RawLocalFileSystem.mkOneDirWithMode(RawLocalFileSystem.java:538)
NativeIO.createDirectoryWithMode error, path = \tmp\hadoop\mapred\staging\hadoop45363004.staging\job_local45363004_0001, mode = 755
183: 当文件已存在时,无法创建该文件。`

写回答

1回答

Michael_PK

2020-06-13

org.apache.hadoop.io.nativeio.NativeIO$Windows.createDirectoryWithMode0(Native Method)这个错,你应该是win机器把?需要按照QQ群文件的那个图片中的步骤,把那个winutil的东西根据你的版本到github上找到,下载到win机器的指定目录,并把这个目录添加到win的环境变量中。要配置正确才行,不然一直是这个错。如果你闲这个方法太麻烦,可以直接在Linux上部署一个idea进行开发,就不会有这个错。win机器和hadoop的兼容性不是太好

0
3
慕斯1347104
回复
Michael_PK
我在pom添加了一个hadoop-mapreduce-client-core依赖好像可以了
2020-06-14
共3条回复

Hadoop 系统入门+核心精讲

从Hadoop核心技术入手,掌握数据处理中ETL应用,轻松进军大数据

2397 学习 · 902 问题

查看课程