• 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地址



  • 相关阅读:
    java.io.FileNotFoundException: D:workspacegbrmWebRoot空缺职位列表20140414093026.xls (系统找不到指定的路径。)
    select * from (select t.*,rownum as rowno from (select * from j_kqzw where 1=1 and DEADLINE >='2013-04-14' and DEADLINE <='2014-04-14' ) t)where rown
    hibernate的映射文件字段长度和数据库里面的字段长度
    八门神器
    计算机
    c语言
    捕鱼达人
    桂林力港网络科技有限公司
    cocos2d-x
    3gp 编辑
  • 原文地址:https://www.cnblogs.com/TendToBigData/p/10501468.html
Copyright © 2020-2023  润新知