MySQL Forums
Forum List  »  NDB clusters

Re: failover seems like is not working
Posted by: Mark Matthews
Date: September 19, 2005 06:35AM

kostya kote wrote:
> ok,
> I'll try to ask another way.
> Do I need to reconnect when my host was down ? If
> it is so, then I have slow performance cause
> driver try to connect all hosts starting from
> first. And each time I get latency while driver
> find the host which is up.
>
> How can I make an application such a way that I
> only once got connection and then in some
> operation loop could use it, in spite of broken
> connection with one of the host, indicated in
> connection URL ?
> I guess when I set property autoReconnect in the
> true state the driver automatically will be
> connecting to failover host listed in connection
> URL, and I have no need to recconect it at each
> transaction. Is it right ?

Kostya,

Any "in-flight" transaction when a host fails will have to be retried by _your_ application. The JDBC driver can't do it automatically because it is not safe. Only your application "knows" whether it is okay to "replay" a transaction. Placing transactions that can be re-tried in a "while" or "for" loop that exits when the transaction has been completed successfully.

A common configuration is to place these "clustered" connections in a connection pool so they are somewhat long-lived, and to have the connection pool do a liveness check (configured in your connection pool) to make sure the connection is pointing at a host that is "up" before it is handed to your application.

Currently, MySQL has no ability to "push" availability information to clients, so the only way for them to determine what host(s) are up/down is to try and connect to them.

-Mark

Mark Matthews
Consulting Member Technical Staff - MySQL Enterprise Tools
Oracle
http://www.mysql.com/products/enterprise/monitor.html

Options: ReplyQuote


Subject
Views
Written By
Posted
4826
September 16, 2005 11:14AM
2062
September 19, 2005 04:26AM
Re: failover seems like is not working
2012
September 19, 2005 06:35AM
1953
September 19, 2005 06:48AM
1939
September 19, 2005 06:53AM
1874
September 19, 2005 07:08AM
1778
September 19, 2005 07:13AM
1976
September 19, 2005 07:42AM
1865
September 19, 2005 07:52AM
1701
September 19, 2005 08:04AM
1787
September 19, 2005 08:24AM
1816
September 19, 2005 08:35AM
1814
September 19, 2005 09:42AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.