LINUX nfs server configuration

Source: Internet
Author: User

LINUX nfs server configuration 1. configure nfs1.1 # rpm-qa | grep nfs (whether an nfs package is installed in the query system) 2.2 # vi/etc/exports (compile the nfs service configuration file, I want to share my/data directory and allow all users with network segments to access)/rhome/nfs1 * (rw, async) 2.3. # exportfs-rv (this command can verify whether the configuration file we set is correct. If it is the output below, it indicates it is correct) [root @ station83 ~] # Exportfs-rvexporting *:/rhome/nfs1 or showmount-e localhost [root @ station83 ~] # Showmount-e localhostExport list for localhost:/rhome/nfs1 * 2.4 # chkconfig -- list | grep nfs (this command is used to check which startup levels of the nfs service will automatically start) nfs 0: off 1: off 2: off 3: off 4: off 5: off 6: offnfslock 0: off 1: off 2: off 3: on 4: on 5: on 6: off [root @ station38 ~] # Chkconfig nfs on (to enable the nfs service to start at the startup levels of 2345, I executed this command) [root @ station38 ~] # Chkconfig -- list | grep nfs (check now) nfs 0: off 1: off 2: on 3: on 4: on 5: on 6: off2.5 [root @ station38 ~] # Service nfs restart (now we can start this service to make our configuration file take effect) Security: with/etc/hosts. allow and hosts. deny fixed IP Access 2.6 client test [root @ station73 other] # showmount-e 192.168.0.83Export list for 192.168.0.83:/rhome/nfs1*3. configure autofs to mount 192.168.0.83:/rhome/nfs1 to the local machine using autofs. 3.1 vim/etc/auto. master #/misc/etc/auto. misc/nfs/etc/auto. home/rhome/etc/auto. misc/home/etc/auto. misc # vi/etc/auto. misccd-fstype = iso9660, ro, nosuid, nodev:/dev/cdrom add this line nfs1 192.168.0.83: /rhome/nfs13.2 # service autofs restart autofs service 3.3 After nfs1 successfully logging on to the ssh nfs1@192.168.0.73 on the client [nfs1 @ station73 ~] $ --------------------------------------------------------------------------- 1. You must enable the portmap service on both the server and client. RCP is used for communication between nfs mount and umount. 2. If the client portmap is not started, it will be very slow during mount and eventually fail. Umount is successful even if the local portmap is disabled. 3. After the mounting is complete, nfs still works normally after the portmap of the server is stopped, but the umout accounting prompt is not found/mounted or server not reachable. Restarting the server's portmap does not help. 4. If the portmap on the server is restarted, the nfs will also be restarted. Otherwise, the nfs operation will still be abnormal. 5. if the nfs on the server is disabled (the IP address is accessible), the client will not be able to use umount-f/nfs. When the server crashes, umount-f/nfs may fail. You can use umount-l/nfs. final suggestion: 1. to use NFS, you must use portmap. NFS relies heavily on portmap, so do not try to stop it (portmap ). 2. When the umount/nfs partition is not available, try to use umount-f/nfs. Generally, the operation is successful. 3. If umount-f/nfs cannot be umount, try umount-l/nfs. umount-l as the final umount.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.