Monday, June 11, 2012

Accumulo: Where is my instance id?

When running a Java program to interact with Accumulo, I ran into the following exception:



Exception in thread "main" java.lang.RuntimeException: Accumulo not initialized, there is no instance id at /accumulo/instance_id
at org.apache.accumulo.core.client.ZooKeeperInstance.getInstanceIDFromHdfs(ZooKeeperInstance.java:263)
at org.apache.accumulo.server.client.HdfsZooInstance._getInstanceID(HdfsZooInstance.java:123)
at org.apache.accumulo.server.client.HdfsZooInstance.getInstanceID(HdfsZooInstance.java:116)


/accumulo/instance_id should be an HDFS directory with just one file whose name is that of the Accumulo instance. For example:



$ hadoop fs -ls /accumulo/instance_id
Found 1 items
-rw-r--r-- 1 medined supergroup 0 2012-06-11 17:58 /accumulo/instance_id/b519799c-3a51-4c9b-af21-96d577e2c11f


This issue was resolved when I added the Hadoop configuration directory to my classpath. Making this change enabled the Java program to look at HDFS instead of the local filesystem.

No comments:

Post a Comment