Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Installation and configuration of NFS Server

2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces "NFS server installation and configuration methods". In daily operation, I believe many people have doubts about the installation and configuration methods of NFS servers. I have consulted all kinds of information and sorted out simple and easy operation methods. I hope to help you answer the doubts about "NFS server installation and configuration methods"! Next, please follow the small series to learn together!

##This experiment is used to implement ssh password-free login key sharing, avoiding the problem of manually configuring secret-free login between all original nodes and new nodes after adding nodes in the cluster ##Install NFS [root@hadoop4 ~]# yum -y install nfs-utils rpcbind##Check whether nfs rpcbind[root@hadoop4 ~]# rpm -qa is installed on each node| grep nfsnfs4-acl-tools-0.3.3-6.el6.x86_64nfs-utils-lib-1.1.5-9.el6.x86_64nfs-utils-1.2.3-54.el6.x86_64[root@hadoop4 ~]# rpm -qa |grep rpcbindrpcbind-0.2.0-11.el6.x86_64##Set boot [root@hadoop4 ~]# chkconfig rpcbind on[root@hadoop4 ~]# chkconfig nfs on##Start service [root@hadoop4 ~]# service rpcbind start[root@hadoop4 ~]# service nfs start Start NFS service: [OK] Turn off NFS quotas: [OK] Start NFS mountd: [OK] Start NFS daemon: [OK] Starting RPC idmapd: [OK]##Query NFS server status [root@hadoop4 ~]# service nfs statusrpc.svcgssd is down rpc.mountd (pid 10816) Running... nfsd (pid 10832 10831 10830 10829 10828 10827 10826 10825) is running... rpc.rquotad (pid 10811) is running...## on the server side (machine name hadoop4), set shared directory (Set the shared directory to/home/grid/), edit/etc/exports[root@hadoop4 ~]# vim /etc/exports/home/grid *(rw,sync,no_root_squash)##Restart rpcbind and nfs services on the server side (note that you must restart rpcbind first, nfs)[root@hadoop4 ~]# service rpcbind restart[root@hadoop4 ~]# service nfs restart##verify [root@hadoop4 ~]# showmount -e 192.168.0.106Export list for 192.168.0.106:/home/grid *##on client (Machine name hadoop5, hadoop6) Mount the shared directory locally (Clients do not need to start rpcbind and nfs services to mount)[root@hadoop5 ~]# mkdir /nfs_share[root@hadoop5 ~]# mount -t nfs 192.168.0.106:/home/grid /nfs_share##Look up [root@hadoop5 ~]# mount/dev/sda2 on / type ext4 (rw)proc on /proc type proc (rw)sysfs on /sys type sysfs (rw)devpts on /dev/pts type devpts (rw,gid=5,mode=620)tmpfs on /dev/shm type tmpfs (rw)none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)Desktop on /media/sf_Desktop type vboxsf (gid=493,rw)Desktop on /mnt/Desktop type vboxsf (rw)sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)192.168.0.106:/home/grid on /nfs_share type nfs (rw,vers=4,addr= 192.168.0.106,clientaddr=192.168.0.107)##Set boot automount, modify/etc/fstab on client, add a line [root@hadoop5 ~]# vim /etc/fstab192.168.0.106:/home/grid_share nfs defaults 1##Delete the original distributed key file, Use the mounted key ##to send the public key file of each node to the server, Append all public key files to the ~/.ssh/authorized_keys file on the server side ##The process of generating the authorized_keys file does not demonstrate ##Creating a soft connection to share the directory file authorized_keys on each node [root@hadoop5 ~]# mv /home/grid/.ssh/authorized_keys /home/grid/.ssh/authorized_keys.bak[root@hadoop5 ~]# ln -s /nfs_share/.ssh/authorized_keys /home/grid/.ssh/authorized_keys

At this point, on the "NFS server installation and configuration methods" to learn the end, I hope to solve everyone's doubts. Theory and practice can better match to help everyone learn, go and try it! If you want to continue learning more relevant knowledge, please continue to pay attention to the website, Xiaobian will continue to strive to bring more practical articles for everyone!

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: 244

*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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report