Hive模拟不使用jdbc

时间:2014-05-13 08:54:10

标签: java jdbc hive cloudera

我正在尝试使用jdbc-connector连接到通过Cloudera实现的Hive Server,并且在模拟点连接失败:

14/05/13 10:45:10 INFO hive.metastore: Connected to metastore.
14/05/13 10:45:10 WARN conf.Configuration: org.apache.hadoop.hive.conf.LoopingByteArrayInputStream@2f490758:an attempt to override final parameter: mapreduce.job.end-notification.max.retry.interval;  Ignoring.
14/05/13 10:45:10 WARN conf.Configuration: org.apache.hadoop.hive.conf.LoopingByteArrayInputStream@2f490758:an attempt to override final parameter: mapreduce.job.end-notification.max.attempts;  Ignoring.
org.apache.hive.service.cli.HiveSQLException: No username provided for impersonation
    at org.apache.hive.service.cli.session.HiveSessionImplwithUGI.setSessionUGI(HiveSessionImplwithUGI.java:57)
    at org.apache.hive.service.cli.session.HiveSessionImplwithUGI.<init>(HiveSessionImplwithUGI.java:49)
    at org.apache.hive.service.cli.session.SessionManager.openSession(SessionManager.java:83)
    at org.apache.hive.service.cli.CLIService.openSessionWithImpersonation(CLIService.java:118)
    at org.apache.hive.service.cli.thrift.ThriftCLIService.OpenSession(ThriftCLIService.java:157)
    at org.apache.hive.jdbc.HiveConnection.openSession(HiveConnection.java:255)
    at org.apache.hive.jdbc.HiveConnection.<init>(HiveConnection.java:150)
    at org.apache.hive.jdbc.HiveDriver.connect(HiveDriver.java:106)
    at java.sql.DriverManager.getConnection(DriverManager.java:664)
    at java.sql.DriverManager.getConnection(DriverManager.java:270)
    [...]
java.sql.SQLException: No username provided for impersonation

我已经检查了在hive上启用的cloudera Web界面和模拟,并且hdfs和MapReduce的代理设置被正确设置为“*”。我的hive-site.xml还包含

<property>
  <name>hive.server2.enable.impersonation</name>
  <value>true</value>
</property>

有谁知道这可能来自哪里?

1 个答案:

答案 0 :(得分:0)

实际上是由于没有在Cloudera中启动hive server2而我尝试使用驱动程序来运行hive服务器2 Class.forName("org.apache.hive.jdbc.HiveDriver");而不是hive服务器驱动程序Class.forName("org.apache.hadoop.hive.jdbc.HiveDriver");