Tag Archives: Exception in thread “main” org.apache.hadoop.mapred.FileAlreadyExistsException: Output directory file:/D:/output already exists

[Solved] MapReduce Output PATH error: Exception in thread “main” org.apache.hadoop.mapred.FileAlreadyExistsException: Output directory file:/D:/output already exists

2021-11-06 16:38:56,759 WARN [org.apache.hadoop.metrics2.impl.MetricsConfig] - Cannot locate configuration: tried hadoop-metrics2-jobtracker.properties,hadoop-metrics2.properties
2021-11-06 16:38:56,798 INFO [org.apache.hadoop.metrics2.impl.MetricsSystemImpl] - Scheduled Metric snapshot period at 10 second(s).
2021-11-06 16:38:56,798 INFO [org.apache.hadoop.metrics2.impl.MetricsSystemImpl] - JobTracker metrics system started
Exception in thread "main" org.apache.hadoop.mapred.FileAlreadyExistsException: Output directory file:/D:/output already exists

The key point is the last sentence. The output path cannot exist. The last directory address must not be created.

Solution:

Delete the previously created directory or add a directory address that does not exist in the code