Configuration of the NFS service for "Go" Linux

Source: Internet
Author: User
Tags nfsd

Original link http://blog.chinaunix.net/uid-26642180-id-3167544.html

1. First install the NFSRPM-IVH nfs-utils-1.0.9-16.rpm rpm-qa|grep Portmap to see if Portmap port mapper is installed   Portmap The default listener for TCP and UDP port 111 NETSTAT-ANP |grep:111 must emphasize that Portmap is just a port mapper, the other two daemons, RPC.NFSD and PRC.MOUNTD, that truly provide services for NFS. RPC.NFSD is the basic NFS daemon, the main function is to manage whether clients can log in to the server, RPC.MOUNTD is the installation daemon, the main function is to manage the NFS file system, according to the permissions set to determine whether to allow the client installation using the specified directory or file.   2. Start the NFS service/ETC/INIT.D/NFS the STARTNFSD service uses 2049 ports, the ports used by the RPC.MOUNTD service are not fixed and will change after each boot.  3.NFS export   Export shared directory for server shared directory there are two ways to do this: one is to set the/etc/exports file, and the other is to add or remove the shared directory with the exports command  /etc/ The configuration of the exports file is simple and has the following format: directory path   machine 1 (option 1, option 2,.....) Machine 2 (option 1, option 2,.......) .... The directory path represents the shared directory to be exported, and subdirectories in this directory are exported at the same time, for security purposes, the root directory is not generally exported. The machine represents a client that allows access to this shared directory, and can be represented by a machine name, domain name, or IP address. Each machine also contains several options that indicate what permissions the client has when accessing the shared directory, between options, delimited, and without spaces. The common options are: RO: The client has read access to the shared directory, which is the default option. RW: Read and Write permissions Root_squash: When the client uses the root user to access the shared directory, the root user maps to the anonymous user on the server (by default, the nobody user), which is the default option sync: When the client writes data to the shared directory, will be written to the server disk immediately, which is the default option async: When a client writes data to a shared directory, it is staged in memory instead of immediately written to disk insecure: Allows the client to connect to the server using a non-reserved port, which is a port less than 1024. After modifying the contents of the  /etc/exports file, it is necessary to restart the NFS server process to take effect, and another way to make itLine exportfs Command  exportfs command available selection and function as follows:-A: Export all the directories listed in the/etc/exports file-V: Output each exported or de-exported directory-r: Re-export all columns in the/etc/ Directories in the exports file-u: Cancels the export of the pinned directory, and when used with-a, cancels all columns in the/etc/exports file's directory Export-I: Allows you to export directories that are not listed in the/etc/exports file or do not press/etc/ The options listed in the exports file Export-F to specify another file instead of/etc/exports-o: Specify the option to export the directory  4. Clients use NFS service clients for commands that use Services for NFS there are two main items: showmount : Lets you view information about Server for NFS mount: it allows you to mount the shared directory exported by NFS server to a directory on the local file system, and then access the remote directory in the form of a local file system showmount option:-A  -d The  -e-h-vmount command is used to mount a file system to a directory on the local file system, for example, a floppy disk, a file system on a CD-ROM can be mounted in a format like this: Mount [-t vfstype] [-O options] Device Dir such as: Mount-t NFS 192.168.1.10:/home/mnt  5. Implement automatic mount NFS file system   Modify/etc/fstab file to/etc/ The specified file system in the Fstab file is mounted in addition to the system boot, and can be mounted immediately by the root user execution mount-a command, by default, the file system specified in/etc/fstab can only be installed by the root user except for the/etc/fstab file. Linux can also use the AutoMount process to manage file system mounts, which are characterized by dynamic mounting only when the file system is accessed. AutoMount is a feature provided by the autofs-5.0.1....rpm package,/etc/init.d/autofs startautofs The main configuration file is/etc/auto.master each row defines a mount point

"Go" Configuration for NFS services for Linux

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.