Hadoop running wordcount in stand-alone mode has no output result

after the stand-alone hadoop, running wordcount was deployed on the unbuntu16.04 virtual machine, the output folder was not created successfully.

Environment

hadoop2.9.1
java openJDK7

Show map100% reduce0%

the error message is as follows

java.lang.Exception: java.io.IOException: Mkdirs failed to create file:/opt/hadoop-2.9.1/optput2/_temporary/0/_temporary/attempt_local1079342681_0001_r_000000_0 (exists=false, cwd=file:/opt/hadoop-2.9.1)
    at org.apache.hadoop.mapred.LocalJobRunner$Job.runTasks(LocalJobRunner.java:491)
    at org.apache.hadoop.mapred.LocalJobRunner$Job.run(LocalJobRunner.java:558)
Caused by: java.io.IOException: Mkdirs failed to create file:/opt/hadoop-2.9.1/optput2/_temporary/0/_temporary/attempt_local1079342681_0001_r_000000_0 (exists=false, cwd=file:/opt/hadoop-2.9.1)

should have been read, but no output

File Input Format Counters 
        Bytes Read=71
    File Output Format Counters 
        Bytes Written=0

want to know why the output folder was not created successfully?

Aug.25,2021

read stack overflow's answer
Hadoop java.io.IOException: Mkdirs failed to create / some/path

it should be that the output path is not in HDFS, and I don't have permission to create a directory in this path. After a try, mkdir, really can't be created. So I changed the output location to a place with permission. But I don't know if it's the right thing to do? Should the current path be added to the HDFS? How do I add it? Or should the permissions of the current path be modified?

if a great god sees the answer, I would appreciate it.

= update =
it is true that the creation of the output directory was not successful because of permissions. Some tutorials on the Internet use root permissions or new users give them permission.
solution:
assign permissions to the current path
or
change the output to a place with permission

as to how to add to HDFS is the next step, stand-alone version does not need this.

Menu