mysql导入hadoop_导入数据从mysql传输到hadoop(import data transfer from mysql to hadoop)

导入数据从mysql传输到hadoop(import data transfer from mysql to hadoop)

我在我的系统中安装了hadoop 2.7.1和sqoop 1.4.6。 我正在尝试将表从MySQL导入到hdfs。 我收到以下错误:

org.apache.hadoop.util.Shell.runCommand(Shell.java:545)org.apache.hadoop.util.Shell.run(Shell.java:456)org.apache.hadoop.util.Shell $ ShellCommandExecutor .execute(Shell.java:722)org.apache.hadoop.yarn.server.nodemanager.DefaultContainerExecutor.launchContainer(DefaultContainerExecutor.java:211)org.apache.hadoop.yarn.server.nodemanager.containermanager.launcher.ContainerLaunch .call(ContainerLaunch.java:302)位于java.util.concurrent.FutureTask.run(FutureTask.java)的org.apache.hadoop.yarn.server.nodemanager.containermanager.launcher.ContainerLaunch.call(ContainerLaunch.java:82) :266)java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)at java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:617)at java.lang.Thread.run(Thread。 Java的:745)

容器以非零退出代码退出127失败此尝试。 申请失败。 INFO mapreduce.Job:计数器:0 WARN mapreduce.Counters:不推荐使用Group FileSystemCounters。 使用org.apache.hadoop.mapreduce.FileSystemCounter而不是INFO mapreduce.ImportJobBase:在17,7175秒内传输0个字节(0字节/秒)WARN mapreduce.Counters:Group org.apache.hadoop.mapred.Task $ Counter已弃用。 使用org.apache.hadoop.mapreduce.TaskCounter而不是INFO mapreduce.ImportJobBase:检索到0条记录。 ERROR tool.ImportTool:导入时出错:导入作业失败!

在这种情况下我该怎么办?

I installed hadoop 2.7.1 and sqoop 1.4.6 in my system. I am trying to import a table from MySQL to hdfs. I am getting following error:

at org.apache.hadoop.util.Shell.runCommand(Shell.java:545) at org.apache.hadoop.util.Shell.run(Shell.java:456) at org.apache.hadoop.util.Shell$ShellCommandExecutor.execute(Shell.java:722) at org.apache.hadoop.yarn.server.nodemanager.DefaultContainerExecutor.launchContainer(DefaultContainerExecutor.java:211) at org.apache.hadoop.yarn.server.nodemanager.containermanager.launcher.ContainerLaunch.call(ContainerLaunch.java:302) at org.apache.hadoop.yarn.server.nodemanager.containermanager.launcher.ContainerLaunch.call(ContainerLaunch.java:82) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)

Container exited with a non-zero exit code 127 Failing this attempt. Failing the application. INFO mapreduce.Job: Counters: 0 WARN mapreduce.Counters: Group FileSystemCounters is deprecated. Use org.apache.hadoop.mapreduce.FileSystemCounter instead INFO mapreduce.ImportJobBase: Transferred 0 bytes in 17,7175 seconds (0 bytes/sec) WARN mapreduce.Counters: Group org.apache.hadoop.mapred.Task$Counter is deprecated. Use org.apache.hadoop.mapreduce.TaskCounter instead INFO mapreduce.ImportJobBase: Retrieved 0 records. ERROR tool.ImportTool: Error during import: Import job failed!

in this case What can I do?

原文:https://stackoverflow.com/questions/31858976

更新时间:2020-01-29 03:01

最满意答案

我解决了这个问题。可能对你有用;)

mapred-site.xml中

mapreduce.jobhistory.webapp.address

bd01.19888

I solved this problem.maybe be useful for you ;)

mapred-site.xml

mapreduce.jobhistory.webapp.address

bd01.19888

2015-08-07

相关问答

我认为这是港口号的问题。 希望以下命令将有所帮助 sudo import --connect jdbc:mysql://localhost:3306/naresh --table marks --username root --password root

I think it is issue of port no. Hope Below command will help sudo import --connect jdbc:mysql://localhost:3306/naresh --

...

在源计算机上执行mysqldump,然后在另一侧进行插入,即使是40-100MB的文件也是合理的。 从命令行执行此操作。 (source machine)

mysqldump -u user -p password database > database.sql

..转移文件到收件人机器... (recipient machine)

mysql -u user -p password database < database.sql

Doing a mysqldump on the source

...

DistCp(分布式副本)是用于大型群集间/群集内复制的工具。 bash $ hadoop distcp hdfs:// src:8020 / foo / bar hdfs:// dest:8020 / bar / foo http://hadoop.apache.org/docs/stable/distcp.html#cpver 在java应用程序中,您可以使用org.apache.hadoop.tools.DistCp类 DistCp (distributed copy) is a tool

...

阅读MySQL参考手册中的解释。 最好的办法是使用LOAD DATA INFILE同时禁用索引,然后重新创建(并因此批量计算它们)。 如果这不适合你,有更多有趣的建议。 Read the explanations in the MySQL Reference Manual. The best you can do is use LOAD DATA INFILE while disabling indices before and recreating (and thus batch-calcula

...

在Hadoop中,您的数据绝对很小。 最新的电脑有16+ GB的RAM,因此您的数据集可以完全适合单台机器的内存。 但是,这并不意味着您至少可以尝试将数据加载到HDFS并对其执行一些操作。 Sqoop&Hive将成为您用来加载和处理SQL的工具。 但是,由于我提出了关于内存的观点,因此完全可行,您不需要Hadoop(HDFS和YARN),而是可以使用Apache Spark w / SparkSQL直接从分布式JDBC连接访问MySQL。 In Hadoop terms, your data is

...

据我记忆 - MySQL Dumps几乎完全是插入语句集。 您可以在映射器中解析它们并按原样处理...如果您只有几个表,则在Java中进行硬编码解析应该是微不足道的。 As far as I remember - MySQL Dumps are almost entirely is set of insert statements. You can parse them in your mapper and process as is... If you have only few tables

...

我解决了这个问题。可能对你有用;) mapred-site.xml中

mapreduce.jobhistory.webapp.address

bd01.19888

I solved this problem.maybe be useful for you ;) mapred-site.xml

mapreduce.jobhistory.we

...

如果您想要MySQL处理自动化解决方案,那么它就是您需要的复制。 由于主题很广泛且在MySQL手册中有详细介绍,我建议您坐下来阅读文档中有关该主题的内容。 If you want automated solution handled by MySQL, then it's replication what you need. Since the topic is broad and covered in detail in MySQL manual, I suggest you sit down

...

sqoop-export这样做的。 sqoop-export --connect jdbc:mysql://localhost/company

--username user --password passwd

--table users

--export-dir /path/to/HDFS_Source

--input-fields-terminated-by ','

请参阅Sqoop

...

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值