drbd配置檔案 drbd安裝及配置

2021-10-17 01:51:51 字數 3984 閱讀 9571

一、安裝環境

作業系統:rhel6.1

drdb版本:drbd-8.4.1

二、drdb-8.4.1編譯;安裝本地yum環境。

1.安裝gcc flex rpm-build kernel-devel docbook* xsl*用於編譯原包和解決依賴性:

yum install gcc flex rpm-build kernel-devel docbook* xsl*

3.進入drbd-8.4.1目錄:./configure

4.編譯為rpm包:make rpm ; make km-rpm (編譯核心模組)

5.編譯完成後會出現如下rpm包這些包在$home/rpmbuild/rpms/x86_64目錄中

drbd-8.4.1-1.el6.x86_64.rpm

drbd-km-2.6.32_131.0.15.el6.x86_64-8.4.1-1.el6.x86_64.rpm

drbd-utils-8.4.1-1.el6.x86_64.rpm

drbd-bash-completion-8.4.1-1.el6.x86_64.rpm

drbd-pacemaker-8.4.1-1.el6.x86_64.rpm

drbd-xen-8.4.1-1.el6.x86_64.rpm

drbd-heartbeat-8.4.1-1.el6.x86_64.rpm

drbd-udev-8.4.1-1.el6.x86_64.rpm

6.安裝:rpm -ivh drdb*

7.啟動drbd模組:modprobe drbd ; lsmod |grep drbd (檢視模組是否新增)

配置檔案:

在drbd安裝完成後,/etc目錄下會有drdb.conf檔案和drbd.d目錄。其中drbd.conf檔案為主控制檔案,檔案中的內容為include "drbd.d/global_common.conf";

include "drbd.d/*.res";意思是具體詳細的配置需要到drbd.d目錄下的下列檔案進行編輯,這是為了更好的分清各配置的功能。當然也可以將這兩個檔案的內容寫到drbd.conf中,這樣也可以達到同樣目的。

一、編輯global_common.conf檔案。此檔案為drbd的全域性配置檔案

global {

usage-count no; #用於提示時候有新版本的drbd

# minor-count dialog-refresh disable-ip-verification

common {

handlers {

pri-on-incon-degr "/usr/lib/drbd/notify-pri-on-incon-degr.sh; /usr/lib/drbd/notify-emergency-reboot.sh; echo b > /proc/sysrq-trigger ; reboot -f";

pri-lost-after-sb "/usr/lib/drbd/notify-pri-lost-after-sb.sh; /usr/lib/drbd/notify-emergency-reboot.sh; echo b > /proc/sysrq-trigger ; reboot -f";

local-io-error "/usr/lib/drbd/notify-io-error.sh; /usr/lib/drbd/notify-emergency-shutdown.sh; echo o > /proc/sysrq-trigger ; halt -f";

# fence-peer "/usr/lib/drbd/crm-fence-peer.sh";

# split-brain "/usr/lib/drbd/notify-split-brain.sh root";

# out-of-sync "/usr/lib/drbd/notify-out-of-sync.sh root";

# before-resync-target "/usr/lib/drbd/snapshot-resync-target-lvm.sh -p 15 -- -c 16k";

# after-resync-target /usr/lib/drbd/unsnapshot-resync-target-lvm.sh;

startup {

# wfc-timeout degr-wfc-timeout outdated-wfc-timeout wait-after-sb

wfc-timeout 15;

degr-wfc-timeout 15;

outdated-wfc-timeout 15;

options {

# cpu-mask on-no-data-accessible

disk {

# size max-bio-bvecs on-io-error fencing disk-barrier disk-flushes

# disk-drain md-flushes resync-rate resync-after al-extents

# c-plan-ahead c-delay-target c-fill-target c-max-rate

# c-min-rate disk-timeout

on-io-error detach;

fencing resource-and-stonith;

resync-rate 33m

net {

# protocol timeout max-epoch-size max-buffers unplug-watermark

# connect-int ping-int sndbuf-size rcvbuf-size ko-count

# allow-two-primaries cram-hmac-alg shared-secret after-sb-0pri

# after-sb-1pri after-sb-2pri always-asbp rr-conflict

# ping-timeout data-integrity-alg tcp-cork on-congestion

# congestion-fill congestion-extents csums-alg verify-alg

# use-rle

protocol c;#使用同步複製模式,當主備資料完全同步後才會停止寫;protocol一共三種模式:a為非同步模式,當主節點與次節點距離遠時使用;b為記憶體同步複製模式,當主備同時掉電時,主節點儲存資料招到不可逆損壞時,資料將丟失。

after-sb-0pri disconnect

after-sb-1pri disconnect

after-sb-2pri disconnect

rr-conflict   disconnect

2.編輯資源檔案drbd.res 此檔案為drbd資源。

- 普通磁碟資源管理方式:

vi /etc/drbd.d/drbd.res

resource r0 {

on drbd1 {

device /dev/drbd0;

disk   /dev/sdb1;

address 10.10.10.15;

meta-disk internal;

on drbd2 {

device /dev/drbd0;

disk   /dev/sdb1;

address 10.10.10.16;

meta-disk internal;

- 捲組管理方式

resource r0 {

on drbd1 {

volume 1 {

device /dev/drbd0;

disk   /dev/sdb1;

address 10.10.10.15;

meta-disk internal;

on drbd2 {

volume 1 {

device /dev/drbd0;

disk   /dev/sdb1;

address 10.10.10.16;

meta-disk internal;

drbd配置檔案 drbd配置檔案

drbd配置檔案 vim usr local drbd etc drbd.d global common.conf global usage count yes 是否參加drbd使用者統計 common protocol c 使用drbd的第三種同步協議 disk 使用dpod功能保證在數 on i...

DRBD配置檔案引數解析

drbd配置檔案引數解析1drbd配置檔案 drbd配置檔案 etc drbd.conf控制drbd的所有方方面面。正常情況下此配置檔案就是乙個包含以下兩行內容的構架 include etc drbd.d global common.conf include etc drbd.d res 按照慣例,...

drbd配置和報錯

環境 redhat 6.5 核心 2.6.32 431.el6.x86 64 drbd對核心有要求,如果不匹配會報錯 node1 192.168.1.61 node2 192.168.1.67 兩台伺服器都加了一塊900ghdd盤 1.首先把兩台伺服器名字修改 vim etc host 192.16...