Plug the remote directory via NFS

xiaoxiao2021-03-06  42

With NFS, the directory of the remote host (ARP1: / ORA1159) is poured (mount) is a directory of the local host (ARP2: / HOME1), just like accessing the native file, access the file of the remote host. The specific settings include a remote host and a local host:

Remote host

Log in to ARP1 with root users.

Make sure the PortMap process work. Run command

PS -AUX | GREP Portmap

The process information of Portmap should be displayed. Otherwise run the command

/stc/rc.d/init.d/portmap start

Modify / etc / exports file, add

/ ORA1159 ARP2 (rw, root_squash) ARP3 (RW, root_squash)

/ ORA1159 For the host name (or IP address) that wants to share shared directories, the option RW indicates that the directory has read and write permissions (also available to RO, indicating read only) Option root_squash indicates that the machine root user of the flush directory does not have write permissions to the directory (otherwise NO_ROOT_SQUSH).

Start or restart the NFS daemon.

/etc/rc.d/init.d/nfs start

or

/etc/rc.d/init.d/nfs stop

/etc/rc.d/init.d/nfs start

If you want each restart machine to ensure that the remote host directory can be hung on the local host, you should do two symbolic links on the remote host.

Ln -s /etc/rc.d/init.d/portmap /etc/rc.d/rc5.d/s18portmap

Ln -s /etc/rc.d/init.d/nfs /etc/rc.d/rc5.d/s28nfs

2. Local host

Log in to the root user (such as RAP2 or RAP3), start portmap / etc / rc.d / init.d / portmap restart

Create a local mount point (ie local directory) for a remote host directory.

MKDIR / home1

Modify / etc / fstab, add the following line

Rap1: / ora1159 / home1 nfs defaults 0 0

Hold the remote directory, run

Mount -a

List local mount points directory and see if the remote directory is listed.

LS / home1

note

On the local host can also be mounted through the AutoFs.

NFS itself has a safety hazard, do not forward its communication ports via the SSH to the local area network.

转载请注明原文地址:https://www.9cbs.com/read-53345.html

New Post(0)