Today Due to one of my Client Requirement i supposed to install and configure a High Availability, Proxying, Application Load Balancer for Mysql ,in the current scenario we are having two Mysql server(Both were running As Multi-Master Replication nodes) and we needed all the traffic coming from Applications should be load balance to both the Mysql server and there should be Fail-over Facility too. To achieve the goal i used an Opensource tool named HA proxy and after using it all goals seems to be achived now .
So i m sharing the steps pls go though below .
What basically HA Proxy is ??
HAProxy is an opensource free, very fast and reliable solution offering high availability, load balancing, and proxying for TCP and HTTP-based applications. It is particularly suited for web sites,databases and Application crawling under very high loads.
Steps of Installation And configuration :-
root@linuz-akhil:~# wget -c http://haproxy.1wt.eu/download/1.2/src/haproxy-1.2.17.tar.gz
root@linuz-akhil:~# tar -zxf haproxy-1.2.17.tar.gz
root@linuz-akhil:~# cd haproxy-1.2.17
root@linuz-akhil:~# make
root@linuz-akhil:~# cp haproxy /usr/sbin/haproxy
root@linuz-akhil:~# wget -c http://layer1.rack911.com/haproxy/haproxy.init -O /etc/init.d/haproxy ## Download its script file
Create a HA Proxy config file using vim /etc/haproxy.cfg and add below setting .
root@linuz-akhil:~# vim /etc/haproxy.cfg
###
Changes Done by tuxamit
global
maxconn 4096 # Total Max Connections. This is dependent on ulimit
daemon
nbproc 4 # Number of processing cores.
defaults
mode http
clitimeout 60000
srvtimeout 30000
contimeout 4000
option httpclose # Disable Keepalive
##Ip and port in which HA proxy will bind, All the Mysql traffic will be hooked to below ip and port and then HA proxy will share the traffic in round robin algo to given Mysql Servers ####
listen Mysql_proxy 10.x.x.74:3306 ##
mode tcp
balance roundrobin
###### Add you Mysql Server below ##
server Mysql_db1 10.x.x.72:3306 check
server Mysql_db2 10.x.x.73:3306 check
######Config Completed
root@linuz-akhil:~# service haproxy start ; chkconfig --add haproxy ; chkconfig haproxy on
All Done! Load Balancing and fail-over though HA Proxy on host 10.x.x.74 is now working fine for Mysql service listening on 3306 port at hosts 10.x.x.72 and 10.x.x.73.
So i m sharing the steps pls go though below .
What basically HA Proxy is ??
HAProxy is an opensource free, very fast and reliable solution offering high availability, load balancing, and proxying for TCP and HTTP-based applications. It is particularly suited for web sites,databases and Application crawling under very high loads.
Steps of Installation And configuration :-
root@linuz-akhil:~# wget -c http://haproxy.1wt.eu/download/1.2/src/haproxy-1.2.17.tar.gz
root@linuz-akhil:~# tar -zxf haproxy-1.2.17.tar.gz
root@linuz-akhil:~# cd haproxy-1.2.17
root@linuz-akhil:~# make
root@linuz-akhil:~# cp haproxy /usr/sbin/haproxy
root@linuz-akhil:~# wget -c http://layer1.rack911.com/haproxy/haproxy.init -O /etc/init.d/haproxy ## Download its script file
Create a HA Proxy config file using vim /etc/haproxy.cfg and add below setting .
root@linuz-akhil:~# vim /etc/haproxy.cfg
###
Changes Done by tuxamit
global
maxconn 4096 # Total Max Connections. This is dependent on ulimit
daemon
nbproc 4 # Number of processing cores.
defaults
mode http
clitimeout 60000
srvtimeout 30000
contimeout 4000
option httpclose # Disable Keepalive
##Ip and port in which HA proxy will bind, All the Mysql traffic will be hooked to below ip and port and then HA proxy will share the traffic in round robin algo to given Mysql Servers ####
listen Mysql_proxy 10.x.x.74:3306 ##
mode tcp
balance roundrobin
###### Add you Mysql Server below ##
server Mysql_db1 10.x.x.72:3306 check
server Mysql_db2 10.x.x.73:3306 check
######Config Completed
root@linuz-akhil:~# service haproxy start ; chkconfig --add haproxy ; chkconfig haproxy on
All Done! Load Balancing and fail-over though HA Proxy on host 10.x.x.74 is now working fine for Mysql service listening on 3306 port at hosts 10.x.x.72 and 10.x.x.73.
Comments
Post a Comment