在CentOS6.5下配置安装LVS

先上一个图,在内网测试机上安装了一个虚拟机,已经安装好了CentOS

乖乖连wget都没有安装,先安装wget吧

sudo yum install wget

下载LVS

wget http://www.linuxvirtualserver.org/software/kernel-2.6/ipvsadm-1.26.tar.gz

解压

tar zxvf ipvsadm-1.26.tar.gz
cd ipvsadm-1.26
make && make install
make -C libipvs
make[1]: Entering directory `/root/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
make[1]: gcc: Command not found
make[1]: *** [libipvs.o] Error 127
make[1]: Leaving directory `/root/ipvsadm-1.26/libipvs‘
make: *** [libs] Error 2

出错了,原来是没有找到gcc 哪么安装gcc吧

yum install gcc

Complete! 安装成功再使用

make && make install

又出错了

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 `/root/ipvsadm-1.26/libipvs‘
make: *** [libs] Error 2

看看象是lib类型库的问题,安装以后库

yum install libnl*
make
ipvsadm.c:114:18: error: popt.h: No such file or directory
ipvsadm.c: In function ‘parse_options’:
ipvsadm.c:365: error: ‘poptContext’ undeclared (first use in this function)
ipvsadm.c:365: error: (Each undeclared identifier is reported only once
ipvsadm.c:365: error: for each function it appears in.)
ipvsadm.c:365: error: expected ‘;’ before ‘context’
ipvsadm.c:367: error: array type has incomplete element type
ipvsadm.c:368: error: ‘POPT_ARG_NONE’ undeclared (first use in this function)
ipvsadm.c:383: error: ‘POPT_ARG_STRING’ undeclared (first use in this function)
ipvsadm.c:394: error: ‘POPT_ARGFLAG_OPTIONAL’ undeclared (first use in this function)
ipvsadm.c:432: error: ‘context’ undeclared (first use in this function)
ipvsadm.c:432: warning: implicit declaration of function ‘poptGetContext’
ipvsadm.c:435: warning: implicit declaration of function ‘poptGetNextOpt’
ipvsadm.c:661: warning: implicit declaration of function ‘poptBadOption’
ipvsadm.c:661: error: ‘POPT_BADOPTION_NOALIAS’ undeclared (first use in this function)
ipvsadm.c:669: warning: implicit declaration of function ‘poptStrerror’
ipvsadm.c:670: warning: implicit declaration of function ‘poptFreeContext’
ipvsadm.c:677: warning: implicit declaration of function ‘poptGetArg’
ipvsadm.c:367: warning: unused variable ‘options_table’
make: *** [ipvsadm.o] Error 1

又出现了新问题,看起来像是popt类型库的问题

yum install popt*
make && make install

安装成功!

接下来安装 Keepalived

下载

wget http://www.keepalived.org/software/keepalived-1.2.4.tar.gz
tar zxvf keepalived-1.2.4.tar.gz
cd keepalived-1.2.4
 ./configrue
!!! OpenSSL is not properly installed on your system. !!!

原来是OpenSSL没有安装,哪么安装OpenSSL吧

yum install openssl-devel

再次 ./configure 成功

Keepalived configuration
------------------------
Keepalived version       : 1.2.4
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
Use Debug flags          : No

开始安装Keepalived

make && make install

安装成功

make -C genhash install
make[1]: Entering directory `/root/keepalived-1.2.4/genhash‘
install -d /usr/local/bin
install -m 755 ../bin/genhash /usr/local/bin/
install -d /usr/local/share/man/man1
install -m 644 ../doc/man/man1/genhash.1 /usr/local/share/man/man1
make[1]: Leaving directory `/root/keepalived-1.2.4/genhash‘

开启路由转发

vi /etc/sysctl.conf

net.ipv4.ip_forward = 0

修改成

net.ipv4.ip_forward = 1

:wq保存

刷新一下系统变量,使配置值生效

sysctl -p
net.ipv4.ip_forward = 1

看到了输出变量为1

接下来

配置Real Server

由于我们的Real Server是windows2008主机

需要增加一个虚拟网卡

配置网卡地址为

192.168.1.14

子网掩码为

255.255.255.255

asdasdasd

时间: 2024-08-11 21:10:41

在CentOS6.5下配置安装LVS的相关文章

CentOS6.3下DNS安装与配置

1.下载并安装最新的bind包 yum install –y bind bind-chroot bind-utis 2.配置named.conf acl internals{ 127.0.0.0/8; 192.168.0.0/24; }; view "internal" { match-clients {internals; }; zone "youdomian.com" { type master; file "/etc/named/internals/

Centos6.4下Nginx安装

Nginx ("engine x") 是一个高性能的 HTTP 和反向代理服务器,也是一个 IMAP/POP3/SMTP 代理服务器. Nginx 是由 Igor Sysoev 为俄罗斯访问量第二的 Rambler.ru 站点开发的,它已经在该站点运行超过三年了.Igor 将源代码以类BSD许可证的形式发布. Nginx和Apache区别 Nginx 超越 Apache 的高性能和稳定性,使得国内使用 Nginx 作为 Web 服务器的网站也越来越多,其中包括新浪博客.新浪播客.网易新

Centos6.4下配置邮件服务器postfix3.0.1(一)

邮件服务器部署 1 编译安装postfix www.postfix.org ①由于Centos已经有了postfix [[email protected] ~]# rpm -qa|grep postfix postfix-2.6.6-2.2.el6_1.x86_64 所以得先卸载 [[email protected] ~]# rpm -e postfix --nodeps ②从www.postfix.org获得源码安装包 ③解压包 [[email protected] ~]# tar xf po

centos6.7下编译安装lnmp

很多步骤不说明了,请参照本人的centos6.7下编译安装lamp,这次的架构是nginx+php-fpm一台服务器,mysql一台服务器 (1)首先编译安装nginx: 操作命令: yum -y groupinstall "Development Tools" "Server Platform Development" yum -y install pcre-devel  useradd -r nginx  mkdir /var/tmp/nginx   事先得创建

centos6.7下 编译安装MySQL5.7

centos6.7下编译安装MySQL5.7 准备工作 #-----依赖包及MySQL和boost安装包----- #yum包安装: shell> yum -y install gcc-c++ ncurses-devel cmake make perl gcc autoconf automake zlib libxml libgcrypt libtool bison #获取boost类库(5.7编译需要boost类库,编译时指定boost路径): shell> wget http://down

CentOS下配置安装Nagios

CentOS下配置安装Nagios 一.Nagios简介 Nagios是一款开源的电脑系统和网络监视工具,能有效监控Windows.Linux和Unix的主机状态,交换机路由器等网络设置,打印机等.在系统或服务状态异常时发出邮件或短信报警第一时间通知网站运维人员,在状态恢复后发出正常的邮件或短信通知. Nagios原名为NetSaint,由Ethan Galstad开发并维护至今.NAGIOS是一个缩写形式: "Nagios Ain't GonnaInsist On Sainthood"

CentOS6.5下Oracle11G-R2安装、卸载

资源下载地址(包括本人所有安装过程中,系统备份文件):http://download.csdn.net/detail/attagain/7700437 一. 硬件要求 本部分内容命令,均以root用户执行. 1. 内存 建议内存应大于2G以上,1G可以运行,但比较吃力. 内存查看命令: [[email protected] /]# cat /proc/meminfo 或 [[email protected] /]# free -m total       used       free    

CentOS6.5_64bit下编译安装MySQL-5.6.23

转载请注明出处:http://blog.csdn.net/guoyjoe/article/details/44785511 ************************************************************         CentOS6.5_64bit下编译安装MySQL-5.6.23 **************************************************************一.关闭防火墙chkconfig iptable

Linux(CentOS6.5)下编译安装PHP5.6.22时报错”configure: error: ZLIB extension requires gzgets in zlib”的解决方式(确定已经编译安装Zlib,并已经指定Zlib路径)

本文地址http://comexchan.cnblogs.com/,作者Comex Chan,尊重知识产权,转载请注明出处,谢谢!   今天在CentOS6.5下编译安装PHP时,一直报错 configure: error: ZLIB extension requires gzgets in zlib 而Zlib确定已经安装了. 使用Google根本搜索不到有关的错误. 尝试重新编译了Zlib,还是不行. 后面发现我的PHP编译选项里面有个 --with-libdir=lib64 \ 删除之,再