How to Configure NFS servers for two LINUX systems
Source: Internet
Author: User
How to Configure NFS servers in two LINUX systems-Linux Enterprise applications-Linux server application information. For more information, see the following. I. Installing an NFS server
Check whether two software packages nfs-utils and portmap are installed in linux (the two software packages have been installed in RHEL4 by default)
Command # rpm? Q nfs-utils portmap
Ii. Check whether the NFS server is enabled
Command # service nfs starus
# Service portmap status
3. enable the service if the server is not started (nfs is not fully enabled under the default service)
Command # service nfs start
# Service portmap start
4. Specify the NFS server configuration file
The configuration file of the NFS server is saved in the "/etc/" directory. The file name is "exports". This file is used for directory sharing provided by the NFS server.
Command # vi/etc/exports
Configure the "exports" file format as follows:
/Home * (sync, ro)
Home: shared directory name
*: Indicates all hosts.
(Sync, ro): Set options
The "configuration options" field in the exports file is placed in the brackets ("()"). Multiple options are separated by commas (,).
Sync: sets the NFS server to write data to the disk synchronously, so that data will not be lost easily. We recommend that you use this option for all NFS shared directories.
Ro: Set the output shared directory to read-only and cannot be used together with rw.
Rw: Set the output shared directory to read/write, which cannot be used together with ro.
The "client host address" field in the exports file can express the host address in multiple forms.
Host with the specified IP address 192.168.152.13
Host with the specified domain name nfsclient.test.com
All hosts in the specified CIDR block of 192.168.1.0/24
* .Test.com all hosts in the specified domain
* All Hosts
5. output the shared directory again
Exportfs management tool can manage "exports" files
Command # exportfs? Rv allows the new "exports" file to take effect.
6. display the output directory list of the NFS server
Displays the output list of NFS servers on the current host.
# Showmount-e
7. display the shared directory mounted to the NFS server
Displays the shared directories mounted to and used by NFS clients on the NFS server of the current host.
# Showmount-d
8. Hanging a shared directory in another linux System
Display NFS server output
# Showmount-e 172.16.75.1
Mount the shared directory on the NFS server
# Mount-t nfs 172.16.75.1:/software/mnt/
9. view the content in the mnt directory
Cd/mnt | ll
10. unmount the mounted NFS shared directory in the system
Command # umount/mnt/
Summary:
1. Run the ping command before configuring the NFS server to ensure normal connection between the two linux systems. If the connection fails, disable the firewall in the graphic interface # service iptables stop.
2. Make sure that the entered command is correct in the configuration.
3. After changing the "exports" file, enter exportfs? Make the "exports" file take effect.
4. Check whether the nfs service is enabled. It is disabled by default.
5. You cannot detach an object from the/mnt directory when uninstalling the object. You must log out of the system and uninstall the object.
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.