标签:wal glob weight clu 图片 客户 添加 vrrp rtu
一、Keepalived双主模式+DNS轮询机制作用作用:在单主模式下,备机通常会以等待状态放着,不接受任何数据,导致所有数据请求只往主机-负载均衡发送,做成资源浪费;而双主模式,即创造两个VIP,两个VIP分别放在两台负载均衡的机器上,同时两台主机均为对方的备机,以作VIP的漂移,服务接管作用,加入DNS轮询机制,使客户端的域名分别依次解释到两个VIP上,形成两台负载均衡主机同时对外提供服务。同时也解决了单主模式下的单机性能屏颈。
! Configuration File for keepalived
global_defs {
notification_email {
345619885@qq.com
}
notification_email_from Alexandre.Cassen@firewall.loc
smtp_server 192.168.200.1
smtp_connect_timeout 30
router_id lb01
}
vrrp_instance VI_1 {
state MASTER
interface eth1
virtual_router_id 53
priority 150
advert_int 1
authentication {
auth_type PASS
auth_pass 3333
}
virtual_ipaddress {
10.3.150.200/24 dev eth1 label eth1:1
}
}
vrrp_instance VI_2 {
state BACKUP
interface eth1
virtual_router_id 54
priority 100
advert_int 1
authentication {
auth_type PASS
auth_pass 4444
}
virtual_ipaddress {
10.3.150.201/24 dev eth1 label eth1:1
}
}
! Configuration File for keepalived
global_defs {
notification_email {
345619885@qq.com
}
notification_email_from Alexandre.Cassen@firewall.loc
smtp_server 192.168.200.1
smtp_connect_timeout 30
router_id lb01
}
vrrp_instance VI_1 {
state BACKUP
interface eth1
virtual_router_id 53
priority 100
advert_int 1
authentication {
auth_type PASS
auth_pass 3333
}
virtual_ipaddress {
10.3.150.200/24 dev eth1 label eth1:1
}
}
vrrp_instance VI_2 {
state MASTER
interface eth1
virtual_router_id 54
priority 150
advert_int 1
authentication {
auth_type PASS
auth_pass 4444
}
virtual_ipaddress {
10.3.150.201/24 dev eth1 label eth1:1
}
}
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server 10.3.150.198:80 weight=1;
server 10.3.150.199:80 weight=1;
}
server {
listen 80;
server_name localhost;
location / {
proxy_pass http://server_pools;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}
Keepalived 之 双主模式+DNS轮询机制 实现高负载
标签:wal glob weight clu 图片 客户 添加 vrrp rtu
原文地址:http://blog.51cto.com/12965094/2158011