[英]Get Accumulo instance name
I want to use GeoMesa (GIS extension of Accumulo) and virtualized it using Docker just like this repo . 我想使用GeoMesa(Accumulo的GIS扩展)并使用Docker对其进行虚拟化,就像此repo一样 。 Now I want to connect to the Accumulo instance using Java using:
现在,我想使用Java通过以下方式连接到Accumulo实例:
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
我可以使用连接到ZooKeeper实例
./zkCli.sh -server ip:port
So i guess the instance_name is wrong. 所以我想instance_name是错误的。 I used the one noted in the repo linked first.
我使用了回购链接中首先提到的那个。 However I don't know where how to check the instance_name needed.
但是我不知道如何在哪里检查instance_name。
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. 我测试了使用zkCli是否可以连接到zookeeper,并使用服务器上的
accumulo shell
检查了凭据。
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. 有多种简单的方法来获取instance_name:以太坊只需按照注释中的elserj的方式查看到累加状态页面的顶部,或使用zkCli连接到Zookeeper并使用Christopher回答的
ls /accumulo/instances /
。
However I could not manage to connect to accumulo using the ordinary Java Connector. 但是,我无法使用普通的Java连接器连接到累加器。 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.
尽管如此,我还是设法通过代理设置连接到Accumulo,这对我来说是一个有效的解决方案,即使我仍然希望发现问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.