Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to build NFS Services in linux redhat6.5

Shulou Source: shulou.com Published: 2022-06-01 02:40:34 09月22日 Update

In this issue, Xiaobian will bring you about how to build NFS services in Linux redhat 6.5. The article is rich in content and analyzes and narrates from a professional perspective. After reading this article, I hope you can gain something.

NFS (Network File System) is a file system supported by FreeBSD that allows computers on a network to share resources over TCP/IP networks. In NFS applications, client applications for local NFS can transparently read and write files located on remote NFS servers as if they were accessing local files.

First prepare two linux (one as a server and one as a client) by setting up NFS so that clients can access the server and synchronize files 1: Configure on server #yum install nfs-utils rpcbind -y //install nfs-utils rpcbind software nfs-utils for NFS shared publishing and access rpcbind Support for remote procedure invocation mechanism #chkconfig nfs on #chkconfig rpcbind on //boot self-start #mkdir -p /opt/wwwroot //Create directory wwwroot #vim /etc/exports //edit exports /opt/wwwroot 192.168.100.0/24(rw,sync,no_root_squash) //192.168.100.0/24 When accessing/opt/wwwroot on the network segment, you will have the following permissions rw: read and write allowed sync: synchronous write no_root_squash: Indicates that the client is given local root privileges when accessing as root

2:service rpcbind restart //restart rpcbind service service nfs restart //restart nfs service netstat -ntap | grep rpcbind //Check whether port 111 is open showmount -e 192.168.100.101 //View NFS files locally service iptables stop setenforce 0 //Close firewall

3: Switch to client #yum install nfs-utils rpcbind -y //install nfs-utils rpcbind software #chkconfig nfs on #chkconfig rpcbind on //boot self-start #showmount -e 192.168.100.101 //View NFS files in the server #mkdir /share //create directory share #mount 192.168.100.101:/opt/wwwroot /share //Manual mount #tail -1 /etc/mtab //Confirm mount result #vim /share/index.html //test adding files, and the server will also add them synchronously

4: Switch to server Check the server wwwroot to see that the file synchronization is successful

The above is how to build NFS services in linux redhat 6.5 shared by Xiaobian. If you happen to have similar doubts, you may wish to refer to the above analysis for understanding. If you want to know more about it, please pay attention to the industry information channel.

Tags: Services files servers clients clients networks synchronization content permissions directories systems software analysis switching applications support success professional small and medium between Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft macOS MySQL NVidia MariaDB