zoukankan      html  css  js  c++  java
  • keepalived ,lvs,tomcat 高可用,高并发,高性能 应用架构的搭建

    keepalived ,lvs,tomcat 高可用,高并发,高性能  应用架构的搭建

    keepalived ,lvs 搭建在同一台服务器上,两个tomcat 分别在一个tomcat上 


    四台服务器版本 :  centos 6.5

    yum install ipvsadm -y

    keepalived : etc/keepalived/keepalived.conf


    ! Configuration File for keepalived

    global_defs {
       notification_email {
         root@localhost
       }
       notification_email_from Alexandre.Cassen@firewall.loc
       smtp_server 192.168.184.178
       smtp_connect_timeout 30
       router_id LVS_DEVEL
    }

    vrrp_instance VI_1 {
        state MASTER
        interface eth0
        virtual_router_id 51
        priority 100
        advert_int 1
        authentication {
            auth_type PASS
            auth_pass 1111
        }
        virtual_ipaddress {
            192.168.184.222/24 dev eth0 label eth0:A
        }
    }

    virtual_server 192.168.184.222 80 {
        delay_loop 6
        lb_algo wrr
        lb_kind DR
        nat_mask 255.255.255.0
        persistence_timeout 50
        protocol TCP

        real_server 192.168.184.188 80 {
            weight 1
            HTTP_GET {
                url {
                  path /
                  status_code 200
            }
                connect_timeout 3
                nb_get_retry 3
                delay_before_retry 3
            }
        }  
        real_server 192.168.184.168 80 {
            weight 1
            HTTP_GET {
                url {
                  path /
                  status_code 200
                }
                connect_timeout 3
                nb_get_retry 3
                delay_before_retry 2
            }
        }
    }



    =================

    ! Configuration File for keepalived

    global_defs {
       notification_email {
         root@localhost
       }
       notification_email_from Alexandre.Cassen@firewall.loc
       smtp_server 192.168.184.178
       smtp_connect_timeout 30
       router_id LVS_DEVEL
    }

    vrrp_instance VI_1 {
        state BACKUP
        interface eth0
        virtual_router_id 51
        priority 10
        advert_int 1
        authentication {
            auth_type PASS
            auth_pass 1111
        }
        virtual_ipaddress {
            192.168.184.222/24 dev eth0 label eth0:A
        }
    }

    virtual_server 192.168.184.222 80 {
        delay_loop 6
        lb_algo wrr
        lb_kind DR
        nat_mask 255.255.255.0
        persistence_timeout 50
        protocol TCP

        real_server 192.168.184.188 80 {
            weight 1
            HTTP_GET {
                url {
                  path /
                  status_code 200
            }
                connect_timeout 3
                nb_get_retry 3
                delay_before_retry 3
            }
        }
        real_server 192.168.184.168 80 {
            weight 1
            HTTP_GET {
                url {
                  path /
                  status_code 200
                }
                connect_timeout 3
                nb_get_retry 3
                delay_before_retry 2
            }
        }
    }


       


    ========================

      tomcat 服务器上需要配置 在设备上配置lo:A  IP地址



  • 相关阅读:
    PHP 速度测试函数
    ajax的简单应用之快速入门
    PHP漏洞详解
    jQuery Ajax 实例 全解析
    2007年最后的一天
    近来心情格外的郁闷
    使用 Ajax 实现 lightbox
    GridView删除,编辑应用
    完美的wsus客户端注册表文件
    VISTA桌面显示Internet Explorer
  • 原文地址:https://www.cnblogs.com/TendToBigData/p/10501468.html
Copyright © 2011-2022 走看看