安装keepalived

1  下载地址

2  进入root目录 创建文件夹

cd /root

mkdir keepalived

cd keepalived/ 

 

3  上传文件

 

4  解压文件

tar -zxvf keepalived-2.0.20.tar.gz 

安装keepalived_第1张图片

5 进入文件

ls

cd keepalived-2.0.20/ 

 

6  将配置文件放在 /etc 目录下, 安装路径在 /usr/local 

./configure --sysconf=/etc --prefix=/usr/local

 

7   编译

make && make install

 

8  安装好了后 有下面两个文件

keepalived 的配置目录在 /etc/keepalived/keepalived.conf

keepalived 的启动指令在 /usr/local/sbin/keepalived

安装keepalived_第2张图片 

9  开始使用keepalived 修改配置文件

vi /etc/keepalived/keepalived.conf 

安装keepalived_第3张图片 

安装keepalived_第4张图片 

10  启动keepalived

/usr/local/sbin/keepalived  

 

11  查看虚拟ip是否绑定成功  如果可以看见自己的虚拟ip说明成功

ip a 

安装keepalived_第5张图片 

你可能感兴趣的:(服务器,linux,运维)