java.sql 拒绝连接_hive jdbc 拒绝连接问题
本帖最后由 willgone 于 2017-06-21 10:56 編輯
平臺配置在附件中。
private static String driverName1 = "org.apache.hive.jdbc.HiveDriver";
Class.forName(driverName1);
String url="jdbc:hive2://192.168.160.241:21076/default";
Connection con = DriverManager.getConnection(url, "", "");
Statement stmt = con.createStatement();
String createtable= "CREATE EXTERNAL TABLE if not exists netposa(id int,name string) ROW FORMAT DELIMITED FIELDS TERMINATED BY ',' ";
System.out.println("Running: " + sql);
stmt.execute(createtable);
報錯信息如下:
Exception in thread "main" java.sql.SQLException: Could not open client transport with JDBC Uri: jdbc:hive2://192.168.160.241:21076/default: java.net.ConnectException: Connection refused: connect
at org.apache.hive.jdbc.HiveConnection.openTransport(HiveConnection.java:231)
at org.apache.hive.jdbc.HiveConnection.(HiveConnection.java:176)
at org.apache.hive.jdbc.HiveDriver.connect(HiveDriver.java:105)
at java.sql.DriverManager.getConnection(DriverManager.java:579)
at java.sql.DriverManager.getConnection(DriverManager.java:221)
at com.netposa.di.utils.HiveUtils.main(HiveUtils.java:14)
Caused by: org.apache.thrift.transport.TTransportException: java.net.ConnectException: Connection refused: connect
at org.apache.thrift.transport.TSocket.open(TSocket.java:187)
at org.apache.thrift.transport.TSaslTransport.open(TSaslTransport.java:266)
at org.apache.thrift.transport.TSaslClientTransport.open(TSaslClientTransport.java:37)
at org.apache.hive.jdbc.HiveConnection.openTransport(HiveConnection.java:204)
... 5 more
總結
以上是生活随笔為你收集整理的java.sql 拒绝连接_hive jdbc 拒绝连接问题的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: maven mysql的jdbctemp
- 下一篇: 零跑 T03、零跑 C01 超级增程、零