ipvsadm添加虚拟服务器报错问题
命令和报错如下:
[root@test ~]# ipvsadm -A -t 192.168.113.5:80 -s wwr Memory allocation problem
显示的是内存分配问题,我认为自己处理不了,就想着直接搜索引擎解决,结果按照别人博客的指引查看/var/log/message时,发现其实是调度算法写错了,没有wwr这个模式。。。。
日志查看如下:
[root@test ~]# tail -f /var/log/messages Aug 1 16:36:56 192 chronyd[6203]: Selected source 185.255.55.20 Aug 1 16:37:30 192 systemd: Reloading. Aug 1 16:37:30 192 yum[7888]: Installed: ipvsadm-1.27-7.el7.x86_64 Aug 1 16:39:51 192 kernel: IPVS: Registered protocols (TCP, UDP, SCTP, AH, ESP) Aug 1 16:39:51 192 kernel: IPVS: Connection hash table configured (size=4096, memory=64Kbytes) Aug 1 16:39:51 192 kernel: IPVS: Creating netns size=2048 id=0 Aug 1 16:39:51 192 kernel: IPVS: ipvs loaded. Aug 1 16:39:51 192 kernel: IPVS: Scheduler module ip_vs_wwr not found Aug 1 16:40:05 192 kernel: IPVS: Scheduler module ip_vs_wwr not found Aug 1 16:44:26 192 kernel: IPVS: Scheduler module ip_vs_wwr not found
总结:出现问题,首先应该想到的是查看日志,如果有些服务没有日志,就查看系统日志,如/var/log/messages