NFS service configuration and application 3

Source: Internet
Author: User
NFS service configuration and application 3-Linux Enterprise Application-Linux server application information. See the following for details. After you modify the content of the/etc/exports file, you do not need to restart the nfs service, but directly use the command exports to take effect. Its command format is as follows: exports [Option] options have a few
-A outputs all directories set in the/etc/exports file
-R re-reads the settings in the/etc/exports file and takes effect immediately without restarting the service.
-U stops outputting a directory.
-V displays the directory on the screen when outputting the directory.
This section describes the combined commands for two long-length instances:
Exportfs-rv resend the shared directory
Exportfs-you can stop all the shared directory outputs of servers on the current host.
Start and Stop the nfs service
1. to enable nfs to work properly, you need to start the portmap and nfs services. portmap must start/etc/init before nfs. d/portmap start/etc/init. d/nfs start
2. Stop the nfs service.
/Etc/init. d/nfs stop/etc/init. d/portmap stop
3. Restart the nfs service.
/Etc/init. d/nfs restart
4. Check the status of portmap and nfs.
/Etc/init. d/portmap status
/Etc/init. d/nfs status
5. set to automatically start the nfs service
Chkconfig -- level 35 portmap on
Chkconfig -- level 35 nfs on
Of course, you can also use ntsysv to find nfs and portmap and add the "*" sign to the front.
Test the nfs service
1. Check the options used in the output directory.
Even if one or two options are set under/etc/exports, there are many default options in the real output directory, so it is necessary to view the/var/lib/nfs/etab file, to see the real options.
Note: In this file, you will see anonuid =-2, anongid =-2, which is actually 65536-2 = 65534, that is to say, the IDs of anonymous user accounts and user group accounts are UID = 65534 and GID = 65534. You can check the/etc/passwd and/etc/group files to find the nfsnobody
2. Run the showmount command to test the output directory status of the nfs server.
Showmount [Option] nfs server name or address
-A: displays all client hosts of the specified nfs server and Their Connected Directories.
-D: displays all output directories connected by clients on the specified nfs server.
-E displays all output shared directories on the specified nfs server.
Use of NFS clients
1. Check the nfs server information first.
Showmount-e ip
Note: the possible cause of the error is that the two processes on the server are not started or are filtered out by the firewall. you can disable the firewall by using service iptables stop.
2. Connect to the NFS server
Mount-t nfs server name or IP Address: Local mount of the output directory
3. Uninstall the NFS server
Umount local mount point
Note: If a client still needs to shut down the nfs server, disable portmap and nfs services first. Otherwise, it will take a long time to shut down. If it cannot be properly disabled, run the netstat-utlp command to find out their pid and kill it. Of course, you can also use the exports-Aug command to stop all output directories of the nfs server on the current host and then shut down.
4. automatically connect to nfs at startup
Vi/etc/fstab
Format: nfs server name or IP Address: Local Mount directory of the output directory nfs default 0 0




[ This post was last edited by jackiesr at, 2007-2-14]
Related Article

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.