keepalived04:執行定製指令碼

來源:互聯網
上載者:User

keepalived04:執行定製指令碼 01在MASTER,BACKUP切換後可以執行定製的指令碼:02配置執行個體:03 04! Configuration File for keepalived05 06global_defs {07   notification_email {08        oscersong007@gmail.com09   }10   notification_email_from keepalived@localhost11   smtp_server 127.0.0.112   smtp_connect_timeout 3013   router_id LVS_DEVEL14}15vrrp_sync_group VGM {16    group {17         VI_118    }19    notify_master /path/to/to_master.sh #表示當切換到master狀態時,要執行的指令碼20 21    notify_backup /path_to/to_backup.sh #表示當切換到backup狀態時,要執行的指令碼22 23    notify_fault "/path/fault.sh VG_1"  #表示切換出現故障時要執行的指令碼24 25}26vrrp_script chk_http_port {27    script "killall -0 httpd"28        interval 129}30vrrp_instance VI_1 {31    state BACKUP32    interface eth033    virtual_router_id 5134    priority 5035    advert_int 136    authentication {37        auth_type PASS38        auth_pass westos39    }40    track_interface {41        eth042                eth143    }44    virtual_ipaddress {45        192.168.0.150/24 dev eth046                10.0.0.150/24 dev eth147    }48    track_script {49    chk_http_port50}51} 

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.