Hi Joonas,
On 2024/04/11 12:02, Joonas Niilola wrote:
Hey,
On 11.4.2024 9.14, Jaco Kroon wrote:
The latter can certainly be done and makes sense (only required if
you're using the fuse mount, so if USE=fuse at least).
The former doesn't make sense to do blindly in /etc/init.d/netmount
(which belongs to sys-apps/openrc, not glusterfs).
well I was thinking about putting that into glusterfs's init file.
Well, that's an obvious assumption now that I think about it, but
incorrect for what I'm looking at.
There's two init scripts for glusterfs, glusterd and glusterfsd.
glusterfsd init script is being dragged along for historic purposes and
comes from before I got involved, and I believe this was the way bricks
were brought up prior to glusterfs version 3.0, and it does look like
there is (u)mount stuff in there too. This init script already has
stuff for "need fuse" if it's mounting a glusterfs filesystem. It looks
interesting even now for *mounting* file systems, but in my opinion not
for managing volumes.
IMHO the more modern/better way is to bring up glusterd on nodes that
*host* the volumes, ie, where bricks reside, and to then mount
filesystems from /etc/fstab using netmount as part of mounting all
network filesystem. Otherwise you need to duplicate the init config for
every mountpoint and specify a large number of arguments in those ... in
my opinion it just gets messy quite quickly.
glusterd then manages starting/stopping of brick, shd and other
processes related to any volumes.
netmount handles mounting of network (including glusterfs) filesystems.
In many scenarios the storage nodes and those that consume them are
independent. In this scenario glusterd (along with bricks and shd's)
will run on the storage nodes but not on the "compute" nodes, and there
is no dependency between glusterd and netmount.
glusterd does need to start before netmount if (and only if) there are
glusterfs mounts in /etc/fstab that depends on the local glusterd for
finding volume information. This is hard(ish) to determine (reliably),
but given "fstabinfo" in openrc-run I could amend /etc/init.d/glusterd's
depend to do "before netmount" iff there are filesystems in /etc/fstab
that's relevant. We don't (currently) have such deployments, and we
generally do have glusterfs mounts where we run bricks, even if only to
be able to inspect what's going on in the "constructed" filesystem, so
the explicit "before netmount" in glusterd doesn't bother me too much
personally (even if it starts before netmount and it's not needed, who
cares? So lots of effort for little gain).
glusterfs and fuse.glusterfs has already been added into
/lib/rc/rc-functions.sh. So technically I no longer need to flag my
mounts with _netdev.
Incidentally: I *suspect* the noauto detection in netmount's depend
will only work if noauto is the *first* option for any given nfs mountpoint.
Anyway, I would thus like to suggest two "tweaks" to openrc here:
1. net_fs_list needs to become more dynamic such that other packages
(such as glusterfs) can add to the list dynamically.
2. packages should be allowed to hook into netmount's depend() phase.
If 2 isn't acceptable, I'll just send the desired changes for 2 directly
into openrc as a PR, and that kinda makes point 1 pointless as well.
Kind regards,
Jaco