我正在使用名为 jshs2 的hive的node.js客户端驱动程序,但在连接到我们的hiveserver2时遇到了连接问题。我试图查找无效状态128,但没有运气。这是我的代码:
const options = {
auth: "NOSASL",
host: "my host",
port: 10000,
timeout: 10000,
username: "my username",
password: "my password"
hiveType: HS2Util.HIVE_TYPE.CDH,
hiveVer: "0.13.1",
thriftVer: "0.9.0",
cdhVer: "5.3.3"
};
it('test', function() {
var configuration = new Configuration(options);
var idl = new IDLContainer();
var cursor;
return idl.initialize(configuration).then(function() {
var connection = new HiveConnection(configuration, idl);
return connection.connect();
}).then(function(_cursor) {
cursor = _cursor;
return cursor.execute(options.query);
}).then(function() {
promise.delay(2000);
logger.log('info', cursor.getOperationStatus());
}).catch(function(error) {
throw error;
});
});

服务器日志:
java.lang.RuntimeException: org.apache.thrift.transport.TTransportException: Invalid status -128
at org.apache.thrift.transport.TSaslServerTransport$Factory.getTransport(TSaslServerTransport.java:219)
at org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:227)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.thrift.transport.TTransportException: Invalid status -128
at org.apache.thrift.transport.TSaslTransport.sendAndThrowMessage(TSaslTransport.java:230)
at org.apache.thrift.transport.TSaslTransport.receiveSaslMessage(TSaslTransport.java:184)
at org.apache.thrift.transport.TSaslServerTransport.handleSaslStartMessage(TSaslServerTransport.java:125)
at org.apache.thrift.transport.TSaslTransport.open(TSaslTransport.java:262)
at org.apache.thrift.transport.TSaslServerTransport.open(TSaslServerTransport.java:41)
at org.apache.thrift.transport.TSaslServerTransport$Factory.getTransport(TSaslServerTransport.java:216)
... 4 more
答案 0 :(得分:2)
参孙是对的。我的客户端中的身份验证集与服务器期望的不同。检查您的HiveServer2配置文件hive-site.xml
。这是一个片段:
<property>
<name>hive.server2.enable.doAs</name>
<value>false</value>
</property>
<property>
<name>hive.server2.use.SSL</name>
<value>false</value>
</property>
<property>
<name>hive.server2.authentication</name>
<value>NOSASL</value>
</property>
它没有hive.server2.authentication
属性设置,所以我在那里添加了。有关文档参考,请查看Cloudera's ODBC driver for Apache Hive install guide第22页配置身份验证部分