[CentOS] Centos8: Glusterd do not start correctly when I startup or reboot all server together

Fri Oct 2 23:58:19 UTC 2020
Dario Lesca <d.lesca at solinos.it>

The systemd glusterd.service unit modify do not resolve my problem

The solution is mount the glusterfs volume with this line into
/etc/fstab:
   virt2:/gfsvol2 /virt-gfs glusterfs defaults,_netdev,noauto,x-systemd.automount,x-systemd.device-timeout=20,x-systemd.requires=glusterd.service 0 0

run 
   systemctl daemon-reload

and run this for mount the volume
   systemctl restart virt\\x2dgfs.mount

Now all work fine, also when I reboot or when I power on all server
together

Many thanks
Dario

Il giorno lun, 28/09/2020 alle 22.40 +0200, Dario Lesca ha scritto:
> I have install and configure on two server centos8 glusterfs in
> replica
> mode in this manner:
> 
>    dnf install centos-release-gluster -y
>    dnf install glusterfs-server glusterfs glusterfs-fuse -y
>    systemctl enable --now glusterd
>    gluster peer probe virt1
>    gluster peer status
>    sh creavolume.sh gfsvol1 301G /gfsvol1 xfs
>    # NOTE: this is a my shell script to create fs on lvm
>    mkdir /gfsvol1/brick1
>    gluster pool list
>    gluster volume create gfsvol1 replica 2 virt1:/gfsvol1/brick1
>    virt2:/gfsvol1/brick1 force
>    gluster volume start gfsvol1
>    gluster volume info gfsvol1
>    gluster volume status gfsvol1
>    gluster volume heal gfsvol1
>    # add to /etc/fstab
>    vi /etc/fstab
>    virt1:/gfsvol2	/virt-gfs glusterfs defaults,noatime,_netdev 0 0

virt2:/gfsvol2 /virt-gfs glusterfs defaults,_netdev,noauto,x-systemd.automount,x-systemd.device-timeout=20,x-systemd.requires=glusterd.service 0 0

>    mkdir /virt-gfs
>    mount -a
> 
> All work fine but when I start or restart all server together
> glusterd
> server start but if I try mount the volume, gluster is not working.
> 
> At this point if I restart the glusterd service and run "mount -a"
> all
> work fine.
> 
> Seem is a boot network problem
> 
> Then I have try modify glusterd.service with 
> 
> $ sudo systemctl edit  glusterd.service --full
> 
> And modify the unit in this way:
> 
>    #old
>    < After=network.target
>    < Before=network-online.target
>    #new
>    > After=network.target network-online.target
>    > #Before=network-online.target
> 
> Now all work fine, mostly when I start or restart all server
> together.
> 
> There is another solution or this is a Bug?
> 
> Many thanks for your suggest
> 
-- 
Dario Lesca
(inviato dal mio Linux Fedora 32 Workstation)