Linux HA叢集部署(基於Heartbeat與pacemaker)

來源:互聯網
上載者:User

伺服器叢集一般來說有三種:

   HA叢集能夠取代磁碟陣列提供叢集節點間熱備;

   LB叢集能夠提供動態負載和虛擬機器主機;

   HP叢集提供高效能運算叢集。

HA作為高可用性設定組群,為不間斷服務提供保障,這幾天剛好有項目使用Linux叢集,剛好把配置過程記錄一下。以下過程是在archlinux上進行操作。

(1)    安裝Cluster Glue(依賴:libtool、glib2、net-snmp、python、libxml2)
./autogen.sh
./configure
make
make install (root 許可權)
(2)    安裝resource agents
./autogen.sh
./configure
make
make install
(3)    安裝heartbeat
  ./bootstrap
  ./ConfigureMe configure(不要直接使用./configure,不知什麼原因這樣會找不到標頭檔)
  make
  make install(root 許可權)
(4)    配置heartbeat
  添加組haclient和使用者hacluster注意兩台機器組和使用者的id要相同
修改/etc/hosts將兩個機器名添加進檔案:

           192.168.0.1   node1

           192.168.3.109 node1

           192.168.0.2    node2

            192.168.3.133 node2
    
  修改/etc/ha.d/ha.cf將node節點添加到檔案中,並根據情況修改具體配置節點:
      keepalive 2
      deadtime 20
      inittime 120
      udpport 694
      bcast  eth0(你的廣播網卡,一般來說是eth0)
auto_failback on
      node    node1
      node   node2
   修改/etc/ha.d/authkeys修改加密方式:
      auth 1
      1 crc
   修改/etc/ha.d/authkeys屬性必須修改為600
   修改/etc/ha.d/haresources添加ip自動漂移處理:

node1 Ipaddr::192.168.3.169/24/eth0 mysql httpd

(5)    安裝pacemaker

./autogen.sh
./configure —with-pacemaker —without-ais —without-corosync
make
make install

注意:apiauth 用來設定使用者組

           respawn 用來迴圈指令

          pacemaker 在python3不能正常運行,需要修改print命令為函數,except的,為as(安裝3.0代碼標準修改)

相關文章

聯繫我們

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