【MapReduce】jar包集群运行:FileAlreadyExistsException: Output directory ..... already exists

Error: FileAlreadyExistsException: Output directory FileAlreadyExistsException: Output directory file:/home/data/mapReduce/data already exists
Insert picture description here
As shown in the figure above, when the jar package is running, an error is reported in the form of parameter passing, saying that the output path already exists! ? However, if you observe carefully, you will find that the existing path mentioned by the system is actually the input path of the resource file, that is to say, it is misplaced when the parameters are obtained, and it is suspected that a parameter has been shifted to the left.
Insert picture description here
So its program was modified,Move the parameter array element to the right by one, starting from 1, Run again: the
Insert picture description here
result is output normally!
Insert picture description here
giao~
Refer to the blog post of the big guy: https://blog.csdn.net/Scorpius8928/article/details/36875583?ops_request_misc=&request_id=&biz_id=102&utm_term=jar%E5%8C%85hadoop%E9%9B%86%E7% BE%A4%E8%BF%90%E8%A1%8C%E8%B7%AF%E5%BE%84%E4%BB%A5%E5%8F%82%E6%95%B0%E5%BD% A2%E5%BC%8F&utm_medium=distribute.pc_search_result.none-task-blog-2 all sobaiduweb~default-1-36875583.first_rank_v2_pc_rank_v29

Insert picture description here
Here I think it can be understood that the configuration of loading the main class when running the jar package is a parameter by default args[0], so when you write the parameters later, you have to start from 1~

Verify the narrative of the boss (the content of the red box in the picture,Note: The main loading class will only be specified when the packaging method is ②):
Insert picture description here
Insert picture description here


Guess you like

Origin blog.csdn.net/qq_45797116/article/details/114969383