實(shí)例:
10年積累的成都網(wǎng)站建設(shè)、成都網(wǎng)站設(shè)計(jì)經(jīng)驗(yàn),可以快速應(yīng)對(duì)客戶對(duì)網(wǎng)站的新想法和需求。提供各種問(wèn)題對(duì)應(yīng)的解決方案。讓選擇我們的客戶得到更好、更有力的網(wǎng)絡(luò)服務(wù)。我雖然不認(rèn)識(shí)你,你也不認(rèn)識(shí)我。但先網(wǎng)站設(shè)計(jì)后付款的網(wǎng)站建設(shè)流程,更有本溪免費(fèi)網(wǎng)站建設(shè)讓你可以放心的選擇與我們合作。
nfs服務(wù)器:172.16.100.1
客戶端:172.16.100.3
1.創(chuàng)建掛載點(diǎn)并在客戶端上掛載:
S#vim /etc/exports
/data 172.16.100.3/16(rw)
/read 172.16.100.3/16(ro)
C#mount -t nfs 172.16.100.1:/data /sqld/mdata
C#showmount -a 172.16.100.1
C#showmount -e 172.16.100.1
C#showmount -d 172.16.100.1
2.不重啟服務(wù)重新導(dǎo)出
S#S#vim /etc/exports
/data 172.16.100.3/16(rw)
#/read 172.16.100.3/16(ro)
S#exprotnfs -rav 重新導(dǎo)出
C#showmount -e 172.16.100.1
3.限定導(dǎo)出屬性
nfs的權(quán)限認(rèn)證是基于賬號(hào)的uid和gid的。
S#id hadoop
uid=502 gid=502
S#setfacl -m u:hadoop:rwx /read
S#su -hadoop
S$cd /data
S$touch a.hadoop
C#groupadd -g 502 openstack
C#useradd -u 502 -g 502 openstack
S#exportfs -ra
C#mount -t nfs 172.16.100.1:/data /sqld/mdata
C#ll /sqld/mdata
a.hadoop openstack openstack
C#su - openstackl
C$cd /sqld/mdata
C$touch b.openstack
S#ll /read
此時(shí)會(huì)發(fā)現(xiàn)b.openstack的屬主屬組為hadoop。
S#useradd -u 510 nfstest
S#cd /data
S#touch c.nfstest
S#chown nfstest:nfstest c.nfstest
S#vim /etc/exprots
/data 172.16.100.3/16(rw,all_squash,anonuid=510,nanogid=510) 限定導(dǎo)出屬性
#/read 172.16.100.3/16(ro)
S#exportfs -rav
C#umount /sqld/mdata
C#mount -t nfs 172.16.100.1:/data /sqld/mdata
C#ll /sqld/mdata
4.客戶端開(kāi)機(jī)掛載:
C#vim /etc/fstab
172.16.100.1:/data /sqld/mdata nfs defaults,_netdev 0 0
5.服務(wù)器進(jìn)程使用固定端口:
S#vim /etc/sysconfig/nfs
MOUNTD_PORT=892
RQUOTAD_PROT=875
LOCKD_TCPPORT=32083
LOCKD_UDPPORT=32769