Python client: Connection pool

Alex De la rosa alex.rosa.box at gmail.com
Wed Jun 25 08:18:30 EDT 2014


Hi there,

Using the Python client, in the documentation I can read this:

"The client maintains a connection pool behind the scenes, one for each
protocol. Connections are opened as-needed; a random node is selected when
a new connection is requested."

Imagine that I create my connection like this:

client = riak.RiakClient(protocol='pbc', nodes=[{'host':'X.X.X.1',
'http_port':8098,'pb_port':8087},{'host':'X.X.X.2','http_port':8098,
'pb_port':8087},{'host':'X.X.X.3','http_port':8098,'pb_port':8087},{'host':
'X.X.X.4','http_port':8098,'pb_port':8087},{'host':'X.X.X.5','http_port'
:8098,'pb_port':8087}])

Specifying the 5 servers in my cluster... Every time that do a request
(PUT/GET/DELETE) is going to use a randomized host from the list? Also...
what if for example I add server X.X.X.6 and X.X.X.7? do I have to manually
edit my connection string to reflect those changes? Is there a way to
automatically use any node in the cluster without having to specify them
manually?

Thanks,
Alex
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20140625/665a18ba/attachment.html>


More information about the riak-users mailing list