connecting to remote Riak from Ruby

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

connecting to remote Riak from Ruby

Zubair Quraishi
Does anyone know how to connect to a remote Riak node via Ruby? I tried ripple but it does not seem to document how to do this.


_______________________________________________
riak-users mailing list
[hidden email]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
Reply | Threaded
Open this post in threaded view
|

Re: connecting to remote Riak from Ruby

Zubair Quraishi
I get :

Riak::FailedRequest: Expected 200 from Riak but received 404. <HTML><HEAD><TITLE>404 Not Found</TITLE></HEAD><BODY><H1>Not Found</H1>The requested document was not found on this server.<P><HR><ADDRESS>mochiweb+webmachine web server</ADDRESS></BODY></HTML>
   

Is this because I am using Riak server 0.7.1?



On Mon, Feb 15, 2010 at 6:43 PM, Sean Cribbs <[hidden email]> wrote:
Zubair,

Specify the :host option when initializing the client.  e.g.:

client = Riak::Client.new(:host => "some.domain.name")

If you're using the Ripple::Document mixin:

Ripple.config = {:host => "some.domain.name"}

Sean


On 2/15/10 12:04 PM, Zubair Quraishi wrote:
Does anyone know how to connect to a remote Riak node via Ruby? I tried ripple but it does not seem to document how to do this.

_______________________________________________ riak-users mailing list



_______________________________________________
riak-users mailing list
[hidden email]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
Reply | Threaded
Open this post in threaded view
|

Re: connecting to remote Riak from Ruby

Sean Cribbs
Obviously the object is not there.  If you want to create a new object, get the bucket first and create an empty RObject:

bucket = client['bucket_name']
object = Riak::RObject.new(bucket, "key")

I'll be working on making this easier to do, but it will come after I've completed the ORM features.

Sean

On 2/15/10 3:08 PM, Zubair Quraishi wrote:
I get :

Riak::FailedRequest: Expected 200 from Riak but received 404. <HTML><HEAD><TITLE>404 Not Found</TITLE></HEAD><BODY><H1>Not Found</H1>The requested document was not found on this server.<P><HR><ADDRESS>mochiweb+webmachine web server</ADDRESS></BODY></HTML>
   

Is this because I am using Riak server 0.7.1?



On Mon, Feb 15, 2010 at 6:43 PM, Sean Cribbs <[hidden email]> wrote:
Zubair,

Specify the :host option when initializing the client.  e.g.:

client = Riak::Client.new(:host => "some.domain.name")

If you're using the Ripple::Document mixin:

Ripple.config = {:host => "some.domain.name"}

Sean


On 2/15/10 12:04 PM, Zubair Quraishi wrote:
Does anyone know how to connect to a remote Riak node via Ruby? I tried ripple but it does not seem to document how to do this.

_______________________________________________ riak-users mailing list




_______________________________________________
riak-users mailing list
[hidden email]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
Reply | Threaded
Open this post in threaded view
|

Re: connecting to remote Riak from Ruby

Zubair Quraishi
I have the following buckets in my Riak 0.7.1 database:

{ok,[<<"default">>,<<"__riak_client_test__">>]}

so I perform:

>> bucket = client.bucket("__riak_client_test__")

: and get :

