10.0.0.84 u1 10.0.0.115 u2 10.0.0.120 u0
resource r0 {
protocol C;
syncer {
rate 4M;
}
startup {
wfc-timeout 15;
degr-wfc-timeout 60;
}
net {
after-sb-0pri discard-zero-changes;
after-sb-1pri discard-secondary;
after-sb-2pri disconnect;
cram-hmac-alg sha1;
shared-secret somesecretword;
}
on u1 {
device / dev / drbd0;
disk / dev / sda2;
address 10.0.0.84:7788;
meta-disk internal;
}
on u2 {
device / dev / drbd0;
disk / dev / sda2;
address 10.0.0.115:7788;
meta-disk internal;
}
}
dd if = / dev / zero of = / dev / sda2 bs = 64M drbdadm create-md r0
/etc/init.d/drbd start
0: cs: Connected ro: Secondary / Secondary ds: Inconsistent / Inconsistent C r ----
drbdadm - --overwrite-data-of-peer primary r0
0: cs: SyncSource ro: Primary / Secondary ds: UpToDate / Inconsistent C r ----
ns: 241984 nr: 0 dw: 0 dr: 242184 al: 0 bm: 14 lo: 510 pe: 179 ua: 510 ap: 0 ep: 1 wo: b oos: 782664
[===> ................] sync'ed: 23.6% (782664/1023932) K
finish: 0:04:04 speed: 3,160 (3,172) K / sec
mkfs.xfs / dev / drbd0
update-rc.d -f drbd remove
logfacility daemon keepalive 2 deadtime 15 warntime 5 initdead 120 udpport 694 ucast eth0 10.0.0.115 ucast eth0 10.0.0.84 auto_failback on node u1 node u2 use_logd yes crm respawn
auth 1 1 sha1 somesecretword
chmod 600 / etc / heartbeat / authkeys
/etc/init.d/heartbeat start
============ Last updated: Fri Feb 10 09:33:04 2012 Stack: Heartbeat Current DC: u1 (86b204d8-ee3e-47c7-ba0e-1dcbd40a20da) - partition with quorum Version: 1.0.9-unknown 2 Nodes configured, 2 expected votes 2 Resources configured. ============ Online: [u2 u1]
node $ id = "86b204d8-ee3e-47c7-ba0e-1dcbd40a20da" u1
node $ id = "c6e3c21f-da3e-4031-9f28-a7e33425a817" u2
primitive drbd0 ocf: linbit: drbd \
params drbd_resource = "r0" \
op start interval = "0" timeout = "240" \
op stop interval = "0" timeout = "100" \
op monitor interval = "20" role = "Slave" timeout = "20" depth = "0" \
op monitor interval = "10" role = "Master" timeout = "20" depth = "0"
primitive fs0 ocf: heartbeat: Filesystem \
params directory = "/ shared" fstype = "xfs" device = "/ dev / drbd / by-res / r0" options = "noatime, nodiratime, nobarrier, logbufs = 8" \
op start interval = "0" timeout = "60" \
op stop interval = "0" timeout = "60" \
op notify interval = "0" timeout = "60" \
op monitor interval = "20" timeout = "40" depth = "0" \
meta target-role = "Started"
primitive ip0 ocf: heartbeat: ipaddr2 \
params ip = "10.0.0.120" nic = "eth0: 0" \
op monitor interval = "5s" \
meta target-role = "Started"
primitive nfs0 ocf: itl: exportfs \
params directory = "/ shared" clientspec = "10.0.0.0/255.255.255.0" options = "rw, no_root_squash, sync, no_wdelay" fsid = "1" \
op start interval = "0" timeout = "40" \
op stop interval = "0" timeout = "60" \
op monitor interval = "30" timeout = "55" depth = "0" OCF_CHECK_LEVEL = "10" \
meta target-role = "Started"
group ha_nfs fs0 nfs0 ip0 \
meta target-role = "Started"
ms ms_drbd0 drbd0 \
meta master-max = "1" master-node-max = "1" clone-max = "2" clone-node-max = "1" notify = "true"
colocation c_nfs inf: nfs0 ms_drbd0: Master
order o_nfs inf: ms_drbd0: promote ha_nfs: start
property $ id = "cib-bootstrap-options" \
dc-version = "1.0.9-unknown" \
cluster-infrastructure = "Heartbeat" \
stonith-enabled = "false" \
expected-quorum-votes = "2" \
no-quorum-policy = "ignore" \
symmetric-cluster = "true" \
last-lrm-refresh = "1328625786"
rsc_defaults $ id = "rsc_defaults-options" \
resource-stickiness = "10,000"
============
Last updated: Fri Feb 10 09:33:04 2012
Stack: Heartbeat
Current DC: u1 (86b204d8-ee3e-47c7-ba0e-1dcbd40a20da) - partition with quorum
Version: 1.0.9-unknown
2 Nodes configured, 2 expected votes
2 Resources configured.
============
Online: [u2 u1]
Resource Group: ha_nfs
fs0 (ocf :: heartbeat: Filesystem): Started u1
nfs0 (ocf :: itl: exportfs): Started u1
ip0 (ocf :: heartbeat: ipaddr2): Started u1
Master / Slave Set: ms_drbd0
Masters: [u1]
Slaves: [u2]
u0: / shared / var / CommuniGate / SharedDomains nfs bg, intr 0 0
Source: https://habr.com/ru/post/137938/
All Articles