1、当时初学Sqoop的时候,mysql导入到hdfs导入命令执行以后,在hdfs上面没有找到对应的数据,今天根据这个bug,顺便解决这个问题吧,之前写的http://www.cnblogs.com/biehongli/p/8039128.html

 1 [hadoop@slaver1 sqoop-1.4.5-cdh5.3.6]$ bin/sqoop import \
2 > --connect jdbc:mysql://slaver1:3306/test \
3 > --username root \
4 > --password 123456 \
5 > --table tb_user \
6 > --m 1
7 Warning: /home/hadoop/soft/sqoop-1.4.5-cdh5.3.6/../hcatalog does not exist! HCatalog jobs will fail.
8 Please set $HCAT_HOME to the root of your HCatalog installation.
9 Warning: /home/hadoop/soft/sqoop-1.4.5-cdh5.3.6/../accumulo does not exist! Accumulo imports will fail.
10 Please set $ACCUMULO_HOME to the root of your Accumulo installation.
11 18/05/18 19:32:51 INFO sqoop.Sqoop: Running Sqoop version: 1.4.5-cdh5.3.6
12 18/05/18 19:32:51 WARN tool.BaseSqoopTool: Setting your password on the command-line is insecure. Consider using -P instead.
13 18/05/18 19:32:51 INFO manager.MySQLManager: Preparing to use a MySQL streaming resultset.
14 18/05/18 19:32:51 INFO tool.CodeGenTool: Beginning code generation
15 18/05/18 19:32:52 INFO manager.SqlManager: Executing SQL statement: SELECT t.* FROM `tb_user` AS t LIMIT 1
16 18/05/18 19:32:52 INFO manager.SqlManager: Executing SQL statement: SELECT t.* FROM `tb_user` AS t LIMIT 1
17 18/05/18 19:32:52 INFO orm.CompilationManager: HADOOP_MAPRED_HOME is /home/hadoop/soft/hadoop-2.5.0-cdh5.3.6
18 Note: /tmp/sqoop-hadoop/compile/cb147e9deb144db0034d6f38cb47ad68/tb_user.java uses or overrides a deprecated API.
19 Note: Recompile with -Xlint:deprecation for details.
20 18/05/18 19:33:03 INFO orm.CompilationManager: Writing jar file: /tmp/sqoop-hadoop/compile/cb147e9deb144db0034d6f38cb47ad68/tb_user.jar
21 18/05/18 19:33:03 WARN manager.MySQLManager: It looks like you are importing from mysql.
22 18/05/18 19:33:03 WARN manager.MySQLManager: This transfer can be faster! Use the --direct
23 18/05/18 19:33:03 WARN manager.MySQLManager: option to exercise a MySQL-specific fast path.
24 18/05/18 19:33:03 INFO manager.MySQLManager: Setting zero DATETIME behavior to convertToNull (mysql)
25 18/05/18 19:33:03 INFO mapreduce.ImportJobBase: Beginning import of tb_user
26 18/05/18 19:33:04 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
27 18/05/18 19:33:04 INFO Configuration.deprecation: mapred.jar is deprecated. Instead, use mapreduce.job.jar
28 18/05/18 19:33:07 INFO Configuration.deprecation: mapred.map.tasks is deprecated. Instead, use mapreduce.job.maps
29 18/05/18 19:33:07 INFO client.RMProxy: Connecting to ResourceManager at slaver1/192.168.19.131:8032
30 18/05/18 19:33:08 WARN security.UserGroupInformation: PriviledgedActionException as:hadoop (auth:SIMPLE) cause:org.apache.hadoop.mapred.FileAlreadyExistsException: Output directory hdfs://slaver1:9000/user/hadoop/tb_user already exists
31 18/05/18 19:33:08 ERROR tool.ImportTool: Encountered IOException running import job: org.apache.hadoop.mapred.FileAlreadyExistsException: Output directory hdfs://slaver1:9000/user/hadoop/tb_user already exists
32 at org.apache.hadoop.mapreduce.lib.output.FileOutputFormat.checkOutputSpecs(FileOutputFormat.java:146)
33 at org.apache.hadoop.mapreduce.JobSubmitter.checkSpecs(JobSubmitter.java:554)
34 at org.apache.hadoop.mapreduce.JobSubmitter.submitJobInternal(JobSubmitter.java:430)
35 at org.apache.hadoop.mapreduce.Job$10.run(Job.java:1295)
36 at org.apache.hadoop.mapreduce.Job$10.run(Job.java:1292)
37 at java.security.AccessController.doPrivileged(Native Method)
38 at javax.security.auth.Subject.doAs(Subject.java:415)
39 at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1642)
40 at org.apache.hadoop.mapreduce.Job.submit(Job.java:1292)
41 at org.apache.hadoop.mapreduce.Job.waitForCompletion(Job.java:1313)
42 at org.apache.sqoop.mapreduce.ImportJobBase.doSubmitJob(ImportJobBase.java:198)
43 at org.apache.sqoop.mapreduce.ImportJobBase.runJob(ImportJobBase.java:171)
44 at org.apache.sqoop.mapreduce.ImportJobBase.runImport(ImportJobBase.java:268)
45 at org.apache.sqoop.manager.SqlManager.importTable(SqlManager.java:665)
46 at org.apache.sqoop.manager.MySQLManager.importTable(MySQLManager.java:118)
47 at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:497)
48 at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:605)
49 at org.apache.sqoop.Sqoop.run(Sqoop.java:143)
50 at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
51 at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:179)
52 at org.apache.sqoop.Sqoop.runTool(Sqoop.java:218)
53 at org.apache.sqoop.Sqoop.runTool(Sqoop.java:227)
54 at org.apache.sqoop.Sqoop.main(Sqoop.java:236)
55
56 [hadoop@slaver1 sqoop-1.4.5-cdh5.3.6]$

