简体   繁体   中英

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");

作为故障排除步骤,您可以通过使用HdfsZooInstance.getInstance().getInstanceName()或直接连接到ZooKeeper并使用ls /accumulo/instances/列出实例名称来提取实例名称HdfsZooInstance.getInstance().getInstanceName()

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM