注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

红烧鱼

linux & windows management

 
 
 

日志

 
 
关于我
mac

专注IT基础架构设计与运维。 欢迎给我留言,或邮件沟通zjwsk@163.com

网易考拉推荐

淘宝LVS内核编译脚本  

2014-03-06 22:09:55|  分类: Linux |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |
OS环境为RHEL 6.2 x86_64 , 仅安装@core , @base 软件包组; 新安装环境直接使用下述脚本运行。
所需软件包下载自 ftp://ftp.redhat.com/redhat/linux/enterprise/6Server/en/os/SRPMS

#1. download kernel and other package source:
wget -P /data http://10.245.254.93/linux/soft/lvs/asciidoc-8.4.5-4.1.el6.src.rpm
wget -P /data http://10.245.254.93/linux/soft/lvs/newt-0.52.11-3.el6.src.rpm
wget -P /data http://10.245.254.93/linux/soft/lvs/oniguruma-5.9.1-3.1.el6.src.rpm
wget -P /data http://10.245.254.93/linux/soft/lvs/slang-2.2.1-1.el6.src.rpm
wget -P /data http://10.245.254.93/linux/soft/lvs/kernel-2.6.32-220.23.1.el6.src.rpm
wget -P /data http://kb.linuxvirtualserver.org/images/a/a5/Lvs-fullnat-synproxy.tar.gz
wget -P /data http://10.245.254.93/linux/soft/lvs/popt-static-1.13-7.el6.x86_64.rpm

#2. create os environment
mkdir /root/.ssh
wget -P /root/.ssh http://10.245.254.171/linux/ks/authorized_keys
chmod 700 /root/.ssh
chmod 600 /root/.ssh/authorized_keys

useradd mockbuild
mkdir -p /data/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS,tmp}
chown -R mockbuild.mockbuild /data/rpmbuild

cat <<EOF> /home/mockbuild/.rpmmacros
%_topdir /data/rpmbuild
%_tmppath /data/rpmbuild/tmp
%_sourcedir /data/rpmbuild/SOURCES
%_specdir /data/rpmbuild/SPECS
%_srcrpmdir /data/rpmbuild/SRPMS
%_rpmdir /data/rpmbuild/RPMS
%_builddir /data/rpmbuild/BUILD
EOF

cat <<EOF> /etc/yum.repos.d/mac.repo
[RHEL62]
name=RHEL62
baseurl=http://10.245.254.93/linux/mount/rhel62
enabled=1
gpgcheck=0
EOF

yum remove up2date -y
yum install -y redhat-rpm-config patchutils xmlto elfutils-libelf-devel elfutils-devel zlib-devel binutils-devel python-devel audit-libs-devel perl-ExtUtils-Embed bison flex hmaccalc make gcc rpm-build ruby libpng-devel pcre-devel popt-devel docbook-utils openssl-devel libnl-devel

su - mockbuild
rpm -ivh /data/*.rpm
tar zxpf /data/Lvs-fullnat-synproxy.tar.gz -C /data

#3. install asciidoc
cd /data/rpmbuild
rpmbuild --bb --target=`uname -m` SPECS/asciidoc.spec
rpm -ivh RPMS/noarch/asciidoc-8.4.5-4.1.el6.noarch.rpm

#4. install newt-devel. this software is needed by oniguruma, and by slang.  so must install these two package.
#4.1 install oniguruma
rpmbuild --bb --target=`uname -m` SPECS/oniguruma.spec
rpm -ivh RPMS/x86_64/oniguruma-5.9.1-3.1.el6.x86_64.rpm
rpm -ivh RPMS/x86_64/oniguruma-devel-5.9.1-3.1.el6.x86_64.rpm

#4.2 install slang
rpmbuild --bb --target=`uname -m` SPECS/slang.spec
rpm -ivh RPMS/x86_64/slang-devel-2.2.1-1.el6.x86_64.rpm

#4.3 install newt
rpmbuild --bb --target=`uname -m` SPECS/newt.spec
rpm -ivh RPMS/x86_64/newt-devel-0.52.11-3.el6.x86_64.rpm

#5. building kernel
rpmbuild -bp SPECS/kernel.spec;

#5.1 add lvs patch
  cd /data/rpmbuild/BUILD/;
  cd kernel-2.6.32-220.23.1.el6/linux-2.6.32-220.23.1.el6.x86_64/;
  patch -p1 < /data/lvs-fullnat-synproxy/lvs-2.6.32-220.23.1.el6.patch;

#5.2 build and install
  make -j16;
  make modules_install;
  make install;
  sed -i '/'default\=1'/s/1/0'/ /boot/grub/grub.conf
  reboot

  
#----------------------------------------------------
<< BLOCK
#6. LVS Tools (keepalived/ipvsadm/quaage)
  tar xzf /data/lvs-fullnat-synproxy/lvs-tools.tar.gz -C /data

#6.1 keepalived install
  cd /data/tools/keepalived;
  ./configure --with-kernel-dir="/lib/modules/`uname -r`/build";
  make;
  make install;

#6.2 ipvsadm install
  cd /data/tools/ipvsadm;
  make; <<----------- 这一步,一直没法编译成功,提示库文件定义错误,待查
  make install;

#6.3 quaage install
  cd /data/tools/quagga;
  ./configure --disable-ripd --disable-ripngd --disable-bgpd --disable-watchquagga --disable-doc  --enable-user=root --enable-vty-group=root --enable-group=root --enable-zebra --localstatedir=/var/run/quagga
  make;
  make install;

BLOCK
  评论这张
 
阅读(963)| 评论(0)
推荐 转载

历史上的今天

在LOFTER的更多文章

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017