在使用yum install ipvsadm -y安装lvs管理工具后,发现指令ipvsadm相关指令一直报错:
FATAL: Error inserting ip_vs (/lib/modules/2.6.32-358.18.1.el6.x86_64/kernel/net/netfilter/ipvs/ip_vs.ko): Unknown symbol in module, or unknown parameter (see dmesg) Can’t initialize ipvs: Protocol not available Are you sure that IP Virtual Server is built in the kernel or as module?
在网络上搜索相关文档,说是有模版未载入,于是执行加载模块
modprobe ip_vs
但是还是有报错,无法载入模块
最开始我以为是模块加载问题,但是后来注意到后面提示see dmesg
于是开始查看日志,或者根据提示执行dmesg
[root@lvs ~]# tail -n100 /var/log/messages
ip_vs: Unknown symbol ip6_local_out
ip_vs: Unknown symbol ip6_route_me_harder
ip_vs: Unknown symbol ipv6_dev_get_saddr
ip_vs: Unknown symbol ip6_route_output
ip_vs: Unknown symbol icmpv6_send
根据提示,没有开启ipv6的功能
查看IP信息,果然没有开启ipv6
[root@lvs ~]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 52:54:02:25:13:78 brd ff:ff:ff:ff:ff:ff
inet 172.16.100.2/24 brd 172.16.100.255 scope global eth0
inet 172.16.100.10/24 scope global secondary eth0
修改ipv6相关配置(原来是我初始化时候将IPV6功能给关闭了)
[root@lvs ~]# vim /etc/modprobe.d/modprobe.conf
options ipv6 disable=1
alias net-pf-10 off
alias ipv6 off
install ipv6 /bin/true
[root@lvs ~]$ vim /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=static
IPADDR=192.168.60.63
NETMASK=255.255.255.0
GATEWAY=192.168.60.1
DNS1=168.95.1.1
DNS2=8.8.8.8
IPV6INIT=NO
再次查看ip信息,已经有了ipv6相关信息
[root@i-18p5ajot ~]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 52:54:02:25:13:78 brd ff:ff:ff:ff:ff:ff
inet 172.16.100.2/24 brd 172.16.100.255 scope global eth0
inet 172.16.100.10/24 scope global secondary eth0
inet6 fe80::5054:2ff:fe25:1378/64 scope link
valid_lft forever preferred_lft forever
执行ipvsadm发现服务已经正常
[root@lvs ~]# ipvsadm
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
-> RemoteAddress:Port Forward Weight ActiveConn InActConn
这可能只是导致这个问题的其中一个原因,在这里记录一下,以便大家参考,
请查看日志/var/log/messages以及dmesg进行排错
本文出自 “�W依雨心” 博客,谢绝转载!