码迷,mamicode.com
首页 > 其他好文 > 详细

Keepalived+lvs

时间:2017-07-26 22:00:38      阅读:143      评论:0      收藏:0      [点我收藏+]

标签:lvs   keepalived   

##############################

######  Keepalived+lvs  #####

##############################


server4
tar zxf keepalived-1.3.5.tar.gz
 cd keepalived-1.3.5
[root@server4 keepalived-1.3.5]# yum install ipvsadm kernel-devel openssl-devel popt-devel libnl-devel gcc -y
 ./configure --prefix=/usr/local/keepalived --with-init=SYSV   
make && make install 
 cd /usr/local/keepalived/etc/rc.d/init.d/
 vim keepalived
技术分享

[root@server4 local]# scp -r keepalived/ server5:/usr/local/ 
[root@server4 local]# pwd
/usr/local


server4,server5

[root@server4 local]# ln -s /usr/local/keepalived/sbin/keepalived /sbin/
[root@server4 local]# ln -s /usr/local/keepalived/etc/keepalived/ /etc/ 
[root@server4 local]# ln -s /usr/local/keepalived/etc/sysconfig/keepalived / /etc/sysconfig/ 
[root@server4 local]# ln -s /usr/local/keepalived/etc/rc.d/init.d/keepalived  /etc/init.d/ 
[root@server4 local]# cd /usr/local/keepalived/etc/rc.d/init.d/
[root@server4 init.d]# ls
keepalived
[root@server4 init.d]# chmod +x keepalived


server4

cd /etc/keepalived/
vim keepalived.conf

技术分享

技术分享


/etc/init.d/keepalived start

scp keepalived.conf 172.25.24.5:/etc/keepalived/


server5

 mkdir /etc/keepalived/
vim keepalived.conf
技术分享

/etc/init.d/keepalived start

yum install -y ldirectord-3.9.5-3.1.x86_64.rpm

/etc/init.d/ldirectord star


server4

iptables -L

iptables -F


测试:

技术分享

技术分享


Keepalived+lvs

标签:lvs   keepalived   

原文地址:http://12774035.blog.51cto.com/12764035/1951189

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!