List:Cluster« Previous MessageNext Message »
From:Peter Chen Date:January 13 2010 3:04am
Subject:RE: about how to implement load balancing and fail over automatically
View as plain text  
Thanks for Lonetwin's help.

 

I searched on the Internet with Google,and got the introduction of
ldirectord. This is the detail information:

ldirectord

ldirectord is a daemon to monitor and administer real servers in a LVS
cluster of load balanced virtual servers. ldirectord typically used as a
resource for Linux-HA , but can also be run from the command line.

A LVS cluster consists or one or more virtual services each of which may
have zero or more real servers. The IP address of a virtual service is
what end-users connect to and is typically advertised over DNS. When a
connection is made to a virtual service, it is allocated a real server,
and all packets for this connection are forwarded to this real server. A
more detailed overview of LVS can be found here.

ldirectord has a configuration file which specifies the virtual services
and their associated real servers. When ldirectord is initialised it
creates the virtual services for the clutster.

ldirectord monitors the health of the real servers by periodically
requesting a known URL and checking that the response contains an
expected response. If a real server fails then the server is removed and
will be reactivated once it comes back on line. If all the real servers
are down then a fall-back server is inserted into the pool, which will
made quiescent one of the real web servers comes back on line.
Typically, the fall-back server is localhost. If an HTTP virtual service
is being provided then it is useful to run an Apache HTTP server that
returns a page indicating that the service is temporarily inaccessible.

 

In my opinion, it's not used for accessing MySQL. And it can't solver my
problem. Thanks all the same.

Now my application access a single MySQL server. I want to implement HA,
and use MySQL Cluster. 

So, I want to know if I upgrade to MySQL Cluster, then how to modify my
application to access MySQL Cluster.

 

 

Thanks for Regards, Andrew's help.

I searched on the Internet, and find two parameters in JDBC, like this:

(a)failOverReadOnly When failing over in autoReconnect mode, should the
connection be set to 'read-only'? true 3.0.12

(b)loadBalanceStrategy If using a load-balanced connection to connect to
SQL nodes in a MySQL Cluster/NDB configuration (by using the URL prefix
"jdbc:mysql:loadbalance://"), which load balancing algorithm should the
driver use: (1) "random" - the driver will pick a random host for each
request. This tends to work better than round-robin, as the randomness
will somewhat account for spreading loads where requests vary in
response time, while round-robin can sometimes lead to overloaded nodes
if there are variations in response times across the workload. (2)
"bestResponseTime" - the driver will route the request to the host that
had the best response time for the previous transaction. random 5.0.6

 

I think I can implement load balancing and fail-over by the way of
modifying JDBC's parameters.

 

Then could someone give an example of using JDBC to implement load
balancing and fail-over, thanks.

 


Thread
about how to implement load balancing and fail over automaticallyPeter Chen12 Jan 2010
  • RE: about how to implement load balancing and fail over automaticallyAndrew Morgan12 Jan 2010
    • RE: about how to implement load balancing and fail over automaticallyPeter Chen8 Mar 2010
    • RE: about how to implement load balancing and fail over automaticallyPeter Chen8 Mar 2010
      • Re: about how to implement load balancing and fail over automaticallyYousuf8 Mar 2010
        • RE: about how to implement load balancing and fail over automaticallyPeter Chen8 Mar 2010
        • Re: about how to implement load balancing and fail over automaticallyDetlef Ulherr8 Mar 2010
          • RE: about how to implement load balancing and fail over automaticallyPeter Chen8 Mar 2010
      • Re: about how to implement load balancing and fail over automaticallyMalte Geierhos8 Mar 2010
        • RE: about how to implement load balancing and fail over automaticallyPeter Chen8 Mar 2010
  • Re: about how to implement load balancing and fail overautomaticallyRichard McCluskey12 Jan 2010
    • Re: about how to implement load balancing and fail over automaticallylonetwin12 Jan 2010
  • RE: about how to implement load balancing and fail over automaticallyPeter Chen13 Jan 2010
    • RE: about how to implement load balancing and fail over automaticallyJeff Sturm13 Jan 2010
      • RE: about how to implement load balancing and fail overautomaticallyRichard McCluskey13 Jan 2010