Linux Server introduction guides you through troubleshooting NFS servers

Source: Internet
Author: User

In Red Hat Enterprise Linux 5.0 server, if NFS fails, you can check the problem from the following aspects.

1.1 troubleshooting ideas

  

(1) Whether the NFS client and server load is too high, and whether the network between the server and the client is normal.

(2) Correctness of the/etc/exports file.

(3) restart the NFS or portmap service if necessary.

Run the following command to restart portmap and NFS:

Service portmap restart

Service nfs start

(4) check whether the mount command or/etc/fstab syntax on the client is correct.

(5) check whether the kernel supports the NFS and RPC services.

Common kernel options include CONFIG_NFS_FS = m, CONFIG_NFS_V3 = y, CONFIG _ NFSD = m, CONFIG_NFSD_V3 = y, and CONFIG_SUNRPC = m.

We can use the common network connection and testing tools ping and tracerroute to test whether the network connection and speed are normal. The normal network connection is the foundation of NFS. The rpcinfo command is used to display the system's RPC Information. Generally, the-p parameter is used to list the RPC service of a host. When you use the rpcinfo-p command to check the server, you can see portmapper, status, mountd nfs, and nlockmgr. When you use this command to check the client, you should be able to see at least the portmapper service.

1.2 NFS error message

The NFS error information is shown in the following table.

1.3 run the nfsstat command to check the NFS server status.

The nfsstat command displays statistics about NFS and Remote Procedure Call (RPC) interfaces to the kernel. You can also use this command to reinitialize the information. If no flag is specified, the nfsstat-csnr command is used by default. Use this command to display each message, but you cannot reinitialize any information.

The main parameters of the nfsstat command are as follows.

(1)-B: displays other statistics of the NFS V4 server.

(2) c: displays only the NFS and RPC Information of the client, allowing users to view only the Report of the client data. The nfsstat command provides information about the number of RPC and NFS calls sent and rejected by the client.

To display only the NFS or RPC Information of the client, combine this parameter with the-n or-r parameter.

(3)-d: displays information related to NFS V4 authorization.

(4)-g: displays RPCSEC_GSS information.

(5)-m: displays statistics of each NFS file system, including the file system and server name, address, installation mark, current read and write size, and retransmission count.

(6)-n: displays NFS information for the client and server. To display only the NFS client or server information, combine this parameter with the-c and-s parameters.

(7)-r: displays RPC Information.

(8)-s: displays the server information.

(9)-t: displays statistics related to the conversion request of the nfs id ing subsystem. Only NFS client or server information must be displayed, combine the-c and-s <br/> options.

(10)-4: when used in combination with the-c,-n,-s, or-z parameters, it will contain information about the NFS V4 client or server, and existing NFS V2 and V3 data <br/>.

(11)-z: reinitialize the statistics. This parameter is only used by the root user and can be combined with any of the above flags to a zero-special set of <br/> Statistics.

To display information about the number of RPC and NFS calls sent and rejected by the client, enter:

Nfsstat-c

To display and print information related to the client's NFS call, enter the following command:

Nfsstat-cn

To display and print the RPC call-related information of the client and server, enter the following command:

Nfsstat-r

To display information about the number of RPC and NFS calls received and rejected by the server, enter the following command:

1.4 typical NFS troubleshooting steps

1. Some clients cannot import data from one or more servers

(1) Check the following content on the client.

Verify whether the local directory exists in the client. If it does not exist, create it using mkdir. For example, the following command:

# Mkdir/opt/adobe

Check whether the LAN cable is damaged and connected. All connections are valid.

Whether/etc/hosts exists and has "related information ".

Whether/etc/fstab exists and has "related information", and whether all entries still point to a valid directory on the server.

Whether/etc/resolv. conf exists and has "related information" (applicable only to DNS ).

(2) Check the following content on the server.

Check whether the directory to be mounted by the client already exists and is listed in the configuration file.

Whether the client has the permission to mount the file system.

The information is described as follows.

/Etc/hosts,/etc/fstab, and/etc/resolv. conf must contain the following entries:

-/Etc/hosts: system Host Name and IP address, for example:

12.0.14.123 fredsys fredsys.mysite.myco.com

Similar to the following entries:

127.0.0.1 localhost loopback # [no SMTP]

-/Etc/fstab: For standard mounting, each imported file system corresponds to one entry.

-/Etc/resolv. conf (only required for Domain Name Service [DNS]): name of the domain in which the system is located, for example:

Domain mysite.myco.com

At least one name server, for example:

Nameserver 12.0.14.165

2. All clients cannot import data from the specified server.

Perform the following steps on the server.

(1) Ensure that the server is started and running, and the LAN connection between the server and the client is valid (whether the server can ping the client from the server, and vice versa ).

(2) ensure that the file system to which the client is attached is listed in/etc/fstab.

(3) restart the NFS server.

If these remediation methods fail and the configuration is correct (all the tests above are executed), the server may not be properly booted and the server should be rebooted.

3. troubleshooting of other common NFS faults

(1) When an NFS file system is mounted, if the error message is "Permission denied", the NFS server does not allow client mounting. You can change the/etc/exports file on the server to solve the problem. Use the exportfs-rv command to re-export the file system.

(2) If the error "Program not registed" appears, the NFS service may not be started or run abnormally. The most common solution is to restart the NFS service.

(3) If "RPC: Unable to receive" is displayed, it may be that the portmap service is not started on the server side. If it is already started, it may be blocked by the firewall.

(4) If the client does not respond when mounting the file system, the portmap service may not be started for the client.

(5) failed to share the directory output on the NFS server.

If you use a graphical window to configure the shared directory, you must test the output of the shared directory to verify that the configuration is correct. Generally, the graphical window does not report configuration errors.

Run the "exportfs-v-a" command to check whether the shared directory set in the/etc/exports file can be output normally. The "-v" option indicates that the shared directory is displayed in redundancy mode, the details of each step are displayed.

(6) the error message "the device is busy" cannot be uninstalled.

When you run the umount command to uninstall the remote NFS shared directory, the unmount failure message is displayed, such as "the device is busy. The possible cause is that a process is still using this directory. You can run the lsof command to check whether a process is using this shared directory.

(7) failed to mount.

If the client prompts "Remote Procedure Call failed" when mounting the NFS shared directory, it is likely that the firewall with constraints on the server blocks NFS clients from mounting NFS shares, that is, the firewall blocks NFS or RPC ports. To solve this problem, you can use the iptable command to open ports 111 (RPC) and 2049 (NFS) on the server, allowing the NFS client to access the server.

(8) NFS requests are suspended.

If the client is performing a write operation and the server cannot respond or becomes inaccessible on the network, the client process will be suspended until the write operation is completed by default (using the hard option for mounting. If you do not stop the write operation, the process cannot exit from the request. To avoid NFS request suspension, you can specify the soft option when mounting the directory to allow the operation to exit due to timeout, you can also specify the intr option to allow the user to exit the pending operation by pressing Ctrl + C on the command line.

(9) NFS mounting is suspended during boot.

If you have configured automatic NFS mounting in the/etc/fstab file, but the NFS shared directory is temporarily unavailable during system boot, the boot process enters the waiting state by default, until the NFS Directory becomes available. If the NFS directory to be waited is required by the system, the waiting may be acceptable. However, in many cases, users only want the system to put the mount request in the background and continue to guide the system. You can add the bg option to the/etc/fstab file, so that after the first MOUNT request times out, the mount request will be transferred to the background, and the system continues to boot. You can add the fg option to the Mount Option of the/etc/fstab file when you need to mount the NFS shared directory on the foreground.

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.