drbd:
global {
usage-count yes;
# minor-count dialog-refresh disable-ip-verification
}
common {
handlers {
# These are EXAMPLE handlers only.
# They may have severe implications,
# like hard resetting the node under certain circumstances.
# Be careful when chosing your poison.
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 60;
degr-wfc-timeout 120;
#outdated-wfc-timeout wait-after-sb
}
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
}
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 discard-zero-changes;
after-sb-1pri discard-secondary;
after-sb-2pri disconnect;
#always-asbp rr-conflict
# ping-timeout data-integrity-alg tcp-cork on-congestion
# congestion-fill congestion-extents csums-alg verify-alg
# use-rle
}
}
global-originale 8.4.4
global {
usage-count no;
# minor-count dialog-refresh disable-ip-verification
}
common {
handlers {
# These are EXAMPLE handlers only.
# They may have severe implications,
# like hard resetting the node under certain circumstances.
# Be careful when chosing your poison.
# 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
}
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
}
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
}
}
risorse:
resource resa {
protocol C;
net {
allow-two-primaries ;
}
startup {
become-primary-on both;
}
on n4 {
device /dev/drbd0;
disk /dev/sda6;
address 192.168.1.117:7788;
meta-disk internal;
}
on n5 {
device /dev/drbd0;
disk /dev/sda6;
address 192.168.1.107:7788;
meta-disk internal;
}
}
cluster
<?xml version="1.0"?>
<cluster name="clstr" config_version="3">
<fence_daemon clean_start="1" post_fail_delay="0" post_join_delay="5"/>
<clusternodes>
<clusternode name="n4" nodeid="1">
<fence>
<method name="ack-redirect">
<device name="manual" port="n4"/>
</method>
</fence>
</clusternode>
<clusternode name="n5" nodeid="2">
<fence>
<method name="ack-redirect">
<device name="manual" port="n5"/>
</method>
</fence>
</clusternode>
</clusternodes>
<cman expected_votes="1" two_node="1" transport="udpu"/>
<fencedevices>
<fencedevice name="manual" agent="fence_pcmk"/>
</fencedevices>
<rm>
<failoverdomains/>
<resources/>
</rm>
<dlm enable_quorum="0" enable_fencing="0"/>
<gfs_controld enable_withdraw="0"/>
</cluster>
agenti fence:
dovrebbe essere:
fence_ack_manual
oppure:
fence_pcmk
ma con l'aggiunta dell'opzione port=“nomenodo” nel device method
esempio:
<?xml version="1.0"?>
<cluster name="clstr" config_version="4">
<clusternodes>
<clusternode name="n4" votes="1" nodeid="1">
<fence>
<method name="single">
<device name="manual" port="n4"/>
</method>
</fence>
</clusternode>
<clusternode name="n5" votes="1" nodeid="2">
<fence>
<method name="single">
<device name="manual" port="n4"/>
</method>
</fence>
</clusternode>
</clusternodes>
<fencedevices>
<fencedevice name="manual" agent="fence_ack_manual"/></fencedevices>
<rm>
<failoverdomains/>
<resources/>
</rm>
</cluster>
oppure:
<?xml version="1.0"?>
<cluster config_version="1" name="mycluster">
<logging debug="off"/>
<clusternodes>
<clusternode name="pcmk-1" nodeid="1">
<fence>
<method name="pcmk-redirect">
<device name="pcmk" port="pcmk-1"/>
</method>
</fence>
</clusternode>
<clusternode name="pcmk-2" nodeid="2">
<fence>
<method name="pcmk-redirect">
<device name="pcmk" port="pcmk-2"/>
</method>
</fence>
</clusternode>
</clusternodes>
<fencedevices>
<fencedevice name="pcmk" agent="fence_pcmk"/>
</fencedevices>
</cluster>
hosts
127.0.0.1 localhost 192.168.1.117 n4 192.168.1.107 n5 ::1 localhost ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters #127.0.1.1 n4
interface
auto eth0
iface eth0 inet static
address 192.168.1.117
netmask 255.255.255.0
gateway 192.168.1.1
servizi default rcS
K05hwclock.sh S03keyboard-setup S09mountall-bootclean.sh S15console-setup K12rpcbind S04mountdevsubfs.sh S10procps S16alsa-utils K13nfs-common S05checkroot.sh S10udev-mtab S16bootmisc.sh README S06checkroot-bootclean.sh S10urandom S16plymouth-log S01fake-hwclock S06kmod S11networking S16x11-common S01hostname.sh S06mtab.sh S12mountnfs.sh S01mountkernfs.sh S07checkfs.sh S13mountnfs-bootclean.sh S02udev S08mountall.sh S14kbd
servizi default rc2
K01lightdm README S01ifplugd S01triggerhappy S02ntp S05plymouth K03drbd S01bootlogs S01motd S02cron S02rsync S05rc.local K05nfs-common S01cgroup-bin S01rsyslog S02dbus S02ssh S05rmnologin K05rpcbind S01dhcpcd S01sudo S02dphys-swapfile S04avahi-daemon
dopo inst cman e gfs2
K05hwclock.sh S04mountdevsubfs.sh S10urandom K12rpcbind S05checkroot.sh S11networking K13nfs-common S06checkroot-bootclean.sh S12mountnfs.sh K16alsa-utils S06kmod S13mountnfs-bootclean.sh K16x11-common S06lvm2 S14kbd README S06mtab.sh S15console-setup S01fake-hwclock S07checkfs.sh S16bootmisc.sh S01hostname.sh S08mountall.sh S16cman S01mountkernfs.sh S09mountall-bootclean.sh S16plymouth-log S02udev S10procps S17gfs2-tools S03keyboard-setup S10udev-mtab
dopo inst cman e gfs2 rc2
K01avahi-daemon K06rpcbind S01triggerhappy S02ssh K01cgroup-bin README S02cron S03drbd K01dhcpcd S01bootlogs S02dbus S04corosync K01ifplugd S01motd S02dphys-swapfile S05plymouth K01lightdm S01rsyslog S02ntp S05rc.local K06nfs-common S01sudo S02rsync S05rmnologin
inserire l'avvio del drbd qui:
vi /etc/rcS.d/S12mountnfs.sh