keepalived01:雙網卡伺服器雙機熱備

來源:互聯網
上載者:User

keepalived01:雙網卡伺服器雙機熱備 01keepalived雙網卡伺服器雙機熱備02 03環境:04    master: eth0(192.168.0.100/24) eth1(10.0.0.100/24)05    backup: eth0(192.168.0.200/24) eth1(10.0.0.200/24)06 07軟體安裝:08    安裝依賴:09            yum install ipvsadm kernel-devel openssl-devel popt-devel \10           libnl-devel gcc make -y11    解壓編譯:12            tar zxf keepalived-1.2.7.tar.gz13            cd keepalived-1.2.714            ./configure --prefix=/usr/local/keepalived15            make && make install16    做連結:17            ln -s /usr/local/keepalived/etc/rc.d/init.d/keepalived /etc/init.d/18            ln -s /usr/local/keepalived/etc/sysconfig/keepalived /etc/sysconfig/19            ln -s /usr/local/keepalived/etc/keepalived/ /etc/20            ln -s /usr/local/keepalived/sbin/keepalived /usr/sbin/21    備份設定檔:22            cp /etc/keepalived/keepalived.conf /etc/keepalived/keepalived.conf.bak23    添加使用者:24            useradd keepalived25 26修改配置:27     vi /etc/keepalived/keepalived.conf28###############################################################29! Configuration File for keepalived30 31global_defs {32   notification_email {33        oscersong007@gmail.com34   }35   notification_email_from keepalived@localhost36   smtp_server 127.0.0.137   smtp_connect_timeout 3038   router_id LVS_DEVEL39}40vrrp_sync_group VGM {41        group {42         VI_143    }44}45vrrp_instance VI_1 {46    state MASTER      #BACKUP47    interface eth048    virtual_router_id 5149    priority 100      #5050    advert_int 151    authentication {52        auth_type PASS53        auth_pass westos54    }55    track_interface {56                eth057                eth158    }59    virtual_ipaddress {60                192.168.0.150/24 dev eth061                10.0.0.150/24 dev eth162    }63}64 65###############################################################66 67啟動服務測試:68    tail -f /var/log/message69    /etc/init.d/keepalived start(master,backup)70    master的測試頁面“MASTER”,backup的測試頁面“BACKUP”71 72master,backup的keepalived都啟動時在backup端測試:73[root@backup ~]# curl http://192.168.0.15074MASKTER75[root@backup ~]# curl http://10.0.0.15076MASKTER77將master的eht1 down掉後在backup端測試:78[root@backup ~]# curl http://192.168.0.15079BACKUP80[root@backup ~]# curl http://10.0.0.15081BACKUP 

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.