Glad you figured it out, Martin. As you may have noticed, while Ripple provides the tight Rails integration with initializers and such, the basic client does not. If people think that's a valuable feature, I'd be happy to accept pull-requests. :D
On Tue, Nov 13, 2012 at 9:30 AM, Martin Streicher <[email protected]> wrote: > > The issue was inconsistent configuration. There was a call to > Riak::Client.new in config/initializers/riak.rb and two more calls in a > method to do searches. I expected Riak::Client.new to perhaps pick up > settings from a YML file each time, but I think I was wrong. I changed the > code to create one connection in the initializers file, pointing to the node > defined in the YML file, and then reuse that connection. > > Martin > > > > On Nov 10, 2012, at 12:05 PM, Sean Cribbs wrote: > >> Can you ping the node? i.e. Riak::Client.ping >> >> On Fri, Nov 9, 2012 at 9:17 AM, Martin Streicher >> <[email protected]> wrote: >>> >>> Locally, everything runs fine when on 127.0.0.1. >>> >>> If I change to 192.168.0.2 and change the vm.args and app.config and remove >>> the data/rings, I fail to connect when trying to enable search. >>> >>> I can get further if I do >>> >>> client = Riak::Client.new(nodes: [{host: '192.168.0.2'}]) >>> >>> and then enable search using that client variable. >>> >>> I think I am misunderstanding something about the nodes and which nodes the >>> operations are going to. >>> >>> >>> >>> >>> On Nov 9, 2012, at 12:10 PM, Sean Cribbs wrote: >>> >>>> Well, it's pretty obvious that it simply can't connect, especially >>>> since your configuration is the default -- which means HTTP pointed to >>>> 127.0.0.1:8098. Is your Riak node running and on that port? Can you >>>> hit it from curl on the command line? >>>> >>>> On Fri, Nov 9, 2012 at 7:36 AM, Martin Streicher >>>> <[email protected]> wrote: >>>>> >>>>> I'm not doing anything special in Riak::Client. >>>>> >>>>> How can I narrow what the RuntimeError is? >>>>> >>>>> >>>>> >>>>> On Nov 9, 2012, at 10:21 AM, Sean Cribbs wrote: >>>>> >>>>>> Martin, >>>>>> >>>>>> How is your Riak::Client object configured? That looks like one of two >>>>>> possibilities: first, the request failed 3 times in a row; second, one >>>>>> of the backends is raising an exception that seems network related but >>>>>> isn't one of the standard network errors (i.e it's a RuntimeError, but >>>>>> it should be a SystemError with econnrefused errno!). >>>>>> >>>>>> On Fri, Nov 9, 2012 at 7:12 AM, Martin Streicher >>>>>> <[email protected]> wrote: >>>>>>> >>>>>>> I get a connection refused error when I try to enable search from my >>>>>>> code. >>>>>>> >>>>>>> /var/www/zutron/shared/bundle/ruby/1.9.1/gems/riak-client-1.0.5/lib/riak/client.rb:450:in >>>>>>> `rescue in recover_from': Connection refused - connect(2) >>>>>>> (RuntimeError) >>>>>>> from >>>>>>> /var/www/zutron/shared/bundle/ruby/1.9.1/gems/riak-client-1.0.5/lib/riak/client.rb:422:in >>>>>>> `recover_from' >>>>>>> from >>>>>>> /var/www/zutron/shared/bundle/ruby/1.9.1/gems/riak-client-1.0.5/lib/riak/client.rb:284:in >>>>>>> `http' >>>>>>> from >>>>>>> /var/www/zutron/shared/bundle/ruby/1.9.1/gems/riak-client-1.0.5/lib/riak/client.rb:129:in >>>>>>> `backend' >>>>>>> from >>>>>>> /var/www/zutron/shared/bundle/ruby/1.9.1/gems/riak-client-1.0.5/lib/riak/client.rb:246:in >>>>>>> `get_bucket_props' >>>>>>> from >>>>>>> /var/www/zutron/shared/bundle/ruby/1.9.1/gems/riak-client-1.0.5/lib/riak/bucket.rb:77:in >>>>>>> `props' >>>>>>> from >>>>>>> /var/www/zutron/shared/bundle/ruby/1.9.1/gems/riak-client-1.0.5/lib/riak/bucket.rb:68:in >>>>>>> `props=' >>>>>>> from >>>>>>> /var/www/zutron/releases/20121108191450/lib/classes/riak_search.rb:6:in >>>>>>> `enable_search' >>>>>>> >>>>>>> enable_search is: >>>>>>> >>>>>>> def self.enable_search(bucket_name, client = Riak::Client.new) >>>>>>> bucket = client.bucket bucket_name >>>>>>> bucket.props = {search: true} >>>>>>> end >>>>>>> >>>>>>> Any ideas why it's failing? Search is enabled on the machine. >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> _______________________________________________ >>>>>>> riak-users mailing list >>>>>>> [email protected] >>>>>>> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> Sean Cribbs <[email protected]> >>>>>> Software Engineer >>>>>> Basho Technologies, Inc. >>>>>> http://basho.com/ >>>>> >>>> >>>> >>>> >>>> -- >>>> Sean Cribbs <[email protected]> >>>> Software Engineer >>>> Basho Technologies, Inc. >>>> http://basho.com/ >>> >> >> >> >> -- >> Sean Cribbs <[email protected]> >> Software Engineer >> Basho Technologies, Inc. >> http://basho.com/ > -- Sean Cribbs <[email protected]> Software Engineer Basho Technologies, Inc. http://basho.com/ _______________________________________________ riak-users mailing list [email protected] http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
