求助: Java 连接 hbase 卡住不报错。

2017-07-06 11:44:23 +08:00
 ekoeko
public static Result getRow(String tableName, String rowkey) throws IOException {
Table table = conn.getTable(TableName.valueOf(tableName));
Get g = new Get(Bytes.toBytes(rowkey));
Result result = table.get(g);
table.close();
return result;
}


table.get(g)卡住不动,debug 信息显示 The application is running。


Google 了好久没找到,有的说没有本地配置 Hadoop 主机 hosts,配置了还是没用。

同事和我一样也是 mac 跑同样的程序,他的是没有任何问题的。。。
日志也没有任何消息:
2017-07-06 11:27:35,521 WARN org.apache.kafka.clients.consumer.ConsumerConfig - The configuration 'hbase.zookeeper.quorum' was supplied but isn't a known config.
2017-07-06 11:27:35,521 WARN org.apache.kafka.clients.consumer.ConsumerConfig - The configuration 'cloud.api.url' was supplied but isn't a known config.
2017-07-06 11:27:35,521 WARN org.apache.kafka.clients.consumer.ConsumerConfig - The configuration 'consumer.poll.timeout.ms' was supplied but isn't a known config.
2017-07-06 11:27:35,521 WARN org.apache.kafka.clients.consumer.ConsumerConfig - The configuration 'cloud.api.secret' was supplied but isn't a known config.
2017-07-06 11:27:35,521 WARN org.apache.kafka.clients.consumer.ConsumerConfig - The configuration 'video_play_min_sec' was supplied but isn't a known config.
2017-07-06 11:27:35,521 WARN org.apache.kafka.clients.consumer.ConsumerConfig - The configuration 'kafka.topic' was supplied but isn't a known config.
2017-07-06 11:27:35,521 WARN org.apache.kafka.clients.consumer.ConsumerConfig - The configuration 'hbase.zookeeper.property.clientPort' was supplied but isn't a known config.
2017-07-06 11:27:35,530 INFO org.apache.kafka.common.utils.AppInfoParser - Kafka version : 0.10.2.0
2017-07-06 11:27:35,530 INFO org.apache.kafka.common.utils.AppInfoParser - Kafka commitId : 576d93a8dc0cf421
2017-07-06 11:27:37,104 INFO org.apache.kafka.clients.consumer.internals.AbstractCoordinator - Discovered coordinator hadoop1:9092 (id: 2147483647 rack: null) for group hbase32.
2017-07-06 11:27:37,112 INFO org.apache.kafka.clients.consumer.internals.ConsumerCoordinator - Revoking previously assigned partitions [] for group hbase32
2017-07-06 11:27:37,113 INFO org.apache.kafka.clients.consumer.internals.AbstractCoordinator - (Re-)joining group hbase32
2017-07-06 11:27:37,149 INFO org.apache.kafka.clients.consumer.internals.AbstractCoordinator - Successfully joined group hbase32 with generation 19
2017-07-06 11:27:37,153 INFO org.apache.kafka.clients.consumer.internals.ConsumerCoordinator - Setting newly assigned partitions [player_access_log-0] for group hbase32
2017-07-06 11:27:38,443 INFO com.codeages.loader.player.KafkaHBaseConnector - {"path":"/var/log/nginx/test_for_ty.access.log","request":"/res/player.png?data=[{%22action%22%3A%22view%22%2C%22res_id%22%3A%223a4ee7ed4c71409fbc9d6439bfacc282%22%2C%22school_id%22%3A%2223938%22%2C%22res_type%22%3A%22video%22%2C%22user_id%22%3A%22110325%22%2C%22user_name%22%3A%22ES1497943356%22%2C%22res_length%22%3A4503.08%2C%22view_uuid%22%3A%22971e7b1a-b307-4684-967b-3ed9cb13425a%22%2C%22client_uuid%22%3A%225491e11b-47bf-4540-a90a-78d9da5a66ac%22%2C%22client_type%22%3A%22web%22%2C%22init_time%22%3A2.2%2C%22loading_time%22%3A%222.5%22%2C%22level%22%3A%22hd%22}]","agent":"\"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.7 Safari/537.36\"","@timestamp":"2017-07-06T03:02:41.323Z","clientip":"xxx","@version":"1","host":"hadoop1","message":"xxx - - [05/Jul/2017:14:22:26 +0800] \"GET /res/player.png?data=[{%22action%22%3A%22view%22%2C%22res_id%22%3A%223a4ee7ed4c71409fbc9d6439bfacc282%22%2C%22school_id%22%3A%2223938%22%2C%22res_type%22%3A%22video%22%2C%22user_id%22%3A%22110325%22%2C%22user_name%22%3A%22ES1497943356%22%2C%22res_length%22%3A4503.08%2C%22view_uuid%22%3A%22971e7b1a-b307-4684-967b-3ed9cb13425a%22%2C%22client_uuid%22%3A%225491e11b-47bf-4540-a90a-78d9da5a66ac%22%2C%22client_type%22%3A%22web%22%2C%22init_time%22%3A2.2%2C%22loading_time%22%3A%222.5%22%2C%22level%22%3A%22hd%22}] HTTP/1.1\" 200 0 \"http://service-cdn.qiqiuyun.net/js-sdk/video-player/1.1.27/video-player/player.html\" \"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.7 Safari/537.36\"","ua":{"patch":"3112","os":"Windows 10","major":"60","minor":"0","name":"Chrome","os_name":"Windows 10","device":"Other"},"timestamp":"05/Jul/2017:14:22:26 +0800"}



还需要什么信息,我可以在回复例提供。
谢谢各位 v 友
6092 次点击
所在节点    Hadoop
3 条回复
funky
2017-07-06 12:03:44 +08:00
这里一般是集群上的所有 host 都需要在本地 host 配置一遍,而且你确定你本地练得上线上集群?
funky
2017-07-06 12:08:18 +08:00
你设置了 hbase Zookeeper Quorum??
ekoeko
2017-07-06 12:47:34 +08:00
@funky 太太太感激了,我只配了主节点的。。。全部配置了就好了。。。wtf !

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/373429

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX