简体   繁体   English

在hadoop mapreduce作业中插入连接到数据库时发生异常

[英]Exception while inserting connecting to database in hadoop mapreduce job

I have a mapreduce job which is suppose to persist data to the MySQL database but it is throwing an exception which is following, 我有一个mapreduce作业,该作业应该将数据持久保存到MySQL数据库,但是它引发了一个异常,

 INFO mapred.JobClient: Task Id : attempt_201501122044_1310_r_000001_0, Status : FAILED
 java.io.IOException  at org.apache.hadoop.mapreduce.lib.db.DBOutputFormat.getRecordWriter(DBOutputFormat.java:180)
    at org.apache.hadoop.mapred.ReduceTask.runNewReducer(ReduceTask.java:597)
    at org.apache.hadoop.mapred.ReduceTask.run(ReduceTask.java:444)
    at org.apache.hadoop.mapred.Child$4.run(Child.java:268)
    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:1642)
    at org.apache.hadoop.mapred.Child.main(Child.java:262)

This mapreduce job runs over the cluster of 5 nodes and I have confirmed that database connection is getting formed by testing simple main class with sql connection creation. 这个mapreduce作业在5个节点的集群上运行,我已经确认通过使用sql连接创建测试简单的主类来形成数据库连接。

I am badly stuck at this point. 在这一点上,我很困。

This is a permissions issue: notice the UserGroupInformation is flagged: 这是一个权限问题:请注意UserGroupInformation已标记:

    `at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:415)org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:164`2)

What kind of security issue? 什么样的安全性问题? It is not clear from the Stacktrace. 从Stacktrace尚不清楚。 Is your code doing any HDFS? 您的代码是否在做HDFS? Or what else that would trigger a security check? 还是还有什么会触发安全检查?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM