gznz12345 发表于 2018-12-28 11:12:42

安装keepalived遇到problem

  -----------------------------新安装的干净centos---------------------------------------


安装keepalived遇到的一些问题:
-------------------------------------------------------------------------------
1.更新yum源安装所需的库文件
yum install gcc* c++ * autoconf automake zlib*libxml* ncurses-devel libmcrypt*


libtool-ltdl-devel* popt-devel
-------------------------------------------------------------------------------
2.安装ipvsadm遇到如下错误:


make: *** Error 1
make: Leaving directory `/root/keepalived/ipvsadm-1.24/libipvs'
make: *** Error 2


-------------------------------------------------------------------------------


解决办法:
# yum install kernel-devel -y
# ln -s /usr/src/kernels/2.6.32-279.19.1.el6.i686/


/usr/src/linux
再次make如下:
# make
make -C libipvs
make: Entering directory `/root/keepalived/ipvsadm-1.24/libipvs'
gcc -Wall -Wunused -Wstrict-prototypes -g -O2 -I/usr/src/linux/include-


DHAVE_NET_IP_VS_H -c -o libipvs.o libipvs.c
ar rv libipvs.a libipvs.o
ar: creating libipvs.a
a - libipvs.o
make: Leaving directory `/root/keepalived/ipvsadm-1.24/libipvs'
gcc -Wall -Wunused -Wstrict-prototypes -g -O2 -I/usr/src/linux/include -I.. -I.


-DVERSION=\"1.24\" -DSCHEDULERS=\""rr|wrr|lc|wlc|lblc|lblcr|dh|sh|sed|nq"\"-


DHAVE_NET_IP_VS_H -c -o ipvsadm.o ipvsadm.c
gcc -Wall -Wunused -Wstrict-prototypes -g -O2 -I/usr/src/linux/include -I.. -I.


-DVERSION=\"1.24\" -DSCHEDULERS=\""rr|wrr|lc|wlc|lblc|lblcr|dh|sh|sed|nq"\"-


DHAVE_NET_IP_VS_H -c -o config_stream.o config_stream.c
gcc -Wall -Wunused -Wstrict-prototypes -g -O2 -I/usr/src/linux/include -I.. -I.


-DVERSION=\"1.24\" -DSCHEDULERS=\""rr|wrr|lc|wlc|lblc|lblcr|dh|sh|sed|nq"\"-


DHAVE_NET_IP_VS_H -c -o dynamic_array.o dynamic_array.c
gcc -Wall -Wunused -Wstrict-prototypes -g -O2 -o ipvsadm ipvsadm.o


config_stream.o dynamic_array.o libipvs/libipvs.a


make install 能顺利完成


------------------------------------------------------------------------------


3.安装keepalived遇到问题:
# ./configure --prefix=/usr/local/keepalived
出现:
checking for sys/time.h... yes
checking openssl/ssl.h usability... no
checking openssl/ssl.h presence... no
checking for openssl/ssl.h... no
configure: error:
!!! OpenSSL is not properly installed on your system. !!!
!!! Can not include OpenSSL headers files.




意思就是缺少openssl文件
-------------------------------------------------------------------------------
解决办法:
yum -y install openssl-devel*
再次执行
# ./configure --prefix=/usr/local/keepalived
成功!!!!


但是make时又出现错误
make: *** No targets specified and no makefile found. Stop.
将解压完的目录全部删除,重新编译又出现如下问题。


checking for SSL_CTX_new in -lssl... yes
checking for poptGetContext in -lpopt... no
configure: error: Popt libraries is required


解决办法:
# yum install popt-devel


出现如下:
Keepalived configuration
-------------------------------------------------------------------------------
Keepalived version       : 1.2.7
Compiler               : gcc
Compiler flags         : -g -O2
Extra Lib                : -lpopt -lssl -lcrypto
Use IPVS Framework       : Yes
IPVS sync daemon support : Yes
IPVS use libnl         : No(缺少lib文件)
Use VRRP Framework       : Yes
Use VRRP VMAC            : Yes
SNMP support             : No
Use Debug flags          : No


-------------------------------------------------------------------------------
解决办法:
# yum -y install libnl-devel


OK如下所示:
Keepalived configuration
------------------------
Keepalived version       : 1.2.7
Compiler               : gcc
Compiler flags         : -g -O2
Extra Lib                : -lpopt -lssl -lcrypto-lnl
Use IPVS Framework       : Yes
IPVS sync daemon support : Yes
IPVS use libnl         : Yes
Use VRRP Framework       : Yes
Use VRRP VMAC            : Yes
SNMP support             : No
Use Debug flags          : No


-------------------------------------------------------------------------------


cp /usr/local/keepalived/etc/rc.d/init.d/keepalived /etc/init.d/
cp /usr/local/keepalived/etc/sysconfig/keepalived/etc/sysconfig/
mkdir /etc/keepalived
mkdir -pv/etc/keepalived
mkdir -pv /etc/keepalived
cp /usr/local/keepalived/etc/keepalived/keepalived.conf/etc/keepalived/
ln -s /usr/local/keepalived/sbin/keepalived /sbin/
-------------------------------------------------------------------------------


service keepalived start


到此lvs+keepalived已经成功安装完成!!!!!!!!!!!!!!!!!!剩下的就是


更改配置文件了。




页: [1]
查看完整版本: 安装keepalived遇到problem