Search code examples
javaapache-zookeeperaccumulogeomesa

Get Accumulo instance name


I want to use GeoMesa (GIS extension of Accumulo) and virtualized it using Docker just like this repo. Now I want to connect to the Accumulo instance using Java using:

 Instance i = new ZooKeeperInstance("docker_instance",zkIP:port);
 Connector conn = i.getConnector(user, new PasswordToken(password));

The connetion does not get established and hangs (just like in this question). I can connect to the ZooKeeper instance using using

./zkCli.sh -server ip:port

So i guess the instance_name is wrong. I used the one noted in the repo linked first. However I don't know where how to check the instance_name needed.


To make my problem reproducable I did setup a digital ocean server with all necessary dependencies and accumulo. I tested that the connection to zookeeper is possible using zkCli and checked the credentials using accumulo shell on the server.

 Instance i = new ZooKeeperInstance("DIGITAL_OCEAN","46.101.199.216:2181");
 // WARN  org.apache.accumulo.core.client.ClientConfiguration  - Found no client.conf in default paths. Using default client configuration values.
 System.out.println("This is reached");
 Connector conn = i.getConnector("root", new PasswordToken("mypassw"));
 System.out.println("This is not reached");

Solution

  • As a troubleshooting step, you may be able to extract the instance name by using HdfsZooInstance.getInstance().getInstanceName() or by connecting directly to ZooKeeper and listing the instance names with ls /accumulo/instances/