-1

I am trying to connect to Accumulo instance hosted on a remote Centos Virtual Box on a Windows host.

String instanceName="accumulo"
String zooservers = "ip:2181" //ip is the public ip of the Windows host system not the virtual box
ZooKeeperInstance inst = new ZooKeeperInstance(instanceName, zooServers);
Connector conn = inst.getConnector("user", new PasswordToken("pass"));

I am not adding the code written further as I don't get the conn instance and am unable to proceed further from here.

sashmi
  • 97
  • 1
  • 2
  • 14

1 Answers1

0

Is ZooKeeper actually running on the Windows host and not the Centos VM?

Assuming that you have everything running inside the VM, you would want to provide the hostname of your VM and not of the host machine. Using localhost:2181 is probably a safe bet instead of your ip:2181.

elserj
  • 1,236
  • 6
  • 6
  • Hadoop , Zookeeper and Accumulo are running on the Centos VM on a Windows Machine A. I am trying to connect to it through my app from a Windows machine B, thats why I am using ip:2181 – sashmi May 05 '15 at 03:46
  • You could try saving the ip of windows machine A in the hosts file of windows machine B. – Vaibhav May 05 '15 at 07:07
  • Is your VM actually set up to do pass through from the host to the guest? Vaibhav is probably right -- this sounds like a networking issue. Unless you forward ports from the VM to the host, you can use the host's address to access the guest. – elserj May 05 '15 at 21:08
  • Vaibhav, I added the ip of the remote host in the hosts file of my machine. But that didnt help either Elserj, port forwarding is enabled from VM to host. – sashmi May 06 '15 at 03:08
  • What ports did you actually forward? You'd need at least 2181, 9997 and 9999, 8020 most likely. You might want to look at host-only networking – elserj May 06 '15 at 16:09
  • Thanks everyone for the help. It was fixed by giving the internal ip adress instead of localhost in the accumulo files - tracers,gc,masters,slaves. – sashmi Aug 21 '15 at 21:19
  • Instead of the public ip or localhost , I used the internal ip adress 192.168.*.* – sashmi Aug 21 '15 at 21:21