0

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");
Community
  • 1
  • 1
nik
  • 2,114
  • 3
  • 22
  • 43
  • 1
    The Accumulo instance name is the name you provided when running `accumulo init`. You can see this name on the Accumulo Monitor. You also didn't provide any information about the actual error (is it hanging on the first line of code or the second?). Do you see an error eventually? Have you got a thread dump from the process when it is stuck? Have you increased the log4j debug level? – elserj Jan 18 '16 at 21:29
  • Ok, thanks for the location of the instance_name - sadly I used the correct one. Regarding the problem: It hangs at the second command, but it also displays a warning when creating the ZooKeeperInstance: `[main] WARN org.apache.accumulo.core.client.ClientConfiguration - Found no client.conf in default paths. Using default client configuration values.` – nik Jan 18 '16 at 22:11
  • That's actually coming from the ClientConfiguration object which ZKI is implicitly creating for you. You can get rid of that by using the ZKI constructor which accepts a ClientConfiguration object (and set the instanceName and zookeepers string on that object). – elserj Jan 19 '16 at 21:44

2 Answers2

1

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/

Christopher
  • 2,427
  • 19
  • 24
  • Connecting to zookeeper and using `ls /accumulo/instances /` works. Sadly it is the instance_name I expected it to be, so there must be another problem with my connection – nik Jan 19 '16 at 15:37
0

There are multiple easy ways to get the instance_name: Ether just look to the top of the accumulo status page as elserj noted in the comments or use zkCli to connect to Zookeeper and use ls /accumulo/instances / as Christopher answered.

However I could not manage to connect to accumulo using the ordinary Java Connector. Nevertheless I managed to connect to Accumulo using the Proxy-Settings which is a valid solution for me, even that I still would have liked to find the problem.

nik
  • 2,114
  • 3
  • 22
  • 43