连接外部 Accumulo 实例和 java [英] Connecting an external Accumulo instance and java

查看:21
本文介绍了连接外部 Accumulo 实例和 java的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 Accumulo 连接到 VM.问题是,我无法将它连接到 Java.我可以看到 Apache 抛出的网页,但我无法让它与代码一起工作.我认为这是一个缺乏知识的问题,而不是一个真正的问题,但我找不到关于它的文档.所有示例都使用 localhost 作为 zooServer 名称,这显然对我不起作用.

I am trying to connect to a VM with Accumulo. The problem is, I can't get it hooked up in Java. I can see the webpage Apache throws up, but I can't get it to work with code. I think this is a lack of knowledge issue rather than a real problem, but I can't find documentation on it. All the examples use localhost as the zooServer name, this obviously doesn't work for me.

所以,这是我的代码:

  String instanceName = "accumulo-02"
  String zooServers = "192.168.56.5, accumulo-02.localdomain:9997"
  ZooKeeperInstance inst = new ZooKeeperInstance(instanceName, zooServers)
  ....

其余的不重要,因为我无法连接到服务器.

The rest isn't important because I cannot connect to the server.

这也确实是用 Groovy 写的.我只是在那里为 Java 人员更改了我的代码.

This is also really written in Groovy. I just changed my code there for the Java guys.

该程序驻留在我的计算机上.Accumulo、Hadoop 和 Zookeeper 都在 VM 上.它的 ip 就是那个 IP,而它的名字就是那个名字.在accumulo的配置中,'accumulo-02'是masters、slave等的域...

The program resides on my computer. Accumulo, Hadoop, and Zookeeper are all on the VM. The ip of it is that IP and the isntance name is that name. In the config of accumulo, 'accumulo-02' is the domain for masters, slaves, and etc...

推荐答案

正确指定列表Apache ZooKeeper 节点在连接到 Apache Accumulo 时使用ZooKeeperInstance,zooServers 应指定为:

To correctly specify the list of Apache ZooKeeper nodes when connecting to Apache Accumulo with the ZooKeeperInstance, the zooServers should be specified as:

  1. host:port逗号分隔列表,ZooKeeper 已经设置并在其上运行,没有空格.
  2. 确保您使用的是 ZooKeeper客户端端口,而不是 TServer.(端口 2181 是 ZooKeeper 的默认客户端端口.端口 9997 是 TServer 的默认客户端端口.)
  3. 如果您在默认端口 (2181) 上运行 ZooKeeper,则可以省略 :port 部分,只留下逗号分隔的 列表主机,或者如果您在非标准端口上有一些在标准端口上有一些,则可以将它们组合起来,如proxyhost,proxyhost:2182,thirdhost:2181".
  4. 使用IP 地址主机名都没有关系,只要可以从客户端,并且端口打开并且未被防火墙阻止.
  1. A comma-separated list of host:port that ZooKeeper is already set up and running on, without spaces.
  2. Ensure you are using the client port for ZooKeeper, and not the TServer. (Port 2181 is the default client port for ZooKeeper. Port 9997 is the default client port for TServers.)
  3. If you're running ZooKeeper on the default port (2181), you may omit the :port portion, leaving only a comma-separated list of hosts, or you can combine them if you have some on the non-standard port and some on the standard port, as in "proxyhost,proxyhost:2182,thirdhost:2181".
  4. It shouldn't matter whether you use the IP address or the hostname, so long as whatever you specify can be reached from the client, and the port is open and not blocked by a firewall.

查看构造函数的 JavaDoc 注释 此处.

See the JavaDoc comment on the constructor here.

这篇关于连接外部 Accumulo 实例和 java的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