我遇到了一个非常奇怪的情况.我一直在尝试使用thrift来运行一个nodeJS客户端来运行Hbase,除了获取任何返回数据之外,我看起来大部分都是成功的.我正在运行hbase.0.94.8(目前是稳定版本),它肯定在运行,我正在运行节俭0.9.0,它也已经构建并运行.在它们都运行的情况下,我可以使用shell查询Hbase并访问thrift网页,但是当我运行以下代码时,没有任何反应:
var thrift = require('thrift'),
HBase = require('./Hbase.js'),
HBaseTypes = require('./Hbase_types.js');
var connection = thrift.createConnection('localhost',9090,{ transport: thrift.TBufferedTransport,protocol:thrift.TBinaryProtocol });
connection.on('connect',function(){
console.log('connected');
var client = thrift.createClient(HBase,connection);
client.getTableNames(function(err,data){
if(err)
console.log('there was an error:',err);
else
console.log('hbase tables:',data);
});
});
connection.on('error',function(err){
console.log('error',err);
});
Run Code Online (Sandbox Code Playgroud)
我肯定得到一个连接(或者,至少,连接事件触发),但它就像在另一端没有任何东西.在您回答之前,Hbase master肯定在运行,thrift肯定在运行,9095上的网页和9090上的服务(由日志报告).日志似乎反映出甚至没有发生任何事情(即thrift和hbase日志似乎不受请求的影响),但我肯定会获得成功的连接.
有什么想法吗?