Shared storage: Difference between revisions
Jump to navigation
Jump to search
Created page with "# Configure the network between the two servers # Allow through ports 7788-7799 only # Create new logical volume on both devices (cloud), 2G # Install drbd8-utils # Change the st..." |
No edit summary |
||
| Line 1: | Line 1: | ||
# Configure the network between the two servers | # Configure the network between the two servers | ||
# Allow through ports 7788-7799 only | # Allow through ports 7788-7799 only | ||
# Install drbd8-utils | # Install drbd8-utils | ||
# Change the startup group in /etc/drbd.d/global_common.conf to read: | # Change the startup group in /etc/drbd.d/global_common.conf to read: | ||
Revision as of 08:48, 11 March 2013
- Configure the network between the two servers
- Allow through ports 7788-7799 only
- Install drbd8-utils
- Change the startup group in /etc/drbd.d/global_common.conf to read:
startup {
wfc-timeout 10;
degr-wfc-timeout: 10;
}
- Create /etc/drbd.d/r0.res:
resource r0 {
on cloud1 {
device /dev/drbd1;
disk /dev/lvm1/cloud;
address 192.168.1.1:7789;
meta-disk internal;
}
on cloud2 {
device /dev/drbd1;
disk /dev/lvm1/cloud;
address 192.168.1.2:7789;
meta-disk internal;
}
net {
allow-two-primaries;
}
startup {
become-primary-on both;
}
syncer {
rate 20M;
}
}
- Run drbdadm create-md r0
- Add drbd to /etc/modules and modprobe it
- Run drbdadm up r0
- On one of the nodes only, run drbdadm -- --overwrite-data-of-peer primary resource
- After sync, run drbd-primary r0 on both nodes
- apt-get install clvm cman
- Create a minimal cluster configuration file /etc/cluster/cluster.conf:
<cluster name="vmachines" config_version="1">
<cman expected_votes="1" two_node="1">
</cman>
<clusternodes>
<clusternode name="cloud1" votes="1" nodeid="1">
<fence>
<method name="1">
<device name="dummy" nodename="cloud1" />
</method>
</fence>
<unfence>
<device name="dummy" nodename="cloud1" action="on" />
</unfence>
</clusternode>
<clusternode name="cloud2" votes="1" nodeid="2">
<fence>
<method name="2">
<device name="dummy" nodename="cloud2" />
</method>
</fence>
<unfence>
<device name="dummy" nodename="cloud2" action="on" />
</unfence>
</clusternode>
</clusternodes>
<logging to_syslog="yes" to_logfile="yes" syslog_facility="daemon" syslog_priority="info">
</logging>
<fence_daemon post_join_delay="3" />
<totem rrp_mode="none" secauth="off"/>
<fencedevices>
<fencedevice name="dummy" agent="dummyfence" />
</fencedevices>
</cluster>
- Create /sbin/dummyfence with the conents:
#!/bin/bash echo "success: dummyfence $2" exit 0
- chmod u+x this
- Create /var/run/lvm directory
- Run /etc/init.d/cman and /etc/init.d/clvm
- pvcreate /dev/drbd1
- vgcreate --clustered y lvm_r0 /dev/drbd1
Enabling CLVM is as easy as setting locking_type=3 in lvm.conf. Possibly run lvmconf --enable-cluster on live systems.