在尝试通过jdbc建立与HIVE的连接时遇到问题。它拒绝连接。
我的代码段
System.setProperty("java.security.auth.login.config","gss-jaas.conf");
System.setProperty("sun.security.jgss.debug","true");
System.setProperty("javax.security.auth.useSubjectCredsOnly","false");
System.setProperty("java.security.krb5.conf","krb5.conf");
try{
String s="";
Connection con = DriverManager.getConnection("jdbc:hive2://10.***.***.***:10000/finance;principal=hive/ip-10-xxx-xxx-xxx.ec2.internal@FDLXXX.COM");
Statement stmt = con.createStatement();
错误的堆栈跟踪:
ERR org.apache.thrift.transport.TTransportException: java.net.ConnectException: Connection refused
2019-07-01T17:53:18.76-0400 [APP/PROC/WEB/0]ERR at org.apache.thrift.transport.TSocket.open(TSocket.java:185)
2019-07-01T17:53:18.78-0400 [RTR/5] OUT scx-ecservice-stage.run.aws-usw02-pr.ice.predix.io - [2019-07-01T21:53:17.749+0000] "GET /hivetestdatabase HTTP/1.1" 500 0 327 "https://scx-ecservice-stage.run.aws-usw02-pr.ice.predix.io/swagger-ui.html" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36" "10.72.1.90:20516" "10.72.54.66:60527" x_forwarded_for:"165.156.39.13, 10.72.1.90" x_forwarded_proto:"https" vcap_request_id:"0b55fa66-6d41-4e38-665a-f7a773ca435e" response_time:1.031063611 app_id:"fa82e533-260f-48fe-b6e3-4128085d0d05" app_index:"0" tenant:"-" x_b3_traceid:"8e2cc3eda7b715e1" x_b3_spanid:"8e2cc3eda7b715e1" x_b3_parentspanid:"-"
2019-07-01T17:53:18.76-0400 [APP/PROC/WEB/0]ERR at org.apache.thrift.transport.TSaslTransport.open(TSaslTransport.java:248)
2019-07-01T17:53:18.76-0400 [APP/PROC/WEB/0]ERR at org.apache.thrift.transport.TSaslClientTransport.open(TSaslClientTransport.java:37)
2019-07-01T17:53:18.76-0400 [APP/PROC/WEB/0]ERR at org.apache.hadoop.hive.thrift.client.TUGIAssumingTransport$1.run(TUGIAssumingTransport.java:52)
2019-07-01T17:53:18.76-0400 [APP/PROC/WEB/0]ERR at org.apache.hadoop.hive.thrift.client.TUGIAssumingTransport$1.run(TUGIAssumingTransport.java:49)
2019-07-01T17:53:18.76-0400 [APP/PROC/WEB/0]ERR at java.security.AccessController.doPrivileged(Native Method)
2019-07-01T17:53:18.77-0400 [APP/PROC/WEB/0]ERR at javax.security.auth.Subject.doAs(Subject.java:422)
2019-07-01T17:53:18.77-0400 [APP/PROC/WEB/0]ERR at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1556)
2019-07-01T17:53:18.77-0400 [APP/PROC/WEB/0]ERR at org.apache.hadoop.hive.thrift.client.TUGIAssumingTransport.open(TUGIAssumingTransport.java:49)
2019-07-01T17:53:18.77-0400 [APP/PROC/WEB/0]ERR at org.apache.hive.jdbc.HiveConnection.openTransport(HiveConnection.java:156)
2019-07-01T17:53:18.77-0400 [APP/PROC/WEB/0]ERR at org.apache.hive.jdbc.HiveConnection.<init>(HiveConnection.java:96)
感谢您为我指明正确方向的任何帮助。预先感谢