Reputation: 128927
I have setup Riak on a Ubuntu machine, and it seam to work if I do riak ping
.
Now I would like to use the Riak Java client to store an object, but it doesn't work. I get com.basho.riak.client.response.RiakIORuntimeException
when I try to store an object. What am I doing wrong? Is there a way to test if I can access riak from my java client? Do I have to create a Bucket first? how?
import com.basho.riak.client.RiakClient;
import com.basho.riak.client.RiakObject;
import com.basho.riak.client.response.FetchResponse;
public class RiakTest {
public static void main(String[] args) {
// connect
RiakClient riak = new RiakClient("http://192.168.1.107:8098/riak");
// create object
RiakObject o = new RiakObject("mybucket", "mykey", "myvalue");
// store
riak.store(o);
}
}
Upvotes: 1
Views: 2512
Reputation: 142
The last up to date wiki page.
So you need:
In etc/app.config change http and pb_ip settings
from http, [ {"127.0.0.1", 8098 } ]}, to http, [ {"0.0.0.0", 8098 } ]},
and
from {pb_ip, "127.0.0.1" }, to {pb_ip, "0.0.0.0" },
Upvotes: 0
Reputation: 1495
Jonas, by default Riak's HTTP server binds only to the local interface (127.0.0.1). To change this, shutdown your instance and edit the app.config file. Change the setting "riak_web_ip" to "0.0.0.0", which will bind to all interfaces.
For more information, see http://wiki.basho.com/display/RIAK
Upvotes: 3