我需要在nginx网络服务器中设置Keepalived为Web群集提供IP故障转移。
我按照此链接安装keepalive:http://www.cyberciti.biz/faq/rhel-centos-fedora-keepalived-lvs-cluster-configuration/
安装时
$ make && make install
系统抛出致命错误:asm / linkage.h :没有这样的文件或目录
这是全部错误:
[root@www keepalived-1.1.19]# make && make install
make -C lib || exit 1;
make[1]: Entering directory `/opt/keepalived-1.1.19/lib'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/opt/keepalived-1.1.19/lib'
make -C keepalived
make[1]: Entering directory `/opt/keepalived-1.1.19/keepalived'
make[2]: Entering directory `/opt/keepalived-1.1.19/keepalived/core'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/opt/keepalived-1.1.19/keepalived/core'
make[2]: Entering directory `/opt/keepalived-1.1.19/keepalived/vrrp'
gcc -g -O2 -I/lib/modules/3.10.0-229.el7.x86_64/build/include -I../include -I../../lib -Wall -Wunused -Wstrict-prototypes -D_KRNL_2_2_ -D_WITHOUT_LVS_ -D_WITHOUT_IPVS_SYNCD_ -c vrrp_daemon.c
In file included from /lib/modules/3.10.0-229.el7.x86_64/build/include/linux/kernel.h:6:0,
from /lib/modules/3.10.0-229.el7.x86_64/build/include/linux/skbuff.h:17,
from /lib/modules/3.10.0-229.el7.x86_64/build/include/linux/if_ether.h:23,
from /usr/include/net/ethernet.h:26,
from ../include/vrrp_arp.h:27,
from vrrp_daemon.c:26:
/lib/modules/3.10.0-229.el7.x86_64/build/include/linux/linkage.h:7:25: fatal error: asm/linkage.h: No such file or directory
#include <asm/linkage.h>
^
compilation terminated.
make[2]: *** [vrrp_daemon.o] Error 1
make[2]: Leaving directory `/opt/keepalived-1.1.19/keepalived/vrrp'
make[1]: *** [all] Error 1
make[1]: Leaving directory `/opt/keepalived-1.1.19/keepalived'
make: *** [all] Error 2
[root@www keepalived-1.1.19]#
更新:
关注module compiling : asm/linkage.h file not found此链接后
我添加
^ Iobj-m + = vrrp_daemon.o
all:^ I $(MAKE)-C / lib / modules / $(shell uname -r)/ build M = $(PWD)modules $
clean:^ I $(MAKE)-C / lib / modules / $(shell uname -r)/ build M = $(PWD)clean $
现在,也抛出相同的错误
这是我的文件:
# Makefile
#
# Keepalived OpenSource project.
#
# Copyright (C) 2001-2009 Alexandre Cassen, <acassen@linux-vs.org>
TARFILES = AUTHOR bin ChangeLog configure configure.in CONTRIBUTORS COPYING \
doc genhash INSTALL install-sh keepalived keepalived.spec.in lib Makefile.in \
README TODO VERSION
TARBALL = keepalived-1.1.19.tar.gz
^Iobj-m += vrrp_daemon.o
all:
$(MAKE) -C lib || exit 1;
$(MAKE) -C keepalived
$(MAKE) -C genhash $
^I$(MAKE) -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules $
@echo ""
@echo "Make complete"
debug:
$(MAKE) -C lib || exit 1;
$(MAKE) -C keepalived debug
@echo ""
@echo "Make complete"
profile:
$(MAKE) -C lib || exit 1;
$(MAKE) -C keepalived profile
@echo ""
@echo "Make complete"
clean:
$(MAKE) -C lib clean
$(MAKE) -C keepalived clean
$(MAKE) -C genhash clean
^I$(MAKE) -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean $
distclean:
$(MAKE) -C lib distclean
$(MAKE) -C keepalived distclean
$(MAKE) -C genhash distclean
rm -f Makefile
rm -f keepalived.spec
mrproper: distclean
rm -f config.*
uninstall:
$(MAKE) -C keepalived uninstall
$(MAKE) -C genhash uninstall
install:
$(MAKE) -C keepalived install
$(MAKE) -C genhash install
tarball: mrproper
mkdir keepalived-1.1.19
cp -a $(TARFILES) keepalived-1.1.19
tar --exclude .git -czf $(TARBALL) keepalived-1.1.19
rm -rf keepalived-1.1.19
rpm:
rpmbuild -ba keepalived.spec
更新:1 我发现linkage.h文件有...
./modules/3.10.0-229.el7.x86_64/build/arch/x86/include/asm/linkage.h
./modules/3.10.0-229.el7.x86_64/build/include/asm-generic/linkage.h
./modules/3.10.0-229.el7.x86_64/build/include/linux/linkage.h
./modules/3.10.0-229.el7.x86_64/source/arch/x86/include/asm/linkage.h
./modules/3.10.0-229.el7.x86_64/source/include/asm-generic/linkage.h
./modules/3.10.0-229.el7.x86_64/source/include/linux/linkage.h
./modules/3.10.0-327.28.3.el7.x86_64/build/arch/x86/include/asm/linkage.h
./modules/3.10.0-327.28.3.el7.x86_64/build/include/asm-generic/linkage.h
./modules/3.10.0-327.28.3.el7.x86_64/build/include/linux/linkage.h
./modules/3.10.0-327.28.3.el7.x86_64/source/arch/x86/include/asm/linkage.h
./modules/3.10.0-327.28.3.el7.x86_64/source/include/asm-generic/linkage.h
./modules/3.10.0-327.28.3.el7.x86_64/source/include/linux/linkage.h
建议我如何解决这个问题。