summary refs log tree commit diff
path: root/lib/Net/Riak.pm
diff options
context:
space:
mode:
authorfranck cuny <franck@lumberjaph.net>2010-06-16 13:32:54 +0200
committerfranck cuny <franck@lumberjaph.net>2010-06-16 13:32:54 +0200
commit8093f1bc8a54c4f205460d4fbc1706f45bb6a195 (patch)
tree89837da677b706006742ed2559d9870ed8faf42a /lib/Net/Riak.pm
parentadd three map/reduce operations (from the fast track) (diff)
downloadnet-riak-8093f1bc8a54c4f205460d4fbc1706f45bb6a195.tar.gz
accept multiples hosts so we don't always hit the same node
Diffstat (limited to 'lib/Net/Riak.pm')
-rw-r--r--lib/Net/Riak.pm26
1 files changed, 25 insertions, 1 deletions
diff --git a/lib/Net/Riak.pm b/lib/Net/Riak.pm
index fa54e2e..1fb8c21 100644
--- a/lib/Net/Riak.pm
+++ b/lib/Net/Riak.pm
@@ -48,7 +48,31 @@ sub bucket {
 
 =item B<host>
 
-Hostname or IP address (default 'http://127.0.0.1:8098')
+URL of the node (default 'http://127.0.0.1:8098'). If your ring is composed with more than one node, you can configure the client to hit more than one host, instead of hitting always the same node. For this, you can do one of the following:
+
+=over 4
+
+=item B<all nodes equals>
+
+    my $riak = Net::Riak->new(
+        host => [
+            'http://10.0.0.40:8098',
+            'http://10.0.0.41:8098'
+        ]
+    );
+
+=item B<give weight to nodes>
+
+    my $riak = Net::Riak->new(
+        host => [
+            {node => 'http://10.0.0.40:8098', weight => '0.2'},
+            {node => 'http://10.0.0.41:8098', weight => '0.8'}
+        ]
+    );
+
+=back
+
+Now, when a request is made, a node is picked at random, according to weight.
 
 =item B<prefix>