2、报错说以及存在了,hdfs://slaver1:9000/user/hadoop/tb_user already exists,首先根据路径找到了问题,先将这个路径上面的删除了,然后再执行的时候发现将mysql的数据表数据可以导入到hdfs分布式文件系统上面。

1 [hadoop@slaver1 ~]$ hdfs dfs -rm -r /user/hadoop/tb_user
2 18/05/18 19:34:06 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
3 18/05/18 19:34:07 INFO fs.TrashPolicyDefault: Namenode trash configuration: Deletion interval = 0 minutes, Emptier interval = 0 minutes.
4 Deleted /user/hadoop/tb_user
5 [hadoop@slaver1 ~]$

3、执行如下所示:

[hadoop@slaver1 sqoop-1.4.5-cdh5.3.6]$ bin/sqoop import \
> --connect jdbc:mysql://slaver1:3306/test \
> --username root \
> --password 123456 \
> --table tb_user \
> --m 1
Warning: /home/hadoop/soft/sqoop-1.4.5-cdh5.3.6/../hcatalog does not exist! HCatalog jobs will fail.
Please set $HCAT_HOME to the root of your HCatalog installation.
Warning: /home/hadoop/soft/sqoop-1.4.5-cdh5.3.6/../accumulo does not exist! Accumulo imports will fail.
Please set $ACCUMULO_HOME to the root of your Accumulo installation.
18/05/18 19:39:26 INFO sqoop.Sqoop: Running Sqoop version: 1.4.5-cdh5.3.6
18/05/18 19:39:26 WARN tool.BaseSqoopTool: Setting your password on the command-line is insecure. Consider using -P instead.
18/05/18 19:39:26 INFO manager.MySQLManager: Preparing to use a MySQL streaming resultset.
18/05/18 19:39:26 INFO tool.CodeGenTool: Beginning code generation
18/05/18 19:39:27 INFO manager.SqlManager: Executing SQL statement: SELECT t.* FROM `tb_user` AS t LIMIT 1
18/05/18 19:39:27 INFO manager.SqlManager: Executing SQL statement: SELECT t.* FROM `tb_user` AS t LIMIT 1
18/05/18 19:39:27 INFO orm.CompilationManager: HADOOP_MAPRED_HOME is /home/hadoop/soft/hadoop-2.5.0-cdh5.3.6
Note: /tmp/sqoop-hadoop/compile/464d9aff412a6285fd9f6f4c6d16b4e6/tb_user.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
18/05/18 19:39:29 INFO orm.CompilationManager: Writing jar file: /tmp/sqoop-hadoop/compile/464d9aff412a6285fd9f6f4c6d16b4e6/tb_user.jar
18/05/18 19:39:29 WARN manager.MySQLManager: It looks like you are importing from mysql.
18/05/18 19:39:29 WARN manager.MySQLManager: This transfer can be faster! Use the --direct
18/05/18 19:39:29 WARN manager.MySQLManager: option to exercise a MySQL-specific fast path.
18/05/18 19:39:29 INFO manager.MySQLManager: Setting zero DATETIME behavior to convertToNull (mysql)
18/05/18 19:39:29 INFO mapreduce.ImportJobBase: Beginning import of tb_user
18/05/18 19:39:30 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
18/05/18 19:39:30 INFO Configuration.deprecation: mapred.jar is deprecated. Instead, use mapreduce.job.jar
18/05/18 19:39:31 INFO Configuration.deprecation: mapred.map.tasks is deprecated. Instead, use mapreduce.job.maps
18/05/18 19:39:31 INFO client.RMProxy: Connecting to ResourceManager at slaver1/192.168.19.131:8032
18/05/18 19:39:37 INFO db.DBInputFormat: Using read commited transaction isolation
18/05/18 19:39:37 INFO mapreduce.JobSubmitter: number of splits:1
18/05/18 19:39:38 INFO mapreduce.JobSubmitter: Submitting tokens for job: job_1526642793183_0001
18/05/18 19:39:39 INFO impl.YarnClientImpl: Submitted application application_1526642793183_0001
18/05/18 19:39:39 INFO mapreduce.Job: The url to track the job: http://slaver1:8088/proxy/application_1526642793183_0001/
18/05/18 19:39:39 INFO mapreduce.Job: Running job: job_1526642793183_0001
18/05/18 19:39:58 INFO mapreduce.Job: Job job_1526642793183_0001 running in uber mode : false
18/05/18 19:39:58 INFO mapreduce.Job: map 0% reduce 0%
18/05/18 19:40:09 INFO mapreduce.Job: map 100% reduce 0%
18/05/18 19:40:09 INFO mapreduce.Job: Job job_1526642793183_0001 completed successfully
18/05/18 19:40:09 INFO mapreduce.Job: Counters: 30
File System Counters
FILE: Number of bytes read=0
FILE: Number of bytes written=132974
FILE: Number of read operations=0
FILE: Number of large read operations=0
FILE: Number of write operations=0
HDFS: Number of bytes read=87
HDFS: Number of bytes written=153
HDFS: Number of read operations=4
HDFS: Number of large read operations=0
HDFS: Number of write operations=2
Job Counters
Launched map tasks=1
Other local map tasks=1
Total time spent by all maps in occupied slots (ms)=8377
Total time spent by all reduces in occupied slots (ms)=0
Total time spent by all map tasks (ms)=8377
Total vcore-seconds taken by all map tasks=8377
Total megabyte-seconds taken by all map tasks=8578048
Map-Reduce Framework
Map input records=10
Map output records=10
Input split bytes=87
Spilled Records=0
Failed Shuffles=0
Merged Map outputs=0
GC time elapsed (ms)=102
CPU time spent (ms)=1310
Physical memory (bytes) snapshot=102690816
Virtual memory (bytes) snapshot=841768960
Total committed heap usage (bytes)=15794176
File Input Format Counters
Bytes Read=0
File Output Format Counters
Bytes Written=153
18/05/18 19:40:09 INFO mapreduce.ImportJobBase: Transferred 153 bytes in 38.0904 seconds (4.0168 bytes/sec)
18/05/18 19:40:09 INFO mapreduce.ImportJobBase: Retrieved 10 records.
[hadoop@slaver1 sqoop-1.4.5-cdh5.3.6]$

