最近搭建keepalived双机热备, 在网上博采众之所长, 整理一下自己的笔记!
在新搭建的centos6.x下最好下载一下阿里云源:
centos:http://mirrors.aliyun.com/help/centos
1、备份
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
2、下载新的CentOS-Base.repo 到/etc/yum.repos.d/
CentOS 5
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo
或者
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo
CentOS 6
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
或者
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
CentOS 7
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
或者
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
3、之后运行yum makecache生成缓存
========================================================================================================
准备2台电脑来做这个实验:
192.168.232.137 web服务器 keepalived nginx
192.168.232.138 web服务器 keepalived nginx\
虚拟IP (VIP):192.168.232.17
虚拟IP (VIP):192.168.232.18
137上面:
vim /etc/sysconfig/network-scripts/ifcfg-eth0