Instalando NFS-Server
instale
configure
crie o arquivo /etc/exports
/srv/nfs/cluster-rancher 192.168.111.0/22(rw,sync,no_subtree_check,no_root_squash)
/srv/nfs/cluster-k8s-dev 192.168.111.0/22(rw,sync,no_subtree_check,no_root_squash)
/srv/nfs/cluster-k8s-tst 192.168.111.0/22(rw,sync,no_subtree_check,no_root_squash)
/srv/nfs/cluster-k8s-hmg 192.168.111.0/22(rw,sync,no_subtree_check,no_root_squash)
/srv/nfs/cluster-k8s-prd 192.168.111.0/22(rw,sync,no_subtree_check,no_root_squash)
recarregue
verifique
saída exemplo
/srv/nfs/cluster-k8s-dev 192.168.111.0/22
/srv/nfs/cluster-k8s-hmg 192.168.111.0/22
/srv/nfs/cluster-k8s-prd 192.168.111.0/22
/srv/nfs/cluster-k8s-tst 192.168.111.0/22
/srv/nfs/cluster-rancher 192.168.111.0/22
montando
fstab
insira a linha abaixo no fstab
144.217.xxx.xxx:/storage /srv/nfs/zebra nfs _netdev,noatime,nofail,hard,intr,timeo=600,retrans=5,rsize=1048576,wsize=1048576 0 0
explicando
- netdev → aguarda a rede antes de montar
- nofail → não impede o boot se o NFS estiver indisponível
- noatime → reduz I/O desnecessário
- hard → garante integridade dos dados (recomendado para produção)
- intr → permite interrupção em caso de travamento
- timeo=600 → timeout adequado (60s)
- retrans=5 → número controlado de tentativas
- rsize/wsize=1048576 → melhor throughput (1MB)