MooseFS 3.0部署笔记(4)【原创】

此文接 部署笔记3 ,介绍mfs高可用中的keepalived的部署.
keepAlived 安装
1. 下载 http://www.keepalived.org/software/keepalived-1.2.23.tar.gz
2. tar -xzvf keepalived-1.2.23.tar.gz
3. 下载并安装一下包,根据自己的操作系统版本定。
可用命令查看相关组件的版本(rpm –qa| grep xxxx)。
rpm -ivh libcom_err-devel-1.41.12-11.el6.x86_64.rpm
rpm -ivh e2fsprogs-devel-1.41.12-11.el6.x86_64.rpm
rpm -ivh keyutils-libs-devel-1.4-3.el6.x86_64.rpm
rpm -ivh libsepol-devel-2.0.41-4.el6.x86_64.rpm
rpm -ivh libselinux-devel-2.0.94-5.2.el6.x86_64.rpm
rpm -ivh krb5-devel-1.9-22.el6.x86_64.rpm
rpm -ivh zlib-devel-1.2.3-27.el6.x86_64.rpm
rpm -ivh openssl-devel-1.0.0-20.el6.x86_64.rpm
4. 安装keepalived
cd keepalived-1.2.23
./configure --prefix=/usr/local/keepalived
make & make install

5. 注册服务
cp /usr/local/keepalived/sbin/keepalived /usr/sbin/
cp /usr/local/keepalived/etc/sysconfig/keepalived /etc/sysconfig/
cp /usr/local/keepalived/etc/rc.d/init.d/keepalived /etc/init.d/

6. 配置
mkdir -p /etc/keepalived/
vi /etc/keepalived/keepalived.conf

chmod 755 /etc/keepalived/keepalived_drbd_mfs.sh

7. 启动
sudo /etc/init.d/keepalived start

8. 关闭防火墙和selinux策略
vi /etc/sysconfig/selinux
修改:
SELINUX=disabled
#setenforce 0
9. 配置iptables,添加VRRP通讯支持, 允许组播
iptables -A INPUT -d 224.0.0.18 -j ACCEPT

10. 验证
能ping到 /etc/keepalived/keepalived.conf 中配置的虚地址,可以用 ip a 查看虚地址绑定情况。


11. 修改keepalived 日志输出。
默认keepalived 的日志输出到 /var/log/messages , 问题很不好查,以下修改日志输出。
1) vi /etc/sysconfig/keepalived
修改最后一行 KEEPALIVED_OPTIONS="-D -d -S 0"

2) vi /etc/rsyslog.conf 添加
#keepalived -S 0
local0.* /var/log/keepalived.log
3) 重启日志服务
# /etc/init.d/rsyslog restart
4) 查看日志
tail -1000 /var/log/keepalived.log


12. 抓包分析keepalived 通讯
tcpdump -i eth1 -n vrrp
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值