1 / 14

NFS

NFS. Using Linux NFS. 安裝 NFS 服務. NFS 伺服器端必須安裝 NFS server 套件 若未安裝,則可安裝光碟中  ./RedHat/PPM  目錄下的 nfs-util 套件 使用 setup 由選單中選取 System services  進入 Services 的設定 nfs. Setting Up an NFS Server. Setting up the server will be done in two steps: Setting up the configuration files for NFS,

Download Presentation

NFS

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. NFS Using Linux NFS

  2. 安裝NFS服務 • NFS伺服器端必須安裝NFS server套件 • 若未安裝,則可安裝光碟中 ./RedHat/PPM 目錄下的nfs-util套件 • 使用setup由選單中選取System services 進入Services的設定nfs

  3. Setting Up an NFS Server • Setting up the server will be done in two steps: • Setting up the configuration files for NFS, • and then starting the NFS services.

  4. Setting up the Configuration Files • There are three main configuration files you will need to edit to set up an NFS server: /etc/exports, /etc/hosts.allow, and /etc/hosts.deny. • Strictly speaking, you only need to edit /etc/exports to get NFS to work, but you would be left with an extremely insecure setup.

  5. /etc/exports • A typical setup for /etc/exports might look like this: /usr/local 192.168.0.1(ro) 192.168.0.2(ro) /home 192.168.0.1(rw) 192.168.0.2(rw)

  6. Starting the Portmapper • NFS depends on the portmapper daemon, either called portmap or rpc.portmap. • It will need to be started first. It should be located in /sbin but is sometimes in /usr/sbin. • Most recent Linux distributions start this daemon in the boot scripts, but it is worth making sure that it is running before you begin working with NFS (just type ps aux | grep portmap).

  7. The Daemons • NFS serving is taken care of by five daemons: • rpc.nfsd, which does most of the work; • rpc.lockd and rpc.statd, which handle file locking; • rpc.mountd, which handles the initial mount requests, • and rpc.rquotad, which handles user file quotas on exported volumes.

  8. The Daemons • Starting with 2.2.18, lockd is called by nfsd upon demand, so you do not need to worry about starting it yourself. statd will need to be started separately. Most recent Linux distributions will have startup scripts for these daemons. • The daemons are all part of the nfs-utils package, and may be either in the /sbin directory or the /usr/sbin directory.

  9. Verifying that NFS is running • To do this, query the portmapper with the command rpcinfo -p to find out what services it is providing. • If you do not at least see a line that says portmapper, a line that says nfs, and a line that says mountd then you will need to backtrack and try again to start up the daemons

  10. 啟動NFS服務 • 啟動NFS /etc/rc.d/init.d/nfs start • 停止 /etc/rc.d/init.d/nfs stop • 設定在每次開機時可以自動啓動 chkconfig nfs on

  11. Making changes to /etc/exports later on • You should run the command exportfs –rato force nfsd to re-read the /etc/exports file. • If you can't find the exportfs command, then you can kill nfsd with the -HUP flag

  12. Setting up an NFS Client • Mounting remote directories • Getting NFS File Systems to Be Mounted at Boot Time

  13. Mounting remote directories 建立掛載點(mount point),並修改 mkdir /mnt/home mount master.foo.com:/home /mnt/home • You can get rid of the file system by typing umount /mnt/home

  14. Getting NFS File Systems to Be Mounted at Boot Time • in /etc/fstab would look like: master.foo.com:/home /mnt nfs rw,soft,intr 0 0 http://nfs.sourceforge.net/nfs-howto/index.html

More Related