heartbeat3 0 4安裝配置詳解

2021-09-05 05:09:07 字數 4073 閱讀 1840

(一) 環境說明

作業系統:centos 5.4 x86_64

節點1:

主機名:aos

ip:***xx.82

節點2:

主機名:weibo

ip:***x.82

注意:2個節點都要在各自的hosts檔案中指定節點主機名和ip的對應關係,在ha.cf中node引數指定的主機名要和uname –a,host檔案裡指定的相同

(二) heartbeat3.0組成

heartbeat3.0版本有三部分組成:heartbeat、cluster glue、resource agents

1、hearbeat本身是整個集群的基礎(cluster messaging layer),負責維護集群各節點的資訊以及它們之前通訊;

2、cluster-glue相當於乙個中間層,可以將heartbeat和crm(pacemaker)聯絡起來,主要包含2個部分,lrm和stonith;

3、resource-agent,就是各種的資源的ocf指令碼,這些指令碼將被lrm呼叫從而實現各種資源啟動、停止、監控等等。

(三) 建立使用者和組

[root@aos ha.d]# groupadd haclient

[root@aos ha.d]# useradd hacluster -g haclient -s /sbin/nologin

(四) 安裝 ? 安裝cluster-glue

? 安裝resource-agent

#vi /usr/local/ha_soft/include/heartbeat/glue_config.h(找到如下幾個設定項刪除對應的行)

ha_sysconfdir

ha_hbconf_dir

ha_hbconf_dir

#make

#vim /etc/ld.so.conf.d/heartbeat.conf(輸入如下行)

/usr/local/ha_soft/lib

#ldconfig

#make install

? 安裝heartbeat

# vim /srv/heartbeat-3-0-stable-3.0.4/lib/plugins/hbcomm/hbaping.c(安裝原始碼目錄,刪除326行)

#make

#make install

(五) 配置(節點1和節點2相同,區別就是檢查ip是對方) ? 從原始碼編譯目錄中複製配置檔案到安裝目錄

[root@aos ha.d]# cd /usr/local/ha_soft/etc/ha.d

[root@aos ha.d]# vim ha.cf

#debugfile /var/log/ha-debug

#logfile /var/log/ha-log

logfacility local0

keepalive 2

deadtime 6

warntime 4

initdead 30

u***ort 694

ucast eth1 192.168.1.200

auto_failback off

node aos

node weibo

compression bz2

compression_threshold 2

ping_group group1 ***xx82 ***x.80

respawn root /usr/local/ha_soft/lib/heartbeat/ipfail

apiauth ipfail gid=root uid=root

debug 0

? 編輯authkeys 驗證資訊檔案

[root@aos ha.d]# cd /usr/local/ha_soft/etc/ha.d

[root@aos ha.d]# vim authkeys

auth 1

1 crc

[root@aos ha.d]# chmod 600 authkeys

? 編輯haresources 資源控制配置檔案

[root@aos ha.d]# cd /usr/local/ha_soft/etc/ha.d

[root@aos ha.d]# vim haresources

aos ipaddr::***xx.70/25/eht0/***xx.127

? 鏈結檔案

[root@aos heartbeat]# vim /etc/ld.so.conf(加入到檔案末尾)

/usr/local/ha_soft/lib/

[root@aos heartbeat]# ldconfig

#cp /usr/local/ha_soft/etc/ha.d/resource.d/hto-mapfuncs /usr/local/ha_soft/etc/ha.d/resource.d/hto-mapfuncs.bak

[root@aos heartbeat]# vim +35 /usr/local/ha_soft/etc/ha.d/resource.d/hto-mapfuncs(注釋35行)

(六) 註冊並且啟動服務

heartbeat3 0 4安裝配置詳解

一 環境說明 作業系統 centos 5.4 x86 64 節點1 主機名 aos ip xx.82 節點2 主機名 weibo ip x.82 注意 2個節點都要在各自的hosts檔案中指定節點主機名和ip的對應關係,在ha.cf中node引數指定的主機名要和uname a,host檔案裡指定的相...

heartbeat3 0 4安裝配置詳解

一 環境說明 作業系統 centos 5.4 x86 64 節點1 主機名 aos ip xx.82 節點2 主機名 weibo ip x.82 注意 2個節點都要在各自的hosts檔案中指定節點主機名和ip的對應關係,在ha.cf中node引數指定的主機名要和uname a,host檔案裡指定的相...

centos7下安裝配置redis3 0 4

安裝redis 2 在linux usr資料夾下新建redis資料夾,拷貝安裝包redis 3.0.4.tar.gz到redis資料夾 3 解壓tar.gz包 root localhost redis tar zxvfredis 3.0.4.tar.gz 4 編譯安裝包 root localhost...