Shared storage

From GigaTux Wiki
Revision as of 12:05, 15 April 2013 by Cocodude (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
  1. Configure the network between the two servers
  2. Allow through ports 7788-7799 only
  3. Create the logical volume cloud
  4. Install drbd8-utils
  5. Change the startup group in /etc/drbd.d/global_common.conf to read:
startup {
  wfc-timeout 10;
  degr-wfc-timeout: 10;
}
net {
  ping-timeout: 100;
}
  1. 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;
  }
}
  1. Run drbdadm create-md r0
  2. Add drbd to /etc/modules and modprobe it
  3. Run drbdadm up r0
  4. On one of the nodes only, run drbdadm -- --overwrite-data-of-peer primary r0
  5. After sync, run drbdadm primary r0 on both nodes
  6. apt-get install corosync openais corosync-dev libdlm-dev
  7. Install customised lvm2 package. This is basically the lvm2 source following the instructions here with the rules file having --enable-cluster=internal and --enable-clvm=corosync,openais. Remember to run apt-get build-dep lvm2 and apt-get install devscripts first.
  8. Copy clvm daemon to /usr/sbin/. This is in debian/build/install_deb/usr/sbin/clvmd
  9. mkdir /etc/ais
  10. Download the /etc/init.d/openais script from the site but also do the following:
    1. chmod u+x
    2. Change reference to openais-cfgtool to corysync-cfgtool
    3. Add killall corosync to stop) and restart)
  11. Download the /etc/init.d/clvm init script but also do the following:
    1. Add BEGIN INIT INFO section as per cloud1
  12. Run insserv openais
  13. Run insserv clvm
  14. Allow through firewall: iptables -A INPUT -p udp -i eth1 -m multiport --ports 5405 -j ACCEPT
  15. Change filter directive in /etc/lvm/lvm to read filter = [ "a/sd.*/", "a/drbd.*/", "r/.*/" ]. Information on this is available in this bug.
  16. pvcreate /dev/drbd1
  17. vgcreate --clustered y lvm_r0 /dev/drbd1
  18. Enable CLVM by setting locking_type=3 in lvm.conf. Possibly run lvmconf --enable-cluster on live systems.