zoukankan      html  css  js  c++  java
  • keepalived双主配置

    主机配置

    global_defs {
    notification_email {
    56375@qq.com
    }
    # notification_email_from Alexandre.Cassen@firewall.loc
    # smtp_server 192.168.200.1
    # smtp_connect_timeout 30
    router_id node1
    # vrrp_skip_check_adv_addr
    # vrrp_strict
    # vrrp_garp_interval 0
    # vrrp_gna_interval 0
    }
    vrrp_script chk_httpd_port {
    script "</dev/tcp/127.0.0.1/80"
    interval 2
    weight 2
    }
    vrrp_instance VI_1 {
    state MASTER
    interface ens160
    virtual_router_id 51
    priority 100
    advert_int 1
    authentication {
    auth_type PASS
    auth_pass 1111
    }
    virtual_ipaddress {
    192.168.1.174
    }
    track_script {
    chk_httpd_port
    }
    }

    vrrp_instance VI_2 {
    state BACKUP
    interface ens160
    virtual_router_id 52
    priority 99
    advert_int 1
    authentication {
    auth_type PASS
    auth_pass 1111
    }
    virtual_ipaddress {
    192.168.1.178
    }
    track_script {
    chk_httpd_port
    }
    }

    备机配置

    global_defs {
    notification_email {
    576@qq.com
    }
    # notification_email_from Alexandre.Cassen@firewall.loc
    # smtp_server 192.168.200.1
    # smtp_connect_timeout 30
    router_id node2
    # vrrp_skip_check_adv_addr
    # vrrp_strict
    # vrrp_garp_interval 0
    # vrrp_gna_interval 0
    }
    vrrp_script chk_httpd_port {
    script "</dev/tcp/127.0.0.1/80"
    interval 2
    weight 2
    }
    vrrp_instance VI_1 {
    state BACKUP
    interface ens160
    virtual_router_id 51
    priority 99
    advert_int 1
    authentication {
    auth_type PASS
    auth_pass 1111
    }
    virtual_ipaddress {
    192.168.1.174
    }
    track_script {
    chk_httpd_port
    }
    }


    vrrp_instance VI_2 {
    state MASTER
    interface ens160
    virtual_router_id 52
    priority 100
    advert_int 1
    authentication {
    auth_type PASS
    auth_pass 1111
    }
    virtual_ipaddress {
    192.168.1.178
    }
    track_script {
    chk_httpd_port
    }
    }

  • 相关阅读:
    理解Golang包导入
    go语言执行windows下命令行的方法
    Go中使用动态库C/C++库
    MongoDB · 引擎特性 · MongoDB索引原理
    Linux中more和less命令用法
    修改Linux文件句柄限制
    MongoDB自动删除过期数据--TTL索引
    mongodb可以通过profile来监控数据 (mongodb性能优化)
    MongoDB学习笔记(索引)
    查看nginx cache命中率
  • 原文地址:https://www.cnblogs.com/tiantianhappy/p/12048171.html
Copyright © 2011-2022 走看看