1

I'm using the MiniAccumuloCluster (MAC) 1.5 jar and attempting to even just instantiate a MAC object but can't seem to connect to it. I get a ton of errors akin to the following:

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)

And ending with the following error:

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 (line 454) is:

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

Any suggestions? The Internet is wildly lacking documentation for a lot of the Accumulo framework, including MAC.

Mastergeek
  • 429
  • 1
  • 6
  • 16

2 Answers2

1

Did you start your MiniAccumuloCluster instance before attempting to instantiate the ZooKeeperInstance?

Make sure you call mac.start().

elserj
  • 1,236
  • 6
  • 6
  • I did not call start() before creating my Instance, but after. – Mastergeek Jul 10 '13 at 14:27
  • If you say adding in jars fixed your issue, so be it. However, given your stacktrace, you were blocked in the constructor of ZooKeeperInstance because you didn't start your MiniAccumuloCluster instance. – elserj Jul 11 '13 at 15:17
  • I figured out that my Junit3 rules weren't quite right and so the temporary folder wasn't being created to make a File object for the MiniAccumuloCluster object instantiation. – Mastergeek Jul 23 '13 at 16:13
1

It turns out that I was missing a handful of JAR libraries and I discerned this by looking through the JUnit TemporaryFolder log files. After downloading all the appropriate libraries I resolved my issue.

Download all the dependency jars to get any java code that works with accumulo from here: http://mvnrepository.com/artifact/org.apache.accumulo/accumulo-core/1.5.0 and that should fix be a good starting point for addressing accumulo java code.

Mastergeek
  • 429
  • 1
  • 6
  • 16