- 论坛徽章:
- 1
|
在centos6.7上安装了nginx和keepalived,启动keepalived之后,ip a 发现都没绑定虚拟ip,
然后看keepalived日志发现和别人的不一样,少了不少东西,已经把防火墙关闭了,找了2天还是没找到原因,紧急求教。
日志:
Apr 15 09:11:52 centos67-173 Keepalived_vrrp: Terminating VRRP child process on signal
Apr 15 09:11:59 centos67-173 Keepalived: Starting Keepalived v1.1.15 (04/15,2016)
Apr 15 09:11:59 centos67-173 Keepalived: Starting VRRP child process, pid=26681
Apr 15 09:11:59 centos67-173 Keepalived_vrrp: Using MII-BMSR NIC polling thread...
Apr 15 09:11:59 centos67-173 Keepalived_vrrp: Registering Kernel netlink reflector
Apr 15 09:11:59 centos67-173 Keepalived_vrrp: Registering Kernel netlink command channel
Apr 15 09:11:59 centos67-173 Keepalived_vrrp: Registering gratutious ARP shared channel
Apr 15 09:11:59 centos67-173 Keepalived_vrrp: Configuration is using : 54994 Bytes
我看别人的帖子,之后还有开始心跳,然后加入vrrp什么的,我的怎么到这就结束了,难道是配置有问题?
以下是我的配置:
主ip:192.168.251.173
从ip:192.168.251.135
虚拟ip:192.168.251.141
主的keepalived配置- ! Configuration File for keepalived
- global_defs {
- router_id LVS_DEVEL
- }
- vrrp_script check_run {
- script "/usr/script/nginx_check.sh"
- interval 5
- weight 2
- }
- vrrp_sync_group VG1 {
- group {
- VI_1
- }
- }
- vrrp_instance VI_1 {
- state MASTER
- interface eth0
- virtual_router_id 51
- priority 100
- advert_int 1
- authentication {
- auth_type PASS
- auth_pass 1111
- }
- track_script {
- check_run
- }
- virtual_ipaddress {
- 192.168.251.141
- }
- }
复制代码 从的keepalived配置:- ! Configuration File for keepalived
- global_defs {
- router_id LVS_DEVEL
- }
- vrrp_script check_run {
- script "/usr/script/nginx_check.sh"
- interval 5
- weight 2
- }
- vrrp_sync_group VG1 {
- group {
- VI_1
- }
- }
- vrrp_instance VI_1 {
- state BACKUP
- interface eth0
- virtual_router_id 51
- priority 99
- advert_int 1
- authentication {
- auth_type PASS
- auth_pass 1111
- }
- track_script {
- check_run
- }
- virtual_ipaddress {
- 192.168.251.141
- }
- }
复制代码 2台机器的ifconfig:
==============================================
[root@centos67-173 ~]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:0C:29:3A:71:91
inet addr:192.168.251.173 Bcast:192.168.251.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe3a:7191/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:523186 errors:0 dropped:0 overruns:0 frame:0
TX packets:16761 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:38119045 (36.3 MiB) TX bytes:2978677 (2.8 MiB)
eth1 Link encap:Ethernet HWaddr 00:0C:29:3A:71:9B
inet6 addr: fe80::20c:29ff:fe3a:719b/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:506349 errors:0 dropped:0 overruns:0 frame:0
TX packets:3 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:33355187 (31.8 MiB) TX bytes:258 (258.0 b)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:4 errors:0 dropped:0 overruns:0 frame:0
TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:240 (240.0 b) TX bytes:240 (240.0 b)
==================================
[root@localhost ~]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:0C:29:7B:7C:3F
inet addr:192.168.251.135 Bcast:192.168.251.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe7b:7c3f/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:521883 errors:0 dropped:0 overruns:0 frame:0
TX packets:15261 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:38008581 (36.2 MiB) TX bytes:907613 (886.3 KiB)
eth1 Link encap:Ethernet HWaddr 00:0C:29:7B:7C:49
inet6 addr: fe80::20c:29ff:fe7b:7c49/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:506348 errors:0 dropped:0 overruns:0 frame:0
TX packets:3 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:33354478 (31.8 MiB) TX bytes:258 (258.0 b)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:4 errors:0 dropped:0 overruns:0 frame:0
TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:240 (240.0 b) TX bytes:240 (240.0 b)
|
|