sqoop错误集锦1
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的更多相关文章
- sqoop错误集锦2
1.使用sqoop技术将mysql的数据导入到Hive出现的错误如下所示: 第一次使用命令如下所示: 1 [hadoop@slaver1 sqoop-1.4.5-cdh5.3.6]$ bin/sqoo ...
- SVN下错误集锦
SVN下错误集锦 一SVN下的文件被locked不能update和commit 最近做项目的时候,遇到这个问题,SVN下的文件被locked不能update和commit.其提示如下: 解决办法:执行 ...
- (转)Hadoop之常见错误集锦
Hadoop之常见错误集锦 下文中没有特殊说明,环境都是CentOS下Hadoop 2.2.0.1.伪分布模式下执行start-dfs.sh脚本启动HDFS时出现如下错误: ...
- 在Hadoop 2.3上运行C++程序各种疑难杂症(Hadoop Pipes选择、错误集锦、Hadoop2.3编译等)
首记 感觉Hadoop是一个坑,打着大数据最佳解决方案的旗帜到处坑害良民.记得以前看过一篇文章,说1TB以下的数据就不要用Hadoop了,体现不 出太大的优势,有时候反而会成为累赘.因此Hadoop的 ...
- drp错误集锦---“Cannot return from outside a function or method”
好久都不动的项目,今天打开项目突然是红色感叹号.详细错误表现为: 也就是说,如今MyEclipse已经不识别在JSP页面中使用的return方法了(并且不止一处这种警告),那怎么办?????顿时闹钟一 ...
- django 2.0 xadmin 错误集锦
转载 django 2.0 xadmin 错误集锦 2018-03-26 10:39:18 Snail0Li 阅读数 5188更多 分类专栏: python 1.django2.0把from dj ...
- Tensorflow 错误集锦
文章目录 参考文献 本文记录笔者在Tensorflow使用上的一些错误的集锦,方便后来人迅速查阅解决问题. 我是留白. 我是留白. CreateSession still waiting for re ...
- Python:常见错误集锦(持续更新ing)
初学Python,很容易与各种错误不断的遭遇.通过集锦,可以快速的找到错误的原因和解决方法. 1.IndentationError:expected an indented block 说明此处需要缩 ...
- centos7安装mplayer 错误集锦
(1)在 linux下运行程序时,发现了error while loading shared libraries这种错误,一时间不知道解决办法,在网上搜索,终于解决了:./tests: error w ...
随机推荐
- git命令行获取某分支代码
参考https://www.cnblogs.com/nylcy/p/6569284.html git clone -b branch1 http://xxx.xx.xxx... git clone - ...
- Ubuntu---添加输入法
摘要:Ubuntu 在刚刚安装好之后,默认是不支持直接输入中文的,所以我们需要安装支持中文的输入法.网络上面一般推荐使用的输入法是 Fcitx(小企鹅输入法),我们今天就来安装和配置它. step1: ...
- vue项目性能优化,优化项目加载慢的问题
一. 对路由组件进行懒加载: 如果使用同步的方式加载组件,在首屏加载时会对网络资源加载加载比较多,资源比较大,加载速度比较慢.所以设置路由懒加载,按需加载会加速首屏渲染.在没有对路由进行懒加载时,在C ...
- (4)Linux常用基本操作
1.ping和traceroute 指定源IP ping:ping -I 源 目的 #I为大写的i 带源地址路由tracert:traceroute -d <目标地址> -s < ...
- springmvc接收ajax传递的数组
之前的方法我用字符串拼接.req.getParameter("参数名[]");或json方式.虽然都能用,但是都不太令我满意. 今天参考这个贴子,ajax添加 traditiona ...
- 理解javascript中的立即执行函数(function(){})()
之前看了好多代码,都有用到这种函数的写法,但是都没认真的去想为什么会这样写,今天开始想学习下jquery的源码,发现jquery也是使用这种方式,用(function(window, undefine ...
- 新建VS工程与填坑:解决方案与项目不在同一目录
A.新建项目->空工程 B.添加依赖库 1.属性->C/C++->附加包含目录 注:添加头文件目录,必须指向子文件夹 2.属性->链接器->常规->附加库目录 注: ...
- centos7 删除swap
https://www.refmanual.com/2016/01/08/completely-remove-swap-on-ce7/#.W8AaSRMzaRs 删除不干净,启动不起来的情况下.需要从 ...
- windows server 2012 FTP连接报530 User 用户名 cannot log in home directory inaccessible的解决方法
我最近在创建个人网站,经过了万网购买域名注册(www.lingcup.xyz ,www.lingcup.com),在主机屋购买免费云服务器(ip是49.4.142.41),域名别名解析(cname)到 ...
- 手绘raft算法
手绘raft算法 互联网技术窝 2019-04-07 12:06:05 在现实的分布式系统中,不能可能保证集群中的每一台机器都是100%可用可靠的,集群中的任何机器都可能发生宕机.网络连接等问题导致集 ...