[GLB of Mysql routing middleware]

GLB (Galera Load Balancer) is a TCP load balancer similar to Pen, its function is not as powerful as Pen, its main purpose is to be a very fast TCP protocol proxy. By taking advantage of multi-core CPUs, GLB is significantly faster.

 

 

Pen is a load balancer that supports UDP and TCP base protocols such as HTTP and SMTP, allows multiple servers to appear as one externally, and can automatically detect distributed clients on available servers and stopped servers. Pen provides high availability, high performance features.

The load algorithm will continue to track clients and will also try to send the server the last time they accessed it. The client table has a large number of slots (2048 by default, can be set via command line arguments). When the table is full, the currently least used one will be thrown out and replaced with a new one.

This is a simple prioritized round robin algorithm that sends clients to different servers repeatedly.

When the Pen detects that a server is unavailable, it scans to start other servers, thus avoiding load balancing and "smoothing" failures.

 

 

Galera Load Balancer 0.9.2 includes a "single" load balancing strategy that directs all connections to the single highest weighted target, the --top option is used to force load balancing only on the highest weighted target node, the SO_KEEPALIE option Used to detect failed connections to the target node.

 

 

Galera Cluster guarantees node consistency regardless of where and when the query is issued. In other words, you are free to choose a load-balancing approach that best suits your purposes. If you decide to place the load balancing mechanism between the database and the application, you can consider, for example, the following tools:

1)HAProxy an open source TCP/HTTP load balancer.

2)Pen another open source TCP/HTTP load balancer. Pen performs better than HAProxy on SQL traffic.

3)Galera Load Balancer inspired by Pen, but is limited to balancing generic TCP connections only.

 

CONFIGURATION

When you run Galera Load Balancer, you can configure its use through the command-line options, which you can reference through the --help command. For users that run Galera Load Balancer as a service, you can manage it through the glbd.cfg configuration file.

  • LISTEN_ADDR Defines the address that Galera Load Balancer monitors for incoming client connections.
  • DEFAULT_TARGETS Defines the default servers that Galera Load Balancer routes incoming client connections to. For this parameter, use the IP addresses for the nodes in your cluster.
  • OTHER_OPTIONS Defines additional Galera Load Balancer options, such as the balancing policy you want to use. Use the same format as they would appear on the command-line.

For instance,

# Galera Load Balancer COnfigurations
LISTEN_ADDR="8010"
DEFAULT_TARGETS="192.168.1.1 192.168.1.2 192.168.1.3"
OTHER_OPTIONS="--random --top 3"

Destination Selection Policies

Galera Load Balancer, both the system daemon and the shared library, support five destination selection policies. When you run it from the command-line, you can define these using the command-line arguments, otherwise add the arguments to the OTHER_OPTIONS parameter in theglbd.cfg configuration file.

  • Least Connected Directs new connections to the server using the smallest number of connections possible, which is adjusted for the server weight. This is the default policy.
  • Round Robin Directs new connections to the next destination in the circular order list. You can enable it through the –round option.
  • Single Directs all connections to the single server with the highest weight of those available. Routing continues to that server until it fails or a server with a higher weight becomes available. You can enable it through the –single option.
  • Random Directs connections randomly to available servers. You can enable it through the–random option
  • Source Tracking Directs connections originating from the same address to the same server. You can enable it through the –source option.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326391771&siteId=291194637