就喜欢你想打又打不着我的样子
2017-03-06 02:41LVS+nginx配置完成后访问VIP没有进行转发。
10MASTER级配置:
! Configuration File for keepalived
global_defs {
router_id LVS_DEVEL
}
vrrp_instance VI_1 {
state MASTER
interface eth0
virtual_router_id 100
priority 150
advert_int 1
authentication {
auth_type PASS
auth_pass 1111
}
virtual_ipaddress {
10.23.52.200
}
}
virtual_server 10.23.52.200 80{
delay_loop 6
lb_algo wrr
lb_kind DR
persistence_timeout 1
protocol TCP
real_server 10.23.52.113 80{
weight 1
TCP_CHECK {
connect_port 80
connect_timeout 3
nb_get_retry 3
delay_before_:retry 3
}
}
real_server 10.23.52.114 80{
weight 1
TCP_CHECK {
connect_port 80
connect_timeout 3
nb_get_retry 3
delay_before_retry 3
}
}
}
查看监听情况:
[root@localhost keepalived]# ipvsadm -ln
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
-> RemoteAddress:Port Forward Weight ActiveConn InActConn
TCP 10.23.52.200:80 wrr persistent 1
-> 10.23.52.113:80 Route 1 0 0
-> 10.23.52.114:80 Route 1 0 0
[root@localhost keepalived]#
查看日志:
[root@localhost keepalived]# tail -f /var/log/messages
Mar 6 10:31:25 localhost kernel: IPVS: [wrr] scheduler registered.
Mar 6 10:31:26 localhost Keepalived_vrrp: VRRP_Instance(VI_1) Transition to MASTER STATE
Mar 6 10:31:27 localhost Keepalived_vrrp: VRRP_Instance(VI_1) Entering MASTER STATE
Mar 6 10:31:27 localhost Keepalived_vrrp: VRRP_Instance(VI_1) setting protocol VIPs.
Mar 6 10:31:27 localhost Keepalived_vrrp: VRRP_Instance(VI_1) Sending gratuitous ARPs on eth0 for 10.23.52.200
Mar 6 10:31:32 localhost Keepalived_vrrp: VRRP_Instance(VI_1) Sending gratuitous ARPs on eth0 for 10.23.52.200
Mar 6 10:32:08 localhost Keepalived_healthcheckers: TCP connection to [10.23.52.113]:80 failed !!!
Mar 6 10:32:08 localhost Keepalived_healthcheckers: Removing service [10.23.52.113]:80 from VS [10.23.52.200]:80
Mar 6 10:32:20 localhost Keepalived_healthcheckers: TCP connection to [10.23.52.113]:80 success.
Mar 6 10:32:20 localhost Keepalived_healthcheckers: Adding service [10.23.52.113]:80 to VS [10.23.52.200]:80
访问真是IP:
[root@localhost keepalived]# curl 10.23.52.113
<!DOCTYPE html>
Welcome to nginx! body { width: 35em; margin: 0 auto; font-family: Tahoma, Verdana, Arial, sans-serif; }
Welcome to nginx!
If you see this page, the nginx web server is successfully installed and working. Further configuration is required.
For online documentation and support please refer to
nginx.org.
Commercial support is available at
nginx.com.
Thank you for using nginx.我是113号机器
[root@localhost keepalived]#
访问VIP一直没有反应:
[root@localhost keepalived]# curl 10.23.52.200
curl: (7) couldn't connect to host
[root@localhost keepalived]#
- 点赞
- 回答
- 收藏
- 复制链接分享
1条回答
为你推荐
- linux负载均衡,利用VM虚拟机的LVS搭建如何设置IP?
- linux
- 负载均衡
- centos
- 1个回答
- 关于负载均衡
- apache
- 负载均衡
- tomcat
- 0个回答
- 有关分布式系统的负载均衡问题
- dubbo
- spring
- 负载均衡
- nginx
- 分布式
- 2个回答
- 急急急!MFC自绘ListCtrl控件后不能insertitem,只要插入行执行就报错
- mfc
- 控件
- 自绘
- list
- 1个回答
- LVS高性能高可用:TCP socket bind failed. Reschedu....
- keepalived
- 负载均衡
- lvs 高性能 高可用
- 2个回答