hiveserver2 tttransportexception:无效状态-128

dwbf0jvd  于 2021-06-26  发布在  Hive
关注(0)|答案(1)|浏览(759)

我正在为配置单元使用一个名为jshs2的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
3yhwsihp

3yhwsihp1#

参孙是对的。我的客户机中的身份验证设置与服务器所期望的不同。检查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的odbc driver for apache hive安装指南第22页配置身份验证部分

相关问题