Keepalived, Lvs,tomcat high availability, high concurrency, high-performance application Architecture __nginx

Source: Internet
Author: User
Tags tomcat server

Keepalived, Lvs,tomcat high availability, high concurrency, high-performance application architecture

Keepalived, LVS built on the same server, two Tomcat on a tomcat


Four server versions: 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 {
StateMASTER
Interface eth0
VIRTUAL_ROUTER_ID 51
Priority -
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
}
Connect_timeout 3
Nb_get_retry 3
Delay_before_retry 3
}
}
Real_server192.168.184.168{
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
}
}
}





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

Configuring the Lo:a IP address on the device is required on the Tomcat server



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.