Sqoop MySQL 8 迁移Hadoop 3 提示:master:9000/sqoop/base-house already exists
Posted 在奋斗的大道
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Sqoop MySQL 8 迁移Hadoop 3 提示:master:9000/sqoop/base-house already exists相关的知识,希望对你有一定的参考价值。
今天尝试使用Sqoop 将mysql 8 指定库表数据 迁移至Hadoop 3 提示如下错误:
2023-03-01 14:52:20,547 ERROR tool.ImportTool: Import failed: org.apache.hadoop.mapred.FileAlreadyExistsException: Output directory hdfs://Hadoop3-master:9000/sqoop/base-house already exists
at org.apache.hadoop.mapreduce.lib.output.FileOutputFormat.checkOutputSpecs(FileOutputFormat.java:164)
at org.apache.hadoop.mapreduce.JobSubmitter.checkSpecs(JobSubmitter.java:277)
at org.apache.hadoop.mapreduce.JobSubmitter.submitJobInternal(JobSubmitter.java:143)
at org.apache.hadoop.mapreduce.Job$11.run(Job.java:1565)
at org.apache.hadoop.mapreduce.Job$11.run(Job.java:1562)
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:1762)
at org.apache.hadoop.mapreduce.Job.submit(Job.java:1562)
at org.apache.hadoop.mapreduce.Job.waitForCompletion(Job.java:1583)
at org.apache.sqoop.mapreduce.ImportJobBase.doSubmitJob(ImportJobBase.java:200)
at org.apache.sqoop.mapreduce.ImportJobBase.runJob(ImportJobBase.java:173)
at org.apache.sqoop.mapreduce.ImportJobBase.runImport(ImportJobBase.java:270)
at org.apache.sqoop.manager.SqlManager.importTable(SqlManager.java:692)
at org.apache.sqoop.manager.MySQLManager.importTable(MySQLManager.java:127)
at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:520)
at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:628)
at org.apache.sqoop.Sqoop.run(Sqoop.java:147)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:76)
at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:183)
at org.apache.sqoop.Sqoop.runTool(Sqoop.java:234)
at org.apache.sqoop.Sqoop.runTool(Sqoop.java:243)
at org.apache.sqoop.Sqoop.main(Sqoop.java:252)
造成此问题原因:Hadoop 文件服务器已经存在相关文件夹。
解决办法:Hadoop删除报错指定文件夹。
# hadoop 移除指定文件夹
[root@Hadoop3-master bin]# hadoop fs -rmdir /sqoop/base-house
# hadoop 查看指定文件夹
[root@Hadoop3-master bin]# hadoop fs -ls -R /sqoop
以上是关于Sqoop MySQL 8 迁移Hadoop 3 提示:master:9000/sqoop/base-house already exists的主要内容,如果未能解决你的问题,请参考以下文章
Sqoop MySQL 8 数据迁移至Hadoop 3 提示:ClassNotFoundException: Class base_house not found