4、数据如下所示:

[hadoop@slaver1 ~]$ hdfs dfs -cat /user/hadoop/tb_user/part-m-00000
18/05/18 19:41:25 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
1,张三,15236083001
2,李四,15236083001
3,王五,15236083001
4,小明,15236083001
5,小红,15236083001
6,小别,15236083001
7,7,7
8,8,8
9,9,9
10,10,10
[hadoop@slaver1 ~]$
 

sqoop错误集锦1的更多相关文章

  1. sqoop错误集锦2

    1.使用sqoop技术将mysql的数据导入到Hive出现的错误如下所示: 第一次使用命令如下所示: 1 [hadoop@slaver1 sqoop-1.4.5-cdh5.3.6]$ bin/sqoo ...

  2. SVN下错误集锦

    SVN下错误集锦 一SVN下的文件被locked不能update和commit 最近做项目的时候,遇到这个问题,SVN下的文件被locked不能update和commit.其提示如下: 解决办法:执行 ...

  3. (转)Hadoop之常见错误集锦

     Hadoop之常见错误集锦            下文中没有特殊说明,环境都是CentOS下Hadoop 2.2.0.1.伪分布模式下执行start-dfs.sh脚本启动HDFS时出现如下错误:   ...

  4. 在Hadoop 2.3上运行C++程序各种疑难杂症(Hadoop Pipes选择、错误集锦、Hadoop2.3编译等)

    首记 感觉Hadoop是一个坑,打着大数据最佳解决方案的旗帜到处坑害良民.记得以前看过一篇文章,说1TB以下的数据就不要用Hadoop了,体现不 出太大的优势,有时候反而会成为累赘.因此Hadoop的 ...

  5. drp错误集锦---“Cannot return from outside a function or method”

    好久都不动的项目,今天打开项目突然是红色感叹号.详细错误表现为: 也就是说,如今MyEclipse已经不识别在JSP页面中使用的return方法了(并且不止一处这种警告),那怎么办?????顿时闹钟一 ...

  6. django 2.0 xadmin 错误集锦

    转载 django 2.0 xadmin 错误集锦 2018-03-26 10:39:18 Snail0Li 阅读数 5188更多 分类专栏: python   1.django2.0把from dj ...

  7. Tensorflow 错误集锦

    文章目录 参考文献 本文记录笔者在Tensorflow使用上的一些错误的集锦,方便后来人迅速查阅解决问题. 我是留白. 我是留白. CreateSession still waiting for re ...

  8. Python:常见错误集锦(持续更新ing)

    初学Python,很容易与各种错误不断的遭遇.通过集锦,可以快速的找到错误的原因和解决方法. 1.IndentationError:expected an indented block 说明此处需要缩 ...

  9. centos7安装mplayer 错误集锦

    (1)在 linux下运行程序时,发现了error while loading shared libraries这种错误,一时间不知道解决办法,在网上搜索,终于解决了:./tests: error w ...

