????MySQL??????????????????????????????д?????????????????????????????????????????????????????????MySQL????????????Щ????????????????????????δ?????????????????????????????master崵??????????л??????????master????????????????л???
??????????????????????????LVS+Keepalived???????????MySQL??????????????????????
????Keepalived??LVS????
????Keepalived?????????VRRP??????·??????Э?飩??????????????????????????????????????????Keepalived??????????????????????????????????洢?????????????????????????LVS+Keepalived??Nginx+Keepalived????
????LVS(Linux Virtual Server)????????????????????????????????????1998??5?????????????????????й?????????????????????????
????LVS????????????????????????????????LVS?????????????????У???????????????Director Server???????????????????????Real Server??????????????????LVS??????????

????LVS??????????????????DR??Direct Routing ???·?????TUN(Tunneling IP???????NAT??Network Address Translation ?????????????????TUN????????????Real Server??????????з????????IP???Э?飻DR????????????Real Server??????????Director Server?????????????????????????Σ?NAT????????????????????Real Server????????е?????????????????Director Server???н????????????Ч??? ????LVS?????????10?е????????????rr??wrr??lc??wlc??lblc??lblcr??dh??sh??sed??nq
?????????LVS?????μ? ??????
?????????н?????LVS???MySQL???д???????Keepalived????????????????
????LVS+Keepalived????
???????????
????LVS1??192.168.1.2
????LVS2??192.168.1.11
????MySQL Server1??192.168.1.5
????MySQL Server2??192.168.1.6
????VIP??192.168.1.100
????OS: CentOS 6.4

????Keepalive???
????keepalived??????
???????????????????
????# yum install -y kernel-devel openssl openssl-devel
???????keepalived??/usr/local/??????????????????
# ./configure --prefix=/usr/local/keepalived --with-kernel-dir=/usr/src/kernels/2.6.32-431.5.1.el6.x86_64/
Keepalived configuration
------------------------
Keepalived version       : 1.2.13
Compiler                 : gcc
Compiler flags           : -g -O2
Extra Lib                : -lssl -lcrypto -lcrypt
Use IPVS Framework       : Yes
IPVS sync daemon support : Yes
IPVS use libnl           : No
fwmark socket support    : Yes
Use VRRP Framework       : Yes
Use VRRP VMAC            : Yes
SNMP support             : No
SHA1 support             : No
Use Debug flags          : No
# make