1

我正在使用 MiniAccumuloCluster (MAC) 1.5 jar 并试图甚至只是实例化一个 MAC 对象,但似乎无法连接到它。我收到大量类似于以下内容的错误:

13/07/08 14:31:29 INFO zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:14060
13/07/08 14:31:29 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:692)
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1143)

并以以下错误结束:

Exception in thread "main" java.lang.RuntimeException: Failed to connect to zookeeper (localhost:14060) within 2x zookeeper timeout period 30000
at org.apache.accumulo.fate.zookeeper.ZooSession.connect(ZooSession.java:96)
at org.apache.accumulo.fate.zookeeper.ZooSession.getSession(ZooSession.java:146)
at org.apache.accumulo.fate.zookeeper.ZooReader.getSession(ZooReader.java:36)
at org.apache.accumulo.fate.zookeeper.ZooReader.getZooKeeper(ZooReader.java:40)
at org.apache.accumulo.fate.zookeeper.ZooCache.getZooKeeper(ZooCache.java:56)
at org.apache.accumulo.fate.zookeeper.ZooCache.retry(ZooCache.java:127)
at org.apache.accumulo.fate.zookeeper.ZooCache.get(ZooCache.java:233)
at org.apache.accumulo.fate.zookeeper.ZooCache.get(ZooCache.java:188)
at org.apache.accumulo.core.client.ZooKeeperInstance.getInstanceID(ZooKeeperInstance.java:143)
at org.apache.accumulo.core.client.ZooKeeperInstance.<init>(ZooKeeperInstance.java:104)
at org.apache.accumulo.core.client.ZooKeeperInstance.<init>(ZooKeeperInstance.java:85)
at Accumulo.Accumulo.connectToMiniCluster(Accumulo.java:454)
at Accumulo.Accumulo.<init>(Accumulo.java:140)
at Accumulo.FrontEnd.main(FrontEnd.java:56)

Accumulo.Accumulo.connectoToMiniCluster(第 454 行)是:

Instance inst = new ZooKeeperInstance(mac.getInstanceName(), mac.getZooKeepers());

有什么建议么?Internet 上大量缺乏 Accumulo 框架的文档,包括 MAC。

4

2 回答 2

1

在尝试实例化 ZooKeeperInstance 之前,您是否启动了 MiniAccumuloCluster 实例?

确保调用 mac.start()。

于 2013-07-09T23:21:58.510 回答
1

事实证明,我遗漏了一些 JAR 库,我通过查看 JUnit TemporaryFolder 日志文件发现了这一点。下载所有适当的库后,我解决了我的问题。

下载所有依赖 jar 以从此处获取与 accumulo 一起使用的任何 java 代码:http://mvnrepository.com/artifact/org.apache.accumulo/accumulo-core/1.5.0 应该是一个很好的起点处理累积 java 代码。

于 2013-07-10T14:29:10.677 回答