I have the same use case as Massimiliano. We are using the java client and
our app runs on the same servers as the Riak cluster. We have found that
connecting to the Riak instance running on local host provides the best
performance. It would be nice if the cluster client could be told to prefer
one node, and fall back to other nodes if needed kind of like secondary DNS
servers.

-Matt

Message: 5
> Date: Sat, 8 Feb 2014 15:07:36 +0100
> From: Massimiliano Ciancio <[email protected]>
> To: Sean Cribbs <[email protected]>
> Cc: riak-users <[email protected]>
> Subject: Re: Riak pool connection
> Message-ID:
>         <CALJSbQxHU=UAu9ZvYT=+
> [email protected]>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Hi Sean,
> thanks for your answer!
>
> > I believe it may still be possible for the node to be selected if no
> other
> > connections are available in the pool, because the logic used to
> establish a
> > new connection might not use the filter.
>
> My problem is not to avoid that a node will be selected again after a
> fail (well, if this can be avoided by sure it's better...) but to set
> an order in the nodes: I want to connect first to the node on which my
> app is running and only in case of fail to the other nodes. The reason
> is to avoid network traffic: every instance of my app have to connect
> to the node on the same machine where it resides.
> How can I suggest a "preferred node" to RiakClient?
> My first idea was to use a connection with only the preferred node
> and, using a try/except, use an "emergency connection" with the list
> of all nodes to be used only in case of fail. But it's not so
> elegant....
> Massimiliano
>
_______________________________________________
riak-users mailing list
[email protected]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com

Reply via email to