Hi Matt,

I'm not positive of the implementation details, but I know for certain that
the "new" (unreleased) Java client allows you to provide a load-balancing
strategy yourself. This documentation should be a good start:
http://basho.github.io/riak-java-client/2.0.0-SNAPSHOT/com/basho/riak/client/core/DefaultNodeManager.html

I'm sure Brian Roach and Dave Rusek, who maintain the Java client, would
also be happy to discuss it more with you.


On Sat, Feb 8, 2014 at 11:23 PM, Matthew MacClary <
[email protected]> wrote:

> 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
>
>


-- 
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

Reply via email to