无法在R中拒绝JDBC连接打开客户端传输

时间:2016-08-14 09:07:25

标签: r hadoop jdbc

**> rhive.connect(host = "192.168.1.4",port = 9000,defaultFS = "hdfs://localhost:9000")**
***Warning: 
    +----------------------------------------------------------+
    + / hiveServer2 argument has not been provided correctly.  +
    + / RHive will use a default value: hiveServer2=TRUE.      +***
    +----------------------------------------------------------+

16/08/14 14:12:42 INFO jdbc.Utils: Supplied authorities: 192.168.1.4:9000
16/08/14 14:12:42 INFO jdbc.Utils: Resolved authority: 192.168.1.4:9000
16/08/14 14:12:42 INFO jdbc.HiveConnection: Transport Used for JDBC connection: null
  

**线程“Thread-14”中的异常java.lang.RuntimeException:java.sql.SQLException:无法使用JDBC Uri打开客户端传输:   jdbc:hive2://192.168.1.4:9000 / default:java.net.ConnectException:   连接被拒绝*

*

at com.nexr.rhive.hive.HiveJdbcClient$HiveJdbcConnector.connect(HiveJdbcClient.java:337)
        at com.nexr.rhive.hive.HiveJdbcClient$HiveJdbcConnector.run(HiveJdbcClient.java:322)
    Caused by: java.sql.SQLException: Could not open client transport with JDBC Uri: jdbc:hive2://192.168.1.4:9000/default: java.net.ConnectException: Connection refused
        at org.apache.hive.jdbc.HiveConnection.openTransport(HiveConnection.java:208)
        at org.apache.hive.jdbc.HiveConnection.<init>(HiveConnection.java:154)
        at org.apache.hive.jdbc.HiveDriver.connect(HiveDriver.java:107)
        at java.sql.DriverManager.getConnection(DriverManager.java:571)
        at java.sql.DriverManager.getConnection(DriverManager.java:215)
        at com.nexr.rhive.hive.DatabaseConnection.connect(DatabaseConnection.java:51)
        at com.nexr.rhive.hive.HiveJdbcClient$HiveJdbcConnector.connect(HiveJdbcClient.java:330)
        ... 1 more
    Caused by: org.apache.thrift.transport.TTransportException: java.net.ConnectException: Connection refused
        at org.apache.thrift.transport.TSocket.open(TSocket.java:226)
        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:183)
        ... 7 more
    Caused by: java.net.ConnectException: Connection refused
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
        at enter code here java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
    at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
    at java.net.Socket.connect(Socket.java:579)
    at org.apache.thrift.transport.TSocket.open(TSocket.java:221)
    ... 10 more
Error: java.lang.IllegalStateException: Not connected to hiveserver

1 个答案:

答案 0 :(得分:1)

您没有传递密码。 尝试将密码作为脚本的一部分传递。

如果您没有提供有效的凭据,则会返回 Null

示例

jdbc:hive2://192.168.1.4:9000/default username password