[DRBD-user] HA-Home-Server: DRBD + NFS + QUOTA ( + DHCP + TFTP)

Matteo Guglielmi matteo.guglielmi at epfl.ch
Wed Jul 20 14:41:34 CEST 2011

Note: "permalinks" may not be as permanent as we would like,
direct links of old sources may well be a few messages off.


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Dear All,

I have the following configuration:

2 nodes A and B,

3 lvm partitions (srv, home, software) built on top of drbd (which
manages a 1TB partition on each node in master/slave configuration).

lvm home file system has user and group quota on it.

Each node does mount via fstab a "local" file system (/data) which
also has user and group quota on it.

On both nodes I also have:

update-rc.d -f drbd              remove
update-rc.d    heartbeat         defaults
update-rc.d -f nfs-kernel-server remove
update-rc.d    quotarpc          defaults
update-rc.d    autofs            defaults
update-rc.d -f quota             remove

cat /etc/exports

/share/drbd/nfs/srv
192.168.0.0/24(rw,sync,no_subtree_check,no_root_squash)
/share/drbd/nfs/home
192.168.0.0/24(rw,sync,no_subtree_check,no_root_squash)
/share/drbd/nfs/software
192.168.0.0/24(rw,sync,no_subtree_check,no_root_squash)

cat /etc/auto.master

/share/nfs /etc/auto.nfs --timeout=60 --ghost

cat /etc/auto.nfs

srv      -soft,rw,intr 192.168.0.100:/share/drbd/nfs/srv
home     -soft,rw,intr 192.168.0.100:/share/drbd/nfs/home
software -soft,rw,intr 192.168.0.100:/share/drbd/nfs/software


All right, now Heartbeat is configured as follow:


primitive p_drbd_nfs ocf:linbit:drbd \
params drbd_resource="nfs" \
op start interval="0" timeout="60" \
op stop interval="0" timeout="300" \
op monitor interval="60"

primitive p_fs_home ocf:heartbeat:Filesystem \
params device="/dev/nfs/home" \
directory="/share/drbd/nfs/home" fstype="ext4" \
options="noatime,usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv0"\
op start interval="0" timeout="100" inteval="0" \
op stop interval="0" timeout="300" inteval="0" \
op monitor interval="20"

primitive p_fs_software ocf:heartbeat:Filesystem \
params device="/dev/nfs/software" \
directory="/share/drbd/nfs/software" fstype="ext4" \
options="noatime" \
op start interval="0" timeout="100" inteval="0" \
op stop interval="0" timeout="300" inteval="0" \
op monitor interval="20"

primitive p_fs_srv ocf:heartbeat:Filesystem \
params device="/dev/nfs/srv" \
directory="/share/drbd/nfs/srv" fstype="ext4" \
options="noatime" \
op start interval="0" timeout="100" inteval="0" \
op stop interval="0" timeout="300" inteval="0" \
op monitor interval="20"

primitive p_ip_nfs ocf:heartbeat:IPaddr2 \
params ip="192.168.0.100" cidr_netmask="24" iflabel="nfs" \
op monitor interval="20"

primitive p_lvm_nfs ocf:heartbeat:LVM \
params volgrpname="nfs" \
op monitor interval="30s"

primitive p_service_nfs-kernel-server lsb:nfs-kernel-server \
op start interval="0" timeout="100" inteval="0" \
op stop interval="0" timeout="300" inteval="0" \
op monitor interval="20"

group g_service_nfs p_lvm_nfs p_fs_srv p_fs_home p_fs_software \
p_ip_nfs p_service_nfs-kernel-server

ms ms_drbd_nfs p_drbd_nfs \
meta master-max="1" master-node-max="1" clone-max="2" \
clone-node-max="1" notify="true"

colocation co_drbd_with_g_service_nfs inf: \
g_service_nfs ms_drbd_nfs:Master

order o_g_service_nfs_after_drbd_promote inf: \
ms_drbd_nfs:promote g_service_nfs:start


Everything works as expected... except for the quota command
which always gives me this error:

quota: Cannot open quotafile /share/drbd/nfs/home/aquota.user:
Permission denied
quota: Cannot open quotafile /share/drbd/nfs/home/aquota.user:
Permission denied
quota: Quota file not found or has wrong format.


Therefore, I'd like to add a "quota" primitive:

primitive p_service_quota lsb:quota \
op start interval="0" timeout="100" inteval="0" \
op stop interval="0" timeout="300" inteval="0" \
op monitor interval="20"


and make sure that:


1) p_service_quota must be started on the same node where
ms_drbd_nfs is promoted to master... but after its promotion.

2) p_service_quota must also be started on the other node
after ms_drbd_nfs is demoted.

There could also be some other solution so...

what rules should I add/modify in order to make sure that
running the 'quota' command I can always get it for both
the shared lvm home file system and the local /data?

ADDITIONAL CONFIGURATION:

I would also like to add a HA dhcp server along with tftpd
being /var/lib/tftpboot a symbolic link to  /srv/tftpboot
(/srv is also a symbolic link to /share/nfs/srv which is
an auto mounted file system from 192.168.0.100:/share/drbd/nfs/srv
i.e. whoever has drbd in primary state).


Best,

- --matt
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJOJsz+AAoJED8NigVnN3TtzcAH/imSGzUKx0TC5QuzrCD9kvsx
WMjXamauBCZ2UVp6kYNSqiFUndxu7NMq39Fft/RuYvzOWmsQxiFPTXpUBA2UC08H
9Twfkyjprh0PgX/Ye/uQxXWilEqykRpED1O1OWo0uzqOF1TyMQFJ9/fA6+NV0wto
FCtO9SZ9S59HRkOHLb2Y27DopM1v5+X+HHGedZ0au2wv989fgFjAthjRXKuQxCbw
RoEVR6sdQJloK9D6OLnefzpggMvl4W4Ju6gEMT2deu4FtTW7mVqCamplDw7N/YTp
rFpCfhiXtgX2Lp8RVBrhh3XTsXbihL4qWO8Qw/h95nNOiNGRCW6thqxruF5qE8k=
=HTNu
-----END PGP SIGNATURE-----



More information about the drbd-user mailing list