NFS在文件傳送或信息傳送過程中依賴於RPC協議。RPC,遠程過程調用 (RemoteProcedure Call) 是能使客戶端執行其他系統中程序的一種機制。NFS本身是沒有提供信息傳輸的協議和功能的,但NFS卻能讓我們通過網絡進行資料的分享,這是因為NFS使用了一些其它的傳輸協議。而這些傳輸協議用到這個RPC功能的。可以說NFS本身就是使用RPC的一個程序。或者說NFS也是一個RPC SERVER。所以只要用到NFS的地方都要啟動RPC服務,不論是NFS SERVER或者NFS CLIENT。這樣SERVER和CLIENT才能通過RPC來實現PROGRAM
PORT的對應。可以這麼理解RPC和NFS的關系:NFS是一個文件系統,而RPC是負責負責信息的傳輸。
portmap/rpcbind:主要功能是進行端口映射工作。當客戶端嘗試連接並使用RPC服務器提供的服務(如NFS服務)時,portmap會將所管理的與服務對應的端口提供給客戶端,從而使客戶可以通過該端口向服務器請求服務。
在CentOS,原來的portmap改成了rpcbind。如果這兩個軟件沒有安裝,就要下載對應的rpm包進行安裝(當然也可以用yum等其他安裝方式)
nfs 2049/tcp nfsd shilp # Network File System
nfs 2049/udp nfsd shilp # Network File System
nfs 2049/sctp nfsd shilp # Network File System
cat/etc/services | grep rpcbindsunrpc 111/tcp portmapper rpcbind #RPC 4.0 portmapper TCP
sunrpc 111/udp portmapper rpcbind # RPC 4.0 portmapper
另外,要固定mount服務的端口為976
cat>> /etc/services mountd 976/udp
mountd 976/tcp
servicenfs restart
servicenfs status
rpc.svcgssd isstopped
rpc.mountd (pid8451) is running...
nfsd (pid 84488447 8446 8445 8444 8443 8442 8441) is running...
rpc.rquotad (pid8435) is running...
servicerpcbind status
rpcbind (pid 1541) is running...
0513-044 The biodSubsystem was requested to stop.
0513-044 The nfsdSubsystem was requested to stop.
0513-044 Therpc.lockd Subsystem was requested to stop.
0513-044 Therpc.statd Subsystem was requested to stop.
stopsrc-s portmap
0513-044 Theportmap Subsystem was requested to stop.
startsrc-s portmap
0513-059 Theportmap Subsystem has been started. Subsystem PID is 156104.
startsrc-g nfs
0513-059 The biodSubsystem has been started. Subsystem PID is 397708.
0513-059 The nfsdSubsystem has been started. Subsystem PID is 352796.
0513-059 Therpc.mountd Subsystem has been started. Subsystem PID is 360828.
0513-059 Thenfsrgyd Subsystem has been started. Subsystem PID is 369402.
0513-059 The gssdSubsystem has been started. Subsystem PID is 360830.
0513-059 Therpc.lockd Subsystem has been started. Subsystem PID is 369404.
mount 10.249.60.65:/home/bapogg/ogg/test_nfs
就用fuser -k/ogg/test_nfs 把占用的進程殺掉。當然不那麼粗暴的方式是fuser/ogg/test_nfs看哪些進程占用這個文件系統。