背景:
阅读新闻
LVS+Keepalived+Squid+Nginx+MySQL主从 高性能集群架构配置
[日期:2012-07-16] 来源:Linux社区 作者:rfyiamcool [字体:]
使配置立即生效:
/sbin/sysctl -p
LVS + keepalived 配置~~~~~
master的配置
mkdir /usr/local/src/lvs cd /usr/local/src/lvs wget wget lsmod |grep ip_vs uname -r ln -s /usr/src/kernels/$(uname -r)/usr/src/linux#ln -s /usr/src/kernels/2.6.* /usr/src/linux tar zxvf ipvsadm-1.24.tar.gz cd ipvsadm-1.24 make && make install tar zxvf keepalived-1.1.15.tar.gz cd keepalived-1.1.15 ./configure&& make && make install cp /usr/local/etc/rc.d/init.d/keepalived /etc/rc.d/init.d/ cp /usr/local/etc/sysconfig/keepalived /etc/sysconfig/ mkdir /etc/keepalived cp /usr/local/etc/keepalived/keepalived.conf /etc/keepalived/ cp /usr/local/sbin/keepalived /usr/sbin/ #you can service keepalived start|stop cat >> /usr/local/etc/keepalived/keepalived.conf <<EOF ! Configuration File for keepalived global_defs { notification_email { rfyiamcool@163.com } notification_email_from Alexandre.Cassen@firewall.loc smtp_server 127.0.0.1 router_id LVS_DEVEL } vrrp_instance VI_1 { state MASTER # BACKUP interface eth0 virtual_router_id 51 priority 100 # 另一端 90 advert_int 1 authentication { auth_type PASS auth_pass 1111 } virtual_ipaddress { 10.10.10.88 } } virtual_server 10.10.10.88 80 { delay_loop 6 lb_algo rr lb_kind DR persistence_timeout 50 protocol TCP real_server 10.10.10.21 80 { weight 3 TCP_CHECK { connect_timeout 10 nb_get_retry 3 delay_before_retry 3 connect_port 80 } } real_server 10.10.10.22 80 { weight 3 TCP_CHECK { connect_timeout 10 nb_get_retry 3 delay_before_retry 3 connect_port 80 } real_server 10.10.10.23 80 { weight 3 TCP_CHECK { connect_timeout 10 nb_get_retry 3 delay_before_retry 3 connect_port 80 } } } EOF service keepalived start
相关资讯
本文评论 查看全部评论 (0)
尊重网上道德,遵守中华人民共和国的各项有关法律法规 承担一切因您的行为而直接或间接导致的民事或刑事法律责任 本站管理人员有权保留或删除其管辖留言中的任意内容 本站有权在网站内转载或引用您的评论 参与本评论即表明您已经阅读并接受上述条款
评论声明
最新资讯