`

解决CentOS6.2下安装ipvsadm-1.26报错

阅读更多

最近研究一下LVS+Keepalived,之前环境都是CentOS5的,这次在CentOS6.2中测试安装缺发现一点小问题,特意记录一下:

[root@host2 ~]# uname -r
2.6.32-220.el6.x86_64
[root@host2 ~]# cat /etc/redhat-release
CentOS release 6.2 (Final)

[root@host2 ipvsadm-1.26]# make
make -C libipvs
make[1]: Entering directory `/usr/src/ipvsadm-1.26/libipvs'
gcc -Wall -Wunused -Wstrict-prototypes -g -fPIC -DLIBIPVS_USE_NL  -DHAVE_NET_IP_VS_H -c -o libipvs.o libipvs.c
In file included from libipvs.h:13,
                 from libipvs.c:23:
ip_vs.h:15:29: error: netlink/netlink.h: No such file or directory
ip_vs.h:16:31: error: netlink/genl/genl.h: No such file or directory
ip_vs.h:17:31: error: netlink/genl/ctrl.h: No such file or directory
In file included from libipvs.h:13,
                 from libipvs.c:23:
ip_vs.h:520: error: array type has incomplete element type
ip_vs.h:521: error: array type has incomplete element type
ip_vs.h:522: error: array type has incomplete element type
ip_vs.h:523: error: array type has incomplete element type
ip_vs.h:524: error: array type has incomplete element type
ip_vs.h:525: error: array type has incomplete element type
libipvs.c: In function ‘ipvs_nl_message’:
libipvs.c:57: warning: implicit declaration of function ‘nlmsg_alloc’
libipvs.c:57: warning: assignment makes pointer from integer without a cast
libipvs.c:61: warning: implicit declaration of function ‘genlmsg_put’
libipvs.c:61: error: ‘NL_AUTO_PID’ undeclared (first use in this function)
libipvs.c:61: error: (Each undeclared identifier is reported only once
libipvs.c:61: error: for each function it appears in.)
libipvs.c:61: error: ‘NL_AUTO_SEQ’ undeclared (first use in this function)
libipvs.c: In function ‘ipvs_nl_noop_cb’:
libipvs.c:69: error: ‘NL_OK’ undeclared (first use in this function)
libipvs.c: At top level:
libipvs.c:72: error: expected declaration specifiers or ‘...’ before ‘nl_recvmsg_msg_cb_t’
libipvs.c: In function ‘ipvs_nl_send_message’:
libipvs.c:76: warning: implicit declaration of function ‘nl_handle_alloc’
libipvs.c:76: warning: assignment makes pointer from integer without a cast
libipvs.c:78: warning: implicit declaration of function ‘nlmsg_free’
libipvs.c:82: warning: implicit declaration of function ‘genl_connect’
libipvs.c:85: warning: implicit declaration of function ‘genl_ctrl_resolve’
libipvs.c:91: warning: implicit declaration of function ‘nl_handle_destroy’
libipvs.c:96: warning: implicit declaration of function ‘nl_socket_modify_cb’
libipvs.c:96: error: ‘NL_CB_VALID’ undeclared (first use in this function)
libipvs.c:96: error: ‘NL_CB_CUSTOM’ undeclared (first use in this function)
libipvs.c:96: error: ‘func’ undeclared (first use in this function)
libipvs.c:99: warning: implicit declaration of function ‘nl_send_auto_complete’
libipvs.c:102: warning: implicit declaration of function ‘nl_recvmsgs_default’
libipvs.c: In function ‘ipvs_init’:
libipvs.c:127: error: too many arguments to function ‘ipvs_nl_send_message’
libipvs.c: In function ‘ipvs_getinfo_parse_cb’:
libipvs.c:149: warning: implicit declaration of function ‘nlmsg_hdr’
libipvs.c:149: warning: initialization makes pointer from integer without a cast
libipvs.c:152: warning: implicit declaration of function ‘genlmsg_parse’
libipvs.c:159: warning: implicit declaration of function ‘nla_get_u32’
libipvs.c:162: error: ‘NL_OK’ undeclared (first use in this function)
libipvs.c: In function ‘ipvs_getinfo’:
libipvs.c:176: error: too many arguments to function ‘ipvs_nl_send_message’
libipvs.c: In function ‘ipvs_flush’:
libipvs.c:199: error: too many arguments to function ‘ipvs_nl_send_message’
libipvs.c: In function ‘ipvs_nl_fill_service_attr’:
libipvs.c:215: warning: implicit declaration of function ‘nla_nest_start’
libipvs.c:215: warning: assignment makes pointer from integer without a cast
libipvs.c:219: warning: implicit declaration of function ‘NLA_PUT_U16’
libipvs.c:222: warning: implicit declaration of function ‘NLA_PUT_U32’
libipvs.c:225: warning: implicit declaration of function ‘NLA_PUT’
libipvs.c:229: warning: implicit declaration of function ‘NLA_PUT_STRING’
libipvs.c:236: warning: implicit declaration of function ‘nla_nest_end’
libipvs.c:239: warning: label ‘nla_put_failure’ defined but not used
libipvs.c: In function ‘ipvs_add_service’:
libipvs.c:255: error: too many arguments to function ‘ipvs_nl_send_message’
libipvs.c: In function ‘ipvs_update_service’:
libipvs.c:276: error: too many arguments to function ‘ipvs_nl_send_message’
libipvs.c: In function ‘ipvs_del_service’:
libipvs.c:296: error: too many arguments to function ‘ipvs_nl_send_message’
libipvs.c: In function ‘ipvs_zero_service’:
libipvs.c:321: error: too many arguments to function ‘ipvs_nl_send_message’
libipvs.c: In function ‘ipvs_nl_fill_dest_attr’:
libipvs.c:334: warning: assignment makes pointer from integer without a cast
libipvs.c:348: warning: label ‘nla_put_failure’ defined but not used
libipvs.c: In function ‘ipvs_add_dest’:
libipvs.c:366: error: too many arguments to function ‘ipvs_nl_send_message’
libipvs.c: In function ‘ipvs_update_dest’:
libipvs.c:396: error: too many arguments to function ‘ipvs_nl_send_message’
libipvs.c: In function ‘ipvs_del_dest’:
libipvs.c:425: error: too many arguments to function ‘ipvs_nl_send_message’
libipvs.c: In function ‘ipvs_set_timeout’:
libipvs.c:452: error: too many arguments to function ‘ipvs_nl_send_message’
libipvs.c:454: warning: label ‘nla_put_failure’ defined but not used
libipvs.c: In function ‘ipvs_start_daemon’:
libipvs.c:473: warning: assignment makes pointer from integer without a cast
libipvs.c:483: error: too many arguments to function ‘ipvs_nl_send_message’
libipvs.c: In function ‘ipvs_stop_daemon’:
libipvs.c:504: warning: assignment makes pointer from integer without a cast
libipvs.c:514: error: too many arguments to function ‘ipvs_nl_send_message’
libipvs.c: At top level:
libipvs.c:526: warning: ‘struct nlattr’ declared inside parameter list
libipvs.c: In function ‘ipvs_parse_stats’:
libipvs.c:530: warning: implicit declaration of function ‘nla_parse_nested’
libipvs.c:548: warning: implicit declaration of function ‘nla_get_u64’
libipvs.c: In function ‘ipvs_services_parse_cb’:
libipvs.c:562: warning: initialization makes pointer from integer without a cast
libipvs.c:592: warning: implicit declaration of function ‘nla_get_u16’
libipvs.c:598: warning: implicit declaration of function ‘nla_data’
libipvs.c:599: warning: passing argument 2 of ‘memcpy’ makes pointer from integer without a cast
/usr/include/string.h:44: note: expected ‘const void * __restrict__’ but argument is of type ‘int’
libipvs.c:604: warning: implicit declaration of function ‘nla_get_string’
libipvs.c:605: warning: passing argument 2 of ‘strncpy’ makes pointer from integer without a cast
/usr/include/string.h:131: note: expected ‘const char * __restrict__’ but argument is of type ‘int’
libipvs.c:610: warning: passing argument 2 of ‘strncpy’ makes pointer from integer without a cast
/usr/include/string.h:131: note: expected ‘const char * __restrict__’ but argument is of type ‘int’
libipvs.c:614: warning: implicit declaration of function ‘nla_memcpy’
libipvs.c:618: warning: passing argument 2 of ‘ipvs_parse_stats’ from incompatible pointer type
libipvs.c:526: note: expected ‘struct nlattr *’ but argument is of type ‘struct nlattr *’
libipvs.c: In function ‘ipvs_get_services’:
libipvs.c:649: error: ‘NLM_F_DUMP’ undeclared (first use in this function)
libipvs.c:650: error: too many arguments to function ‘ipvs_nl_send_message’
libipvs.c: In function ‘ipvs_dests_parse_cb’:
libipvs.c:728: warning: initialization makes pointer from integer without a cast
libipvs.c:759: warning: passing argument 2 of ‘memcpy’ makes pointer from integer without a cast
/usr/include/string.h:44: note: expected ‘const void * __restrict__’ but argument is of type ‘int’
libipvs.c:771: warning: passing argument 2 of ‘ipvs_parse_stats’ from incompatible pointer type
libipvs.c:526: note: expected ‘struct nlattr *’ but argument is of type ‘struct nlattr *’
libipvs.c: In function ‘ipvs_get_dests’:
libipvs.c:809: error: ‘NLM_F_DUMP’ undeclared (first use in this function)
libipvs.c:813: warning: assignment makes pointer from integer without a cast
libipvs.c:829: error: too many arguments to function ‘ipvs_nl_send_message’
libipvs.c: In function ‘ipvs_get_service’:
libipvs.c:939: error: too many arguments to function ‘ipvs_nl_send_message’
libipvs.c: In function ‘ipvs_timeout_parse_cb’:
libipvs.c:972: warning: initialization makes pointer from integer without a cast
libipvs.c:986: error: ‘NL_OK’ undeclared (first use in this function)
libipvs.c: In function ‘ipvs_get_timeout’:
libipvs.c:1005: error: too many arguments to function ‘ipvs_nl_send_message’
libipvs.c: In function ‘ipvs_daemon_parse_cb’:
libipvs.c:1023: warning: initialization makes pointer from integer without a cast
libipvs.c:1048: warning: passing argument 2 of ‘strncpy’ makes pointer from integer without a cast
/usr/include/string.h:131: note: expected ‘const char * __restrict__’ but argument is of type ‘int’
libipvs.c:1051: error: ‘NL_OK’ undeclared (first use in this function)
libipvs.c: In function ‘ipvs_get_daemon’:
libipvs.c:1071: error: ‘NLM_F_DUMP’ undeclared (first use in this function)
libipvs.c:1072: error: too many arguments to function ‘ipvs_nl_send_message’
make[1]: *** [libipvs.o] Error 1
make[1]: Leaving directory `/usr/src/ipvsadm-1.26/libipvs'
make: *** [libs] Error 2

安装完以下这些软件

[root@host2 ipvsadm-1.26]# rpm -qa | grep popt
popt-1.13-7.el6.x86_64
popt-devel-1.13-7.el6.x86_64
[root@host2 ipvsadm-1.26]# rpm -qa | grep libnl
libnl-1.1-14.el6.x86_64
libnl-devel-1.1-14.el6.x86_64

[root@host2 ipvsadm-1.26]# make
make -C libipvs
make[1]: Entering directory `/usr/src/ipvsadm-1.26/libipvs'
gcc -Wall -Wunused -Wstrict-prototypes -g -fPIC -DLIBIPVS_USE_NL  -DHAVE_NET_IP_VS_H -c -o libipvs.o libipvs.c
gcc -Wall -Wunused -Wstrict-prototypes -g -fPIC -DLIBIPVS_USE_NL  -DHAVE_NET_IP_VS_H -c -o ip_vs_nl_policy.o ip_vs_nl_policy.c
ar rv libipvs.a libipvs.o ip_vs_nl_policy.o
ar: creating libipvs.a
a - libipvs.o
a - ip_vs_nl_policy.o
gcc -shared -Wl,-soname,libipvs.so -o libipvs.so libipvs.o ip_vs_nl_policy.o
make[1]: Leaving directory `/usr/src/ipvsadm-1.26/libipvs'
gcc -Wall -Wunused -Wstrict-prototypes -g  -DVERSION=\"1.26\" -DSCHEDULERS=\""rr|wrr|lc|wlc|lblc|lblcr|dh|sh|sed|nq"\" -DPE_LIST=\""sip"\"  -DHAVE_NET_IP_VS_H -c -o ipvsadm.o ipvsadm.c
ipvsadm.c: In function ‘print_largenum’:
ipvsadm.c:1383: warning: field width should have type ‘int’, but argument 2 has type ‘size_t’
gcc -Wall -Wunused -Wstrict-prototypes -g  -DVERSION=\"1.26\" -DSCHEDULERS=\""rr|wrr|lc|wlc|lblc|lblcr|dh|sh|sed|nq"\" -DPE_LIST=\""sip"\"  -DHAVE_NET_IP_VS_H -c -o config_stream.o config_stream.c
gcc -Wall -Wunused -Wstrict-prototypes -g  -DVERSION=\"1.26\" -DSCHEDULERS=\""rr|wrr|lc|wlc|lblc|lblcr|dh|sh|sed|nq"\" -DPE_LIST=\""sip"\"  -DHAVE_NET_IP_VS_H -c -o dynamic_array.o dynamic_array.c
gcc -Wall -Wunused -Wstrict-prototypes -g -o ipvsadm ipvsadm.o config_stream.o dynamic_array.o libipvs/libipvs.a  -lnl
ipvsadm.o: In function `parse_options':
/usr/src/ipvsadm-1.26/ipvsadm.c:432: undefined reference to `poptGetContext'
/usr/src/ipvsadm-1.26/ipvsadm.c:435: undefined reference to `poptGetNextOpt'
/usr/src/ipvsadm-1.26/ipvsadm.c:660: undefined reference to `poptBadOption'
/usr/src/ipvsadm-1.26/ipvsadm.c:502: undefined reference to `poptGetNextOpt'
/usr/src/ipvsadm-1.26/ipvsadm.c:667: undefined reference to `poptStrerror'
/usr/src/ipvsadm-1.26/ipvsadm.c:667: undefined reference to `poptBadOption'
/usr/src/ipvsadm-1.26/ipvsadm.c:670: undefined reference to `poptFreeContext'
/usr/src/ipvsadm-1.26/ipvsadm.c:677: undefined reference to `poptGetArg'
/usr/src/ipvsadm-1.26/ipvsadm.c:678: undefined reference to `poptGetArg'
/usr/src/ipvsadm-1.26/ipvsadm.c:679: undefined reference to `poptGetArg'
/usr/src/ipvsadm-1.26/ipvsadm.c:690: undefined reference to `poptGetArg'
/usr/src/ipvsadm-1.26/ipvsadm.c:693: undefined reference to `poptFreeContext'
collect2: ld returned 1 exit status
make: *** [ipvsadm] Error 1

