keepalived安装

原创
2017/04/25 15:48
阅读数 5

1.11.keepalived

1.确保已经安装apt-get install libssl-dev libpopt-dev openssl make gcc

2.下载最新版keepalived包,此时为keepalived-1.3.5.tar.gz

3.解压在目录/user/local/下  tar zxvf keepalived-1.3.5.tar.gz

4.cd keepalived-1.3.5

5.    sudo ./configure

sudo make

sudo make instal

6. sudo mkdir /etc/keepalived

sudo touch /etc/keepalived/chk_nginx.sh

sudo vi /etc/keepalived/chk_nginx.sh

---------------------------------------------------------------------------

#!/bin/bash

if [ `ps -C nginx --no-header |wc -l` -eq 0 ]; then

    killall keepalived

fi

---------------------------------------------------------------------------

7. sudo chmod +x /etc/keepalived/chk_nginx.sh

sudo touch /etc/keepalived/keepalived.conf

MASTER :

  SLAVE:

8. 启动:keepalived

   停止:killall keepalived

 

展开阅读全文
打赏
0
0 收藏
分享
加载中
更多评论
打赏
0 评论
0 收藏
0
分享
返回顶部
顶部