In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
Brief introduction:
NFS (Network File System), the network file system, is one of the file systems supported by FreeBSD, which allows computers in the network to share resources. In the application of NFS, the client application of the local NFS can read and write files located on the remote NFS server transparently, just like accessing the local file.
Advantages: save local storage space, store commonly used data on a NFS server and be accessible through the network, then the local terminal will be able to reduce the use of its own storage space. Users do not need to have a Home directory on every machine in the network, the Home directory can be placed on the NFS server and can be accessed and used on the network. Some storage devices such as floppy drives, CDROM and Zip (disk drives and disks with high storage density) can be used by other machines on the network. This reduces the number of removable media devices across the network. Actual operation:
1. Add a hard disk to the server and restart the system after adding.
two。 First check to see if the disk has been added successfully, then partition the newly added disk, and we allocate all the space to sdb1. (no, my friends can read my previous blog about disk.)
3. Format the disk partition.
Input: mkfs.xfs / dev/sdb1
4. Set up automatic mount.
Enter: vim / etc/fstab add: / dev/sdb1 / mnt xfs defaults 0 0
5. Mount the disk partition and see if the mount is successful.
Input: mount-an input: df-hT
6. Use yum warehouse to install two programs of NFS service, nfs-utils and rpcbind.
Enter: yum install nfs-utils rpcbind-y
7. Set the boot self-startup of the two service programs.
Input: systemctl enable nfs input: systemctl enable rpcbind
8. Use the vim editor to edit the shared configuration file and add a shared command.
Enter: vim / etc/export add: / mnt 192.168.52.0 take 24 (rw,sync,no_root_squash)
"/ mnt" provides a shared disk mount point, and "192.168.52.0 Universe 24" is a shared network segment. In parentheses, rw means to allow read and write (ro is read-only), sync means to write synchronously, and no_root_squash means that when the current client accesses as root, the local root permission is granted (the default is root_squash, which will be treated as a nfsnobody user).
9. Turn both services on, while turning off the firewall and enhanced security features.
Input: systemctl start nfs input: systemctl start rpcbind input: systemctl stop firewalld.service input: setenforce 0
10. Check whether the service port is open, and look at the output list of the NFS service. The NSF server has been configured.
Enter: netstat-ntap | grep rpc
Input: showmount-e
11. Let's go to the client, close the protective wall and enhanced security features, and install a httpd service. Next, we will use the shared storage space provided by the NFS service to store the files related to the httpd service.
Input: systemctl stop firewalld.service input: setenforce 0 input: yum install httpd-y
twelve。 We can manually mount the shared directory under the site directory of the httpd service.
Input: mount 192.168.52.131:/mnt / var/www/html/
13. We can also set up auto-mount. We first unmount the previously mounted directory, and then enter the auto-mount file to configure it.
Input: umount / var/www/html input: vim / etc/fstab add: 192.168.52.131:/mnt / var/www/html nfs defaults,_netdev 0 0
14. We then mount everything in the fstab file and see if the mount is successful.
Input: mount-an input: df-hT
15. We go to the site directory of the httpd service, create a new html home page file in it, and edit a piece of content in it with the vim editor.
Input: cd / var/www/html input: vim index.html add: this is nfs web
16. Open the httpd service and use the host browser to access it successfully.
Input: systemctl start httpd
17. Let's go to the server's shared directory and see the html file we created earlier.
Input: cd / mnt/ input: ls
Note: if the shared service on the NFS server fails, we want to unmount the shared directory on the client. Use the umount command to unmount the path by hand, do not use the [Tab] key to complete, use the [Tab] key will be stuck.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.