Richard Bruno
navigation
Home
admin









Serveur NFS
October 18th, 2016

Installation d'un serveur NFS sur Centos 6.3



Installation des paquets

[root@serveur1 default]# yum install nfs-utils
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: centos.mirror.fr.planethoster.net



portmap

Le rôle du portmapper est de rediriger les clients d'un service vers le bon port du serveur.
Lorsqu'un service démarre sur le serveur, il s'enregistre auprès du portmapper. Celui ci, sera ensuite capable de faire suivre les requêtes relatives à ce service vers le bon port.

NFS version 4 (NFSv4) works through firewalls and on the Internet, no longer requires portmapper, supports ACLs, and utilizes stateful operations.

Source : http://www.centos.org/docs/5/html/Deployment_Guide-en-US/ch-nfs.html#s1-nfs-how

Démarrage de portmap

[root@serveur1 ~]# /etc/init.d/rpcbind start
Démarrage de rpcbind : [ OK ]



Configuration pour un démarrage au lancement du serveur

[root@serveur1 ~]# chkconfig --level 3 rpcbind on




A propos :
http://fr.wikipedia.org/wiki/Remote_procedure_call
http://www.centos.org/docs/5/html/Deployment_Guide-en-US/s2-nfs-methodology-portmap.html


nfslock

nfslock — (/sbin/service nfslock start) is a mandatory service that starts the appropriate RPC processes to allow NFS clients to lock files on the server.

Source : http://www.centos.org/docs/5/html/Deployment_Guide-en-US/ch-nfs.html

[root@serveur1 ~]# service nfslock start
Starting NFS statd: [ OK ]



Vérification
[root@serveur1 ~]# service nfslock status
rpc.statd (pid 10516) is running...

Lancement au démarrage

[root@serveur1 ~]# chkconfig nfslock on



Vérification

[root@serveur1 ~]# chkconfig --list nfslock
nfslock 0:arrêt 1:arrêt 2:marche 3:marche 4:marche 5:marche 6:arrêt




/etc/exports

On partage le répertoire /home.

[root@serveur1 ~]# cat /etc/exports
/home *(rw,sync)



Avec une telle config, n'importe quel client NFS peut faire un montage NFS du répertoire /home.
Il est sans doute préférable de limiter les droits.
La commande "man exports" permet d'obtenir des informations sur les options à insérer dans le fichier /etc/exports


Lancement du serveur NFS

[root@serveur1 ~]# /etc/init.d/nfs start
Démarrage des services NFS : [ OK ]
Démarrage de NFS mountd : [ OK ]
Démarrage du démon NFS : [ OK ]




Vérification du fonctionnement du service

[root@serveur1 ~]# service nfs status
rpc.svcgssd is stopped
rpc.mountd (pid 8045) is running...
nfsd (pid 8072 8071 8070 8069 8068 8067 8066 8065) is running...



Le service rpc.svcgssd est stoppé. Il n'est en effet pas nécessaire pour le niveau de sécurité par défaut de nfs.
cf. man nfs

Installation d'un client NFS sur Centos 6.4



Installation des paquets

[root@dell]# yum install nfs-utils
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: centos.mirror.fr.planethoster.net



Montage

[root@dell ~]# mount -t nfs 192.168.1.90:/home /mnt
[root@dell ~]# ls /mnt
bruno lost+found
[root@dell ~]# umount /mnt




Modification des partages



Vérification

[root@serveur1 ~]# exportfs -v
/home <world>(rw,wdelay,root_squash,no_subtree_check)



Modification du fichier

[root@serveur1 ~]# vi /etc/exports



Mise à jour

[root@serveur1 ~]# exportfs -ra



Vérification

[root@serveur1 ~]# exportfs -v
/home2 192.168.1.79(rw,wdelay,root_squash,no_subtree_check)
/home <world>(rw,wdelay,root_squash,no_subtree_check)





Dernières modifs
VNC (November 22nd, 2020)
Editeurs (October 20th, 2016)
Awk (October 18th, 2016)
Claws Mail (October 18th, 2016)
Cups (October 18th, 2016)
Gimp (October 18th, 2016)
Git (October 18th, 2016)

Contact
Pour m'envoyer un mail,
Pour me laisser un commentaire :
richard.brunooo
chez
gmail.com


powered by kure, modified by Bruno