随机推荐

  1. step_by_step_用python爬点磁力链接

    爬点东西 -Scrapy 今天是小年,团聚的日子,想想这一年中发生过大大小小的事,十分感慨. 言归正传: 吐槽了一些话,没事的时候一个单身老男人就只能上上网打发打发时间,后来我发现一个网站比较好,但是 ...

  2. winform UI 设计方法

    这里主要提供了一种设计思路,你可以将成套的UI图像添加或替换到本程序中.在设计过程中,还存在许多疏漏,懒得仔细修改了,在使用过程中自行修改添加.这里的函数基本上都可以单独使用,需要哪个将cs文件加入到 ...

  3. 2018-2019-2 《网络对抗技术》Exp0 Kali安装

    2018-2019-2 <网络对抗技术>Exp0 Kali安装 ---20165110 一.实验要求 1.下载 2.安装Kali 3.连接网络 4.共享文件 5.更新软件源 二.实验步骤 ...

  4. innodb 关键特性(insert buffer)

    一.insert buffer 性能改善 insert buffer和数据页一样,也是物理页的一个组成部分. 在innodb存储引擎中,主键是行唯一的标识符.通常应用程序中行记录的插入顺序是按照主键递 ...

  5. Pyton:类变量,实例变量,类对象,实例对象

    https://www.cnblogs.com/crazyrunning/p/6945183.html

  6. MySQL增删改查常用语句命令

    增删改查语句增删改查的语句命令为 增:insert删:delete改:update查:SELECT或者show 库操作创建数据库:create database shujukuba;创建带字符集的数据 ...

  7. 微信x5内核很鸡贼啊

    最近在写一个支付项目,然后要打通微信和支付宝支付,本来后端联调的时候直接调用weixin://wxpay/bizpayurl?XXXX接口就行的,完全走着通,然后到项目验收了就炸了,点不进去了,最后改 ...

  8. stark组件开发之组合搜索基本显示

    数据的获取,上一篇,已经有了!然后就是,如何进行展示的问题.到了展示这里,又有了新的问题, 因为从数据库,取得的数据. 分为 queryset 和 tuple 两种数据结构.tuple 中,只是字符串 ...

  9. Vue中 $ref 的用法

    说明:vm.$refs 一个对象,持有已注册过 ref 的所有子组件(或HTML元素)使用:在 HTML元素 中,添加ref属性,然后在JS中通过vm.$refs.属性来获取注意:如果获取的是一个子组 ...

  10. dskinlite(uieasy mfc界面库)使用记录4:listbox测试

    先看效果图: xml代码: 作者qq:80101277,dskinlite交流qq群:138231653 <window name="listbox1" type=" ...