keepalived ,lvs,tomcat 高可用,高并发,高性能 应用架构的搭建
2016-05-15 16:36
791 查看
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地址
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地址
相关文章推荐
- keepalived ,egnix ,tomcat 高可用,高并发 应用架构的搭建
- tomcat配置虚拟目录和虚拟主机
- linux企业常用服务---部署Nginx+Tomcat负载均衡集群
- tomcat下log4j接管日志并按日期分割
- JBOSS配置+修改端口号+与Tomcat比较
- 启动tomcat出现 a java Exception has occured 解决方法
- Maven远程部署Tomcat
- Java知识:(3)Tomcat
- tomcat环境下服务器文件句柄耗尽(Too Many Open Files)的问题排查
- Tomcat-connector的微调(1): acceptCount参数(socket的backlog)(重要)
- Tomcat探秘(1):Tomcat是什么?
- apache2.4 + mod_proxy + tomcat7 配置集群和负载均衡
- tomcat JVM 性能优化
- tomcat中如何运行war包呢
- tomcat启动时自动运行代码
- jdk tomcat 安装
- tomcat 下配置ajax 跨域 访问
- myeclipse中配置tomcat
- Tomcat安装实战
- 修改log4j配置文件来减小Linux系统tomcat/logs目录下的catalina.out文件的大小