zoukankan      html  css  js  c++  java
  • keepalived1.4.0安装启动卸载

    下载地址:http://www.keepalived.org/

    2.安装keepalived

    解压

    tar -zxvf keepalived-1.4.0.tar.gz   

    安装gcc命令

    yum install -y gcc openssl-devel popt-devel  

     

    安装好gcc后

    cd keepalived-1.4.0进入解压的keepalived目录下,执行

    ./configure --prefix=/usr/local/keepalived 

      

    在keepalived-1.4.0目录里make编译和安装

     make && make install 

     以上步骤如果没有错误,则说明编译安装成功。但此时还不能直接使用安装的keepalived,需要拷贝几个文件到指定的目录下才可以直接使用。拷贝的文件如下:

    cp keepalived-1.4.0/keepalived/etc/init.d/keepalived    /etc/init.d/ 
    
    mkdir /etc/keepalived
    
    cp /usr/local/keepalived/etc/keepalived/keepalived.conf    /etc/keepalived/  
    
    cp keepalived-1.4.0/keepalived/etc/sysconfig/keepalived   /etc/sysconfig/  
    
    cp /usr/local/keepalived/sbin/keepalived  /usr/sbin/ 
    

      

     复制完后就可以启动keepalived

    查看指定keepalived安装目录

    whereis keepalived

     启动之前执行

    systemctl daemon-reload

    启动keepalived

    systemctl start keepalived.service

    停止keepalived

    systemctl stop keepalived.service

    验证是否启动成功

    ps -aux | grep keepalived  

    正常启动后,这里有3条记录,其中一个是父进程,负责监控其子进程。一个是vrrp子进程,另外一个是checkers子进程。其他情况说明启动失败。

    设置开启启动:

    chkconfig keepalived on

    2.keepalived 卸载

    进入keepalived解压目录的keepalived目录下,

    cd /root/java/keepalived/keepalived-1.4.0

     执行命令:

    make uninstall

    然后删除我们安装时候拷贝相关文件

    rm -rf /etc/init.d/keepalived 

    rm -rf  /etc/keepalived/ 

    rm -rf  /etc/sysconfig/keepalived 

    rm -rf  /usr/sbin/keepalived  

    rm -rf  /lib/systemd/system/keepalived.service

    这样keepalived就删除完了

  • 相关阅读:
    CentOS 6、CentOS 7系统设置防火墙及使用区别
    HAProxy 使用小记
    oracle快速创建用户、imp/exp导入导出dmp文件
    $@和$*的作用和区别
    根据命令行输出key-value键值对
    mysql备份
    mysql大表归档后清理数据
    redis数据修复记录-1
    redis数据修复记录-2
    调整mysql路径
  • 原文地址:https://www.cnblogs.com/Amywangqing/p/14768232.html
Copyright © 2011-2022 走看看