accumulo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Josh Elser <josh.el...@gmail.com>
Subject Re: Connecting java client to Accumulo VM
Date Wed, 08 Nov 2017 19:20:29 GMT
Accumulo chooses the network interface to bind given the resolution of 
the hostname that you provide in the "hosts" files in ACCUMULO_CONF_DIR.

If you have "localhost" (the default) still in the files (e.g. masters, 
slaves), this presumably resolves to 127.0.0.1 which will result in 
Accumulo not accepting connections from your VM's network adapter.

A quick hack would be to put "0.0.0.0" in those files instead of 
"localhost". I think the Accumulo scripts only have the ability to 
override the bound interface for the Monitor, not all processes, to be 
0.0.0.0. You could also use a hostname you define in /etc/hosts that 
binds to the proper interface instead (which would be a bit more like 
reality).

On 11/8/17 10:43 AM, Geoffry Roberts wrote:
> All,
> 
> I have used Accumulo before, but a few versions ago (1.5.1), maybe 
> something has changed.  Also, I've never before run it in a VM.
> 
> I am running Accumulo from withn a VM and attempting to connect from 
> without.  I am getting a complaint regarding port 9997, which, within 
> the VM, is listening on 127.0.0.1:9997 <http://127.0.0.1:9997>.  
> Apparently, I need to get it onto 0.0.0.0:9997 <http://0.0.0.0:9997>.  
> Am I correct?
> 
> Hadoop 2.6.2
> Zookeeper 3.4.10
> Accumulo 1.8.1
> Thrift 0.10.0
> Ubuntu 16.04 as a VBox guest
> OSX 10.12.06 as the host
> 
> The HAZ is running on the VM.  From the CLI I can connect with the 
> Zookeeper client and the Accumulo client.
> 
> I have ports 22, 50070, 50075, 2181, 9995, and 9997 forwarded.
> 
>  From the host, I can browse the Hadoop and Accumulo web pages.  I can 
> also connect using the Zookeeper client.  When I try to connect from 
> Java,  I am getting a successful connect to 2181, but it complains about 
> port 9997.
> 
> The VM is showing all forwarded ports as listening on 0.0.0.0 
> <http://0.0.0.0>:<port> except for 127.0.0.1:9997 
> <http://127.0.0.1:9997>.  As best I can tell Thrift needs the port.
> 
> My connect code:
> 
> String instance= properties.getProperty(ACCUMULO_INSTANCE);
> 
> String uri = properties.getProperty(ZOOKEEPER_URI);
> 
> Instance inst = new ZooKeeperInstance(instance, uri);
> 
> String user = properties.getProperty(USER);
> 
> String password = properties.getProperty(PASSWORD);
> 
> AuthenticationToken token = new PasswordToken(password);
> 
> conn = inst.getConnector(user, token);
> 
> 
> Errors from Java:
> 
> 2017-11-08 09:50:55 INFO  ZooKeeper:438 - Initiating client connection, 
> connectString=192.168.50.101:2181 <http://192.168.50.101:2181> 
> sessionTimeout=30000 
> watcher=org.apache.accumulo.fate.zookeeper.ZooSession$ZooWatcher@4b013c76
> 
> 2017-11-08 09:50:55 INFO  ClientCnxn:1032 - Opening socket connection to 
> server 192.168.50.101/192.168.50.101:2181 
> <http://192.168.50.101/192.168.50.101:2181>. Will not attempt to 
> authenticate using SASL (unknown error)
> 
> 2017-11-08 09:50:55 INFO  ClientCnxn:876 - Socket connection established 
> to 192.168.50.101/192.168.50.101:2181 
> <http://192.168.50.101/192.168.50.101:2181>, initiating session
> 
> 2017-11-08 09:50:55 INFO  ClientCnxn:1299 - Session establishment 
> complete on server 192.168.50.101/192.168.50.101:2181 
> <http://192.168.50.101/192.168.50.101:2181>, sessionid = 
> 0x15f9c185f8e0006, negotiated timeout = 30000
> 
> 2017-11-08 09:50:58 WARN  ThriftTransportPool:539 - Server 
> localhost:9997 (120000) had 20 failures in a short time period, will not 
> complain anymore
> 
> ...
> It then continues to try to connect to no avail.
> 
> 
> Thanks in advance
> 
> -- 
> There are ways and there are ways,
> 
> Geoffry Roberts

Mime
View raw message