lvs_keepalived_install 一键安装脚本

简介:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash
# author: kuangl
# mail:kuangl@orient-media.com
#
# -------------------------------------------------------- #
## Ipvsadm_install
# -------------------------------------------------------- #
# ipvsadm installation
CURRENT_PATH=$( pwd )
for  in  $(rpm -q gcc gcc-c++ kernel-devel openssl-devel popt-devel popt-static libnl-devel | grep  'not installed'  awk  '{print $2}' )
do
yum -y  install  $i
done
[ -d ${CURRENT_PATH} /software  ]
"$?"  != 0 ] &&  mkdir  ${CURRENT_PATH} /software
cd  ${CURRENT_PATH} /software
[ ! -e ipvsadm-1.26. tar .gz ] && 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
echo  $? || [ $? != 0 ] ||  echo  " installation ipvsadm failed"  ||  exit  1
echo  "modprobe ip_vs"  >>  /etc/rc . local
# ipvsadm start-up
[ -x ${CURRENT_PATH} /scripts/ipvsadm  ] && [  "$?"  != 0 ] &&  chmod  755 ${CURRENT_PATH} /scripts/ipvsadm
cp  ${CURRENT_PATH} /scripts/ipvsadm  /etc/init .d/
chkconfig --add ipvsadm
chkconfig --level 345 ipvsadm on
service ipvsadm start
# -------------------------------------------------------- #
## Keepalived_intsall
# -------------------------------------------------------- #
# Keepalived installation
cd  ${CURRENT_PATH} /software
[ ! -e keepalived-1.2.4. tar .gz ] && 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
ln  -s  /usr/src/kernels/ $( uname  -r)  /usr/src/kernels/linux
. /configure  --prefix= /usr  --bindir= /usr/bin  --sbindir= /usr/bin  --libexecdir= /usr/libexec  --localstatedir= /var  --libdir= /lib64  --infodir= /usr/share/info  --sysconfdir= /etc  --mandir= /usr/local/share/man  --with-kernel- dir = /usr/src/kernels/linux
make  &&  make  install
echo  $? || [ $? != 0 ] || print  " installation keepalived failed"  ||  exit  1
chkconfig --add keepalived
chkconfig --level 345 keepalived on



本文转自 kuangling 51CTO博客,原文链接:http://blog.51cto.com/kling/1239707



相关文章
|
8月前
|
运维 算法 Linux
LVS详解(四)——LVS安装与配置命令
LVS详解(四)——LVS安装与配置命令
147 2
|
负载均衡 算法 调度
CentOS6.4 LVS rpm包安装及源码安装
RPM包安装 系统平台 CentOS 6.4 x64 minimal KERNEL 2.6.32-358.23.2.el6.x86_64 LVS版本 ipvsadm-1.25-10.el6.x86_64 KEEPALIVED 版本 keepalived-1.2.7-3.el6.x86_64 centos minimal 安装好后 开始搭建 LVS 服务器,关于 yum 包的
3028 0
|
网络协议
KEEPALIVED 做LVS+HA实例安装与配置
--------------------------------------master------------------------------------------------------- wget http://www.
1043 0
|
移动开发 网络协议 Shell
LVS+KEEPALIVED 安装与配置实例
--------------------------------------master--------------------------------------- echo "1" > /proc/sys/net/ipv4/ip_forward wget http://www.
1323 0
|
算法 网络协议 Linux
高并发场景 LVS 安装及高可用实现
1.1 负载均衡介绍 1.1.1 负载均衡的妙用  负载均衡(Load Balance)集群提供了一种廉价、有效、透明的方法,来扩展网络设备和服务器的负载、带宽、增加吞吐量、加强网络数据处理能力、提高网络的灵活性和可用性。
1612 0