FileAlreadyExistsException: Output directory hdfs://ubuntu:9000/output09 already exists

本文介绍了一个常见的Hadoop错误——输出目录已存在,并提供了两种解决方案:一是删除已存在的目录;二是创建一个新的目录。
14/07/21 17:49:59 ERROR security.UserGroupInformation: PriviledgedActionException as:chenlongquan cause:org.apache.hadoop.mapred.FileAlreadyExistsException: Output directory hdfs://ubuntu:9000/output09 already exists
Exception in thread "main" org.apache.hadoop.mapred.FileAlreadyExistsException: Output directory hdfs://ubuntu:9000/output09 already exists
        at org.apache.hadoop.mapreduce.lib.output.FileOutputFormat.checkOutputSpecs(FileOutputFormat.java:137)
        at org.apache.hadoop.mapred.JobClient$2.run(JobClient.java:973)
        at org.apache.hadoop.mapred.JobClient$2.run(JobClient.java:936)
        at java.security.AccessController.doPrivileged(Native Method)
        at javax.security.auth.Subject.doAs(Subject.java:415)
        at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1190)
        at org.apache.hadoop.mapred.JobClient.submitJobInternal(JobClient.java:936)
        at org.apache.hadoop.mapreduce.Job.submit(Job.java:550)
        at org.apache.hadoop.mapreduce.Job.waitForCompletion(Job.java:580)
        at com.pzoom.mapred.WordCount.main(WordCount.java:41)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.apache.hadoop.util.RunJar.main(RunJar.java:160)
这个错误的大致意思是你所要上传的目录已经存在,在hadoop中仅仅能对文件进行一次上传。不能反复。你要想继续上传,解决方式:1:删除已经存在的目录。2:又一次创建一个目录。
root@educoder:~# mysql -uroot -p123123 -h127.0.0.1 mysql: [Warning] Using a password on the command line interface can be insecure. Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 37 Server version: 5.5.59-0ubuntu0.14.04.1 (Ubuntu) Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> CREATE DATABASE hdfsdb DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; Query OK, 1 row affected (0.00 sec) mysql> USE hdfsdb; Database changed mysql> CREATE TABLE student ( -> stu_no INT PRIMARY KEY, -> stu_name VARCHAR(20), -> stu_age INT -> ); Query OK, 0 rows affected (0.00 sec) mysql> INSERT INTO student (stu_no, stu_name, stu_age) VALUES -> (202001, 'zhangsan', 18), -> (202002, 'lisi', 19), -> (202003, 'wangwu', 20); Query OK, 3 rows affected (0.00 sec) Records: 3 Duplicates: 0 Warnings: 0 mysql> SELECT * FROM student; +--------+----------+---------+ | stu_no | stu_name | stu_age | +--------+----------+---------+ | 202001 | zhangsan | 18 | | 202002 | lisi | 19 | | 202003 | wangwu | 20 | +--------+----------+---------+ 3 rows in set (0.00 sec) mysql> exit Bye root@educoder:~# sqoop import --connect jdbc:mysql://127.0.0.1:3306/hdfsdb --username root --password 123123 --table student; 25/03/28 11:17:03 INFO sqoop.Sqoop: Running Sqoop version: 1.4.7 25/03/28 11:17:04 WARN tool.BaseSqoopTool: Setting your password on the command-line is insecure. Consider using -P instead. 25/03/28 11:17:04 INFO manager.MySQLManager: Preparing to use a MySQL streaming resultset. 25/03/28 11:17:04 INFO tool.CodeGenTool: Beginning code generation 25/03/28 11:17:04 INFO manager.SqlManager: Executing SQL statement: SELECT t.* FROM `student` AS t LIMIT 1 2
最新发布
03-29
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值