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
  • 相关阅读:
    Java 抽象类
    7.队列的链表实现
    6.队列的数组实现
    5.栈的链表实现
    4.栈的数组实现
    3.线性表-cursor
    2.线性表-Linked list
    1.线性表-Array
    hello world!
    boost 大小端转换
  • 原文地址:https://www.cnblogs.com/szhhhh/p/12297364.html
Copyright © 2011-2022 走看看