Zheng, By using a cluster client (HTTPClusterClient or PBClusterClient) you would get not only fail-over on an operation failure but also round-robin balancing of operations across your nodes.
When you create either a HTTPClusterClient or a PBClusterClient you provide a list of Raik nodes. When performing an operation there's a Retrier object that is used by the Bucket object. The default Retrier tries an operation 3 times before reporting a failure. On each try, a different node is selected from the list of Riak nodes (this same mechanism also gives you load balancing across the nodes in your list in a round-robin fashion). The only deficiency here is that a node is never failed completely out of the list or deprioritized in any way. We do have plans to add a pluggable load balancing feature at some point that would allow for the end user to implement whatever scheme they would like. I've recently started work on a Riak Java client "Cookbook" and have an example of how to create a cluster client here: https://github.com/basho/riak-java-client/wiki/ClientFactory Thanks, Brian Roach On Mar 26, 2012, at 11:56 AM, Zheng Zhu wrote: > Hello, I am new to Riak and want to know if Riak java client has the node > connection feature to automatically fail over to another node after timed out > for current node. If so, can you share links to doc, java doc or sample code? > > Thanks > Zheng > The information contained in this e-mail is confidential and/or proprietary > to the 41st Parameter. The information transmitted herewith is intended only > for use by the individual or entity to which it is addressed. If you are not > the intended recipient, you should not copy, distribute, disclose or use the > information it contains, please e-mail the sender immediately and delete this > message from your system. > _______________________________________________ > riak-users mailing list > [email protected] > http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
_______________________________________________ riak-users mailing list [email protected] http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
