【发布时间】:2014-06-30 23:30:07
【问题描述】:
我正在编写一个从 (a) HBase 表中读取的 MapReduce 作业。除了Configuration 类之外,几乎所有东西都可以正常工作。所以我这样做了,
Configuration config = HBaseConfiguration.create();
GenericOptionsParser parser = new GenericOptionsParser(config, args);
// This should work but is not working.
config.addResource(new Path(parser.getCommandLine().getOptionValue("conf", DEFAULT_HBASE_CONF)));
当我像这样运行作业时(正确地将路径传递给hbase-site.xml),我收到了这个错误。
14/06/30 23:02:30 WARN zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException: Connection refused
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:735)
at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:350)
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1075)
14/06/30 23:02:30 INFO zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error)
但是当我添加以下两行时,它就像一个魅力(即使它看起来完全荒谬)。
// So these are the workarounds.
config.set("hbase.rootdir", config.get("hbase.rootdir"));
config.set("hbase.zookeeper.quorum", config.get("hbase.zookeeper.quorum"));
基本上,从Configuration 对象中读回参数并将它们设置回同一个对象中,这很疯狂。
我读到了一个关于它的错误HBASE-11066,但它似乎已经关闭,理由是本地配置问题(我认为不是)和一个 SO 问题here 这可能与我的查询类似,但还没有答案.我将 CDH 5.0.2 与 HBase 0.96.1.1 一起使用。任何见解都将不胜感激。
【问题讨论】: