keepalived +nfs

作者: ropon 分类: 分布式集群 发布时间: 2018-04-13 16:27

cat /etc/hosts
172.16.8.20 fs1
172.16.8.21 fs2
172.16.8.22 fs
1、安装服务
yum -y install keepalived
yum install nfs-utils rpcbind -y

net.ipv4.ip_forward=1
net.ipv4.conf.all.rp_filter=0
net.ipv4.conf.default.rp_filter=0

! Configuration File for keepalived

global_defs {
router_id RSYNC_MASTER
}

vrrp_instance VI_1 {
state MASTER
interface eth1
virtual_router_id 60
priority 100
advert_int 1
authentication {
auth_type PASS
auth_pass 1111
}
virtual_ipaddress {
172.16.8.120
}
}

virtual_server 192.16.8.120 873 {
delay_loop 6
lb_algo rr
lb_kind NAT
nat_mask 255.255.255.0
persistence_timeout 5
protocol TCP

real_server 172.16.8.20 873 {
weight 3
TCP_CHECK {
connect_timeout 3
nb_get_retry 3
delay_before_retry 3
connect_port 873
}
}

real_server 172.16.9.21 873 {
weight 3
TCP_CHECK {
connect_timeout 3
nb_get_retry 3
delay_before_retry 3
connect_port 873
}
}
}

如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!

发表评论

电子邮件地址不会被公开。 必填项已用*标注