zoukankan      html  css  js  c++  java
  • Linux中使用keepalived高可用工具解决宕机问题

    1. 安装keepalived高可用工具

    1.1 切换目录到/usr/loca中

    1.2 解压该压缩包tar -zxvf keepalived--1.2.18.tar.gz

    1.3 切换目录到解压后的文件keepalived--1.2.18

    1.4  yum install -y openssl openssl-devel

    1.5 ./configure --prefix=/usr/local/keepalived 编译,将编译文件放到/usr/local/keepalived

    1.6 make编译

    1.7 make install安装

    1.8 在/etc/keepalived  创建目录  mkdir /etc/keepalived

    1.9 复制文件操作如下

    1.10 cp /usr/local/keepalived/etc/keepalived/keepalived.conf /etc/keepalived/

    1.11 cp /usr/local/keepalived/etc/rc.d/init.d/keepalived /etc/init.d/

    1.12 cp /usr/local/keepalived/etc/sysconfig/keepalived /etc/sysconfig/

    1.13 ln -s /usr/local/sbin/keepalived /usr/sbin/

    1.14 ln -s /usr/local/keepalived/sbin/keepalived /sbin/

    1.15 将nginx启动脚本和keepalived.conf配置上传到/etc/keepalived

      

    1.16修改主机中的keepalived.conf文件

     1.17 修改备机keepalived.conf文件

    1.19 启动主机和备机后访问页面

    1.20 现在将主机关闭后启动页面

    1.21 keepalived 常用命令

      启动Keepalived:service keepalived start

      关闭Keepalived:service keepalived stop
  • 相关阅读:
    阶段01Java基础day26反射
    阶段01Java基础day25网络编程
    阶段01Java基础day24多线程+GUI
    阶段01Java基础day23多线程
    阶段01Java基础day22IO流03
    阶段01Java基础day21IO流02
    阶段01Java基础day18集合框架04
    阶段01Java基础day17集合框架03
    设置CMD默认路径
    MySQL 快速入门
  • 原文地址:https://www.cnblogs.com/szhhhh/p/12297364.html
Copyright © 2011-2022 走看看