日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

ipvsadm+keepalived安装错误解决

發布時間:2025/5/22 编程问答 24 豆豆
生活随笔 收集整理的這篇文章主要介紹了 ipvsadm+keepalived安装错误解决 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

1、環境:
rhel 6.0+ipvsadm-1.2.6+keepalived-1.2.5
2、安裝

實現LVS/DR最重要的兩個東西是ipvs內核模塊和ipvsadm工具包,現在的系統已經包含ip_vs模塊

1)檢查內核模塊,看一下ip_vs 是否被加載

lsmod |grep ip_vs

ip_vs 35009 0

如果沒有顯示,則說明沒有加載,執行命令 modprobe ip_vs 就可以把ip_vs模塊加載到內核

#modprobe ip_vs 然后再查看就有了。
2)安裝ipvsadm

查看內核版本 #uname -r
2.6.32-71.el6.x86_64

先把目錄/usr/src/kernels/2.6.32-71.el6.x86_64鏈接為/usr/src/linux,命令如下

ln –s /usr/src/2.6.32-71.el6.x86_64 /usr/src/linux

解壓ipvsadm-1.24.tar.gz,執行"make;但是報錯了,類似的錯誤信息大概如下

make -C libipvs
make[1]: Entering directory /usr/src/ipvsadm-1.26/libipvs'<br/>gcc -Wall -Wunused -Wstrict-prototypes -g -fPIC -DLIBIPVS_USE_NL -DHAVE_NET_IP_VS_H -c -o libipvs.o libipvs.c<br/>In file included from libipvs.h:13,<br/>from libipvs.c:23:<br/>ip_vs.h:15:29: error: netlink/netlink.h: No such file or directory<br/>ip_vs.h:16:31: error: netlink/genl/genl.h: No such file or directory<br/>ip_vs.h:17:31: error: netlink/genl/ctrl.h: No such file or directory<br/>In file included from libipvs.h:13,<br/>from libipvs.c:23:<br/>ip_vs.h:520: error: array type has incomplete element type<br/>ip_vs.h:521: error: array type has incomplete element type<br/>libipvs.c:57: warning: implicit declaration of function ‘nlmsg_alloc’<br/>libipvs.c:57: warning: assignment makes pointer from integer without a cast<br/>libipvs.c:61: warning: implicit declaration of function ‘genlmsg_put’<br/>libipvs.c:61: error: ‘NL_AUTO_PID’ undeclared (first use in this function)<br/>libipvs.c:61: error: (Each undeclared identifier is reported only once<br/>libipvs.c: In function ‘ipvs_add_service’:<br/>libipvs.c:255: error: too many arguments to function ‘ipvs_nl_send_message’<br/>libipvs.c: In function ‘ipvs_update_service’:<br/>libipvs.c:276: error: too many arguments to function ‘ipvs_nl_send_message’<br/>libipvs.c: In function ‘ipvs_del_service’:<br/>libipvs.c:296: error: too many arguments to function ‘ipvs_nl_send_message’<br/>libipvs.c: In function ‘ipvs_zero_service’:<br/>libipvs.c:473: warning: assignment makes pointer from integer without a cast<br/>libipvs.c:483: error: too many arguments to function ‘ipvs_nl_send_message’<br/>libipvs.c: In function ‘ipvs_stop_daemon’:<br/>libipvs.c:504: warning: assignment makes pointer from integer without a cast<br/>libipvs.c:514: error: too many arguments to function ‘ipvs_nl_send_message’<br/>libipvs.c: At top level:<br/>libipvs.c:1051: error: ‘NL_OK’ undeclared (first use in this function)<br/>libipvs.c: In function ‘ipvs_get_daemon’:<br/>libipvs.c:1071: error: ‘NLM_F_DUMP’ undeclared (first use in this function)<br/>libipvs.c:1072: error: too many arguments to function ‘ipvs_nl_send_message’<br/>make[1]: *** [libipvs.o] Error 1<br/>make[1]: Leaving directory/usr/src/ipvsadm-1.26/libipvs'
make: *** [libs] Error 2

解決:yum install libnl libpopt

再次make,還是有報錯
類似如 /usr/src/ipvsadm-1.26/ipvsadm.c:667: undefined reference to poptStrerror'<br/>/usr/src/ipvsadm-1.26/ipvsadm.c:667: undefined reference topoptBadOption'
/usr/src/ipvsadm-1.26/ipvsadm.c:670: undefined reference to poptFreeContext'<br/>/usr/src/ipvsadm-1.26/ipvsadm.c:677: undefined reference topoptGetArg'
/usr/src/ipvsadm-1.26/ipvsadm.c:678: undefined reference to poptGetArg'<br/>/usr/src/ipvsadm-1.26/ipvsadm.c:679: undefined reference topoptGetArg'
/usr/src/ipvsadm-1.26/ipvsadm.c:690: undefined reference to poptGetArg'<br/>/usr/src/ipvsadm-1.26/ipvsadm.c:693: undefined reference topoptFreeContext'
collect2: ld returned 1 exit status
make: *** [ipvsadm] Error 1

解決:yum install popt-static (ftp://ftp.muug.mb.ca/mirror/centos/6.3/os/x86_64/packages/popt-static-1.13-7.el6.x86_64.rpm)
再次make通過,然后make instll 完成安裝

3)安裝keepalived

keepalived下載
http://www.keepalived.org/software/keepalived-1.2.5.tar.gz

解壓 & ./configure & make & make install 完成安裝。

轉載于:https://blog.51cto.com/5294868/2126681

總結

以上是生活随笔為你收集整理的ipvsadm+keepalived安装错误解决的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。