Riak::FailedRequest: Expected 200 from Riak but received 404. <HTML><HEAD><TITLE>404 Not Found</TITLE></HEAD><BODY><H1>Not Found</H1>The requested document was not found on this server.<P><HR><ADDRESS>mochiweb+webmachine web server</ADDRESS></BODY></HTML>
    from /Library/Ruby/Gems/1.8/gems/ripple-0.5.0/lib/riak/client/curb_backend.rb:58:in `perform'
    from /Library/Ruby/Gems/1.8/gems/ripple-0.5.0/lib/riak/client/http_backend.rb:71:in `get'
    from /Library/Ruby/Gems/1.8/gems/ripple-0.5.0/lib/riak/client.rb:119:in `bucket'
    from (irb):12
>>


On Tue, Feb 16, 2010 at 12:09 AM, Sean Cribbs <[hidden email]> wrote:
Obviously the object is not there.  If you want to create a new object, get the bucket first and create an empty RObject:

bucket = client['bucket_name']
object = Riak::RObject.new(bucket, "key")

I'll be working on making this easier to do, but it will come after I've completed the ORM features.

Sean

On 2/15/10 3:08 PM, Zubair Quraishi wrote:
I get :

Riak::FailedRequest: Expected 200 from Riak but received 404. <HTML><HEAD><TITLE>404 Not Found</TITLE></HEAD><BODY><H1>Not Found</H1>The requested document was not found on this server.<P><HR><ADDRESS>mochiweb+webmachine web server</ADDRESS></BODY></HTML>
   

Is this because I am using Riak server 0.7.1?



On Mon, Feb 15, 2010 at 6:43 PM, Sean Cribbs <[hidden email]> wrote:
Zubair,

Specify the :host option when initializing the client.  e.g.:

client = Riak::Client.new(:host => "some.domain.name")

If you're using the Ripple::Document mixin:

Ripple.config = {:host => "some.domain.name"}

Sean


On 2/15/10 12:04 PM, Zubair Quraishi wrote:
Does anyone know how to connect to a remote Riak node via Ruby? I tried ripple but it does not seem to document how to do this.

_______________________________________________ riak-users mailing list





_______________________________________________
riak-users mailing list
[hidden email]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
Reply | Threaded
Open this post in threaded view
|

Re: connecting to remote Riak from Ruby

Zubair Quraishi
In reply to this post by Sean Cribbs
I have the following buckets in my Riak 0.7.1 database:

{ok,[<<"default">>,<<"__riak_
client_test__">>]}

so I perform on the default bucket too:

>> bucket = client["default"]

Riak::FailedRequest: Expected 200 from Riak but received 404. <HTML><HEAD><TITLE>404 Not Found</TITLE></HEAD><BODY><H1>Not Found</H1>The requested document was not found on this server.<P><HR><ADDRESS>mochiweb+webmachine web server</ADDRESS></BODY></HTML>
    from /Library/Ruby/Gems/1.8/gems/ripple-0.5.0/lib/riak/client/curb_backend.rb:58:in `perform'
    from /Library/Ruby/Gems/1.8/gems/ripple-0.5.0/lib/riak/client/http_backend.rb:71:in `get'
    from /Library/Ruby/Gems/1.8/gems/ripple-0.5.0/lib/riak/client.rb:119:in `[]'
    from (irb):14
>>


On Tue, Feb 16, 2010 at 12:09 AM, Sean Cribbs <[hidden email]> wrote:
Obviously the object is not there.  If you want to create a new object, get the bucket first and create an empty RObject:

bucket = client['bucket_name']
object = Riak::RObject.new(bucket, "key")

I'll be working on making this easier to do, but it will come after I've completed the ORM features.

Sean

On 2/15/10 3:08 PM, Zubair Quraishi wrote:
I get :

Riak::FailedRequest: Expected 200 from Riak but received 404. <HTML><HEAD><TITLE>404 Not Found</TITLE></HEAD><BODY><H1>Not Found</H1>The requested document was not found on this server.<P><HR><ADDRESS>mochiweb+webmachine web server</ADDRESS></BODY></HTML>
   

Is this because I am using Riak server 0.7.1?



On Mon, Feb 15, 2010 at 6:43 PM, Sean Cribbs <[hidden email]> wrote:
Zubair,

Specify the :host option when initializing the client.  e.g.:

client = Riak::Client.new(:host => "some.domain.name")

If you're using the Ripple::Document mixin:

Ripple.config = {:host => "some.domain.name"}

Sean


On 2/15/10 12:04 PM, Zubair Quraishi wrote:
Does anyone know how to connect to a remote Riak node via Ruby? I tried ripple but it does not seem to document how to do this.

_______________________________________________ riak-users mailing list





_______________________________________________
riak-users mailing list
[hidden email]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com