0

I've been struggling for days on connecting Java to Riak running in a Docker container. If someone can help me, i'll be very greatfull.

I'm using RiakClient as API for JAVA. But i can't figure out how build the RiakClient in the constructor RiakClient().

Maybe is my container setup to be wrong. Here what i've done:

The docker container expose the port 8098 for http and 8087 for protocol buffer. I've then opened the two ports on VirtualBox, in this way:

-Host Ip: 127.0.0.1 - Host Port 8098 - Guest Port 8098
-Host Ip: 127.0.0.1 - Host Port 8087 - Guest Port 8087

Then i've run i container with:

docker run -d -p 8098:8098 -p 8087:8087 --name test -h localhost hectcastro/riak.

When i start riak in the container, i get an error like: riak failed to start within 15 seconds... and RiakClient on JAVA doesn't work.

If i run the container without mapping the ports, riak works fine. I really can't figure out what happens.

Any ideas to solve the problem? Thank you!

TheBlueBird
  • 33
  • 1
  • 5
  • Are there any logs in Riak's log folder? Are those ports available on your local system? – Alex Moore Oct 01 '15 at 19:35
  • are you having riak inside the container bind to a specific IP address or the wildcard 0.0.0.0? – Joe Oct 02 '15 at 04:16
  • @Joe I don't know, i didn't set anything. How can i check it? – TheBlueBird Oct 02 '15 at 06:28
  • In the config files there should be a setting for the IP address of various listeners. I believe HTTP and protocol buffers IPs can be set separately. – Joe Oct 02 '15 at 06:35
  • @Joe i've found these: listener.http.internal = 0.0.0.0:8098 listener.protobuf.internal = 0.0.0.0:8087 – TheBlueBird Oct 02 '15 at 06:49

0 Answers0