linuxÔõô¿´nfsÉèÖÃ
ÔÚ linux ϵͳÖУ¬Éó²é nfs ÉèÖõÄÒªÁ죺Éó²é /etc/exports Îļþ£¬Ïàʶµ¼³öĿ¼£»Éó²é /proc/mounts Îļþ£¬»ñÈ¡ÒѹÒÔØ nfs ¹²Ïí£»Ê¹Óà exportfs ÏÂÁÖÎÀí²¢Éó²é¹²Ïí¡£
ÔõÑùÉó²é Linux ϵͳÖÐµÄ NFS ÉèÖÃ
NFS£¨ÍøÂçÎļþϵͳ£©ÊÇÒ»ÖÖÂþÑÜʽÎļþϵͳ£¬ÔÊÐí¿Í»§¶ËÅÌËãʱ»ú¼ûºÍʹÓô洢ÔÚÔ¶³ÌЧÀÍÆ÷ÉϵÄÎļþ¡£ÔÚ Linux ϵͳÖУ¬Óм¸ÖÖÒªÁì¿ÉÒÔÉó²é NFS ÉèÖãº
1. Éó²é /etc/exports Îļþ
/etc/exports ÎļþÖ¸¶¨ÁËÄÄЩĿ¼±»µ¼³öΪ NFS ¹²Ïí¡£ÒªÉó²é´ËÎļþ£¬¿ÉÒÔʹÓÃÒÔÏÂÏÂÁ
sudo cat /etc/exports
µÇ¼ºó¸´ÖÆ
ʾÀýÊä³ö£º
/data *(rw,sync,no_root_squash) /home/user *(ro,async)
µÇ¼ºó¸´ÖÆ
2. Éó²é /proc/mounts Îļþ
/proc/mounts ÎļþÏÔʾÁËÄ¿½ñ¹ÒÔصÄÎļþϽµµÍÐ±í£¬°üÀ¨ NFS ¹²Ïí¡£ÒªÉó²é´ËÎļþ£¬¿ÉÒÔʹÓÃÒÔÏÂÏÂÁ
sudo cat /proc/mounts
µÇ¼ºó¸´ÖÆ
ʾÀýÊä³ö£º
nfsd on /nfsmount type nfs (rw,relatime,vers=4.2,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,port=2049,timeo=600,retrans=2,sec=sys,clientaddr=192.168.1.100,local_lock=none,addr=192.168.1.10)
µÇ¼ºó¸´ÖÆ
3. ʹÓà exportfs ÏÂÁî
exportfs ÏÂÁî¿ÉÓÃÓÚÖÎÀí NFS ¹²Ïí¡£ÒªÊ¹ÓôËÏÂÁîÉó²é¹²Ïí£¬¿ÉÒÔʹÓÃÒÔÏÂÓï·¨£º
sudo exportfs -a
µÇ¼ºó¸´ÖÆ
ʾÀýÊä³ö£º
/data -> 192.168.1.100 /home/user -> 192.168.1.200
µÇ¼ºó¸´ÖÆ
ÒÔÉϾÍÊÇlinuxÔõô¿´nfsÉèÖõÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