报错比之前少多了

查阅资料需要安装popt-static

http://mirror.centos.org/centos/6/os/x86_64/Packages/popt-static-1.13-7.el6.x86_64.rpm

[root@host2 ~]# rpm -ivh popt-static-1.13-7.el6.x86_64.rpm

[root@host2 ipvsadm-1.26]# make
make -C libipvs
make[1]: Entering directory `/usr/src/ipvsadm-1.26/libipvs'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/usr/src/ipvsadm-1.26/libipvs'
gcc -Wall -Wunused -Wstrict-prototypes -g -o ipvsadm ipvsadm.o config_stream.o dynamic_array.o libipvs/libipvs.a -lpopt -lnl

顺利通过~!

分享到:
评论

相关推荐

    centos6.2下安装sybase--详细操作步骤.doc

    在CentOS 6.2操作系统环境下安装Sybase是一项重要的任务,尤其对于那些依赖于Sybase数据库系统的用户。本文将详细阐述在CentOS 6.2上安装Sybase的步骤,确保您能够顺利进行。 首先,我们需要创建一个专门用于运行...

    centos6.2安装(详细图解安装).doc

    安装镜像:CentOS-6.2-i386-bin-DVD1.iso CentOS-6.2镜像共两张DVD1和DVD2,安装操作系统只用DVD1即可 镜像下载地址: 32位DVD1http://mirrors.163.com/centos/6.2/isos/i386/CentOS-6.2-i386-bin-DVD1.iso 32位DVD2...

    tar-1.26-35.el7.x86_64.rpm

    离线安装包,亲测可用

    Centos 6.2下安装Sybase ASE-15_0

    安装过程中,你需要按照"centos6.2下安装sybase--详细操作步骤.doc"中的指导进行。这通常包括解压安装文件,运行配置脚本,配置数据库实例,指定实例的端口、日志路径和数据文件位置。在配置过程中,确保遵循Sybase...

    CentOS 6.2安装(超级详细图解教程)

    * 可以从 http://centos.ustc.edu.cn/centos/6.2/isos/i386/CentOS-6.2-i386-bin-DVD1to2.torrent 下载 32 位 CentOS 6.2 镜像文件。 * 可以从 ...

    centos7离线安装gcc-c++

    centos7离线安装gcc-c++

    CentOS_6.2_x86_64操作系统

    1. 准备工作:确保你拥有 CentOS-6.2-x86_64-bin-DVD1.iso 的 ISO 文件,并验证其 MD5 值,以确保下载的镜像文件无误。MD5 值应为 26FDF8C5A787A674F3219A3554B131CA。 2. 安装过程: - 第一步:启动安装介质,...

    techpackage.net-OpenStack完整安装手册(CentOS6.2)-by-yz.pdf

    本安装手册是针对CentOS 6.2操作系统进行OpenStack Essex release(2012.1)的详细安装步骤。 实验环境: 在搭建OpenStack环境时,通常需要两台服务器,如DELL R710和DELL R410。每台服务器应具备足够的硬件资源,...

    CentOS 6.2安装教程

    您将获得两个ISO文件:`CentOS-6.2-i386-bin-DVD1` 和 `CentOS-6.2-i386-bin-DVD2`。其中,`DVD1`包含了基础安装所需的所有内容,而`DVD2`则包含额外的软件包,可以用于扩展功能。 **三、CentOS 6.2 安装步骤** 1....

    centos7.6离线安装docker-ce-19.03、nvidia-docker2

    离线环境下,在centos7.6系统上安装docker-ce-19.03,nvidia-docker2.4版本,其中docker-ce-19.03在docker-local.tar压缩文件里面,nvidia-docker2在nvidia-docker2.zip文件中。 具体安装流程如下: 1.安装docker ...

    CentOS6.2下配置Django+Python环境步骤

    在CentOS 6.2系统下配置Django与Python环境是一项关键任务,尤其对于那些希望在稳定的企业级Linux操作系统上部署动态网站或Web应用的开发者而言。以下将详细阐述整个配置流程,涵盖从安装必要的软件包到最终启动...

    CentOS6.2硬盘安装指南

    2. **CentOS-6.2-i386-bin-DVD1.iso**:这是主要的安装镜像,大小约为3.8GB,包含了基本的系统组件和必要的安装程序,可用于将CentOS完整地安装到硬盘上。 3. **CentOS-6.2-i386-bin-DVD2.iso**:额外的镜像文件,...

    CentOS-7-i386-Everything-2009.part09.rar

    CentOS 7.9版本(CentOS-7-i386-Everything-2009)适用于i386,必须集齐9个文件才能一起解压缩使用,9个文件下载地址: CentOS-7-i386-Everything-2009.part09.rar ... CentOS-7-i386-Everything-2009.part08.rar ...

    ipvsadm-1.31-1.el8.x86_64.rpm

    官方离线安装包,亲测可用

    centos6.2安装两个mysql--宋正河整理

    在Linux系统中,尤其是服务器级别的操作系统,如CentOS 6.2,安装多个MySQL数据库实例是一种常见的需求,可能出于测试、隔离不同的应用环境或者服务高可用性的考虑。本教程由宋正河整理,将详细讲解如何在CentOS 6.2...

    CentOS6.2安装(超级详细图解教程)

    - **32位系统**的镜像文件可从**http://centos.ustc.edu.cn/centos/6.2/isos/i386/CentOS-6.2-i386-bin-DVD1to2.torrent**下载。 - **64位系统**的镜像文件则位于**...

    centos6.2-64下安装oracle11G

    在CentOS 6.2 64位操作系统中安装Oracle 11g涉及多个关键步骤,包括系统和配置要求、软件环境准备、用户环境设置以及后续的安装过程。以下是详细的知识点说明: 1. **系统及配置要求**: - 操作系统版本:CentOS ...

    CentOS-7-i386-Minimal-2009.iso

    CentOS 7.9版本(CentOS-7-i386-NetInstall-2009)适用于i386 CentOS是免费的、开源的、可以重新分发的开源操作系统,CentOS(Community Enterprise Operating System,中文意思是社区企业操作系统)是Linux发行版...

    CentOS-7-i386-NetInstall-2009.iso

    CentOS 7.9版本(CentOS-7-i386-NetInstall-2009)适用于i386 CentOS是免费的、开源的、可以重新分发的开源操作系统,CentOS(Community Enterprise Operating System,中文意思是社区企业操作系统)是Linux发行版...

Global site tag (gtag.js) - Google Analytics