在使用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
[[email protected] ~]# tail -n100 /var/log/messages ip_vs: Unknown symbol ip6_local_outip_vs: Unknown symbol ip6_route_me_harderip_vs: Unknown symbol ipv6_dev_get_saddrip_vs: Unknown symbol ip6_route_outputip_vs: Unknown symbol icmpv6_send
根据提示,没有开启ipv6的功能
查看IP信息,果然没有开启ipv6
[[email protected] ~]# ip a1: 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 lo2: 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 eth0inet 172.16.100.10/24 scope global secondary eth0
修改ipv6相关配置(原来是我初始化时候将IPV6功能给关闭了)
[[email protected] ~]# vim /etc/modprobe.d/modprobe.confoptions ipv6 disable=1alias net-pf-10 offalias ipv6 offinstall ipv6 /bin/true [[email protected] ~]$ vim /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=eth0TYPE=EthernetONBOOT=yesNM_CONTROLLED=noBOOTPROTO=staticIPADDR=192.168.60.63NETMASK=255.255.255.0GATEWAY=192.168.60.1DNS1=168.95.1.1DNS2=8.8.8.8IPV6INIT=NO
再次查看ip信息,已经有了ipv6相关信息
[[email protected] ~]# ip a1: 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 forever2: 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发现服务已经正常
[[email protected] ~]# ipvsadmIP Virtual Server version 1.2.1 (size=4096)Prot LocalAddress:Port Scheduler Flags -> RemoteAddress:Port Forward Weight ActiveConn InActConn
这可能只是导致这个问题的其中一个原因,在这里记录一下,以便大家参考,
请查看日志/var/log/messages以及dmesg进行排错
时间: 2024-10-20 03:52:14