轉帖|行業資訊|編輯:王香|2017-04-25 14:34:20.000|閱讀 260 次
概述:Centos(Community Enterprise Operating System,中文意思是:社區企業操作系統)是Linux發行版之一,它是來自于Red Hat Enterprise Linux依照開放源代碼規定釋出的源代碼所編譯而成。如果生產環境,可以利用heartbeta或者keepalived作高可用,下面介紹一下nfs服務安裝過程。
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
一、安裝環境
NFS服務器:CentOS6.5 192.168.0.10
NFS客戶端:CentOS6.5 192.168.0.11
二、服務器端安裝配置
1、先用rpm -qa命令查看所需安裝包(nfs-utils、rpcbind)是否已經安裝:
[root@local /]# rpm -qa | grep "rpcbind" rpcbind-0.2.0-11.el6.x86_64[root@local /]# rpm -qa | grep "nfs" nfs-utils-1.2.3-39.el6.x86_64 nfs4-acl-tools-0.3.3-6.el6.x86_64 nfs-utils-lib-1.1.5-6.el6.x86_64
2、如查詢結果如上,說明服務器自身已經安裝了NFS,如果沒有安裝,則用yum命令來安裝:
[root@local /]# yum -y install nfs-utils rpcbind
3、創建共享目錄:
[root@local /]# mkdir /sharestore
4、NFS共享文件路徑配置:
編輯/etc/exports添加下面一行,添加后保存退出。
[root@local /]# vi /etc/exports /sharestore *(rw,sync,no_root_squash)
/sharestore 10.10.0.0/8(rw,sync,no_subtree_check,anonuid=48,anongid=48)
你也可以指定可以訪問網段和用戶id。
5、啟動NFS服務(先啟動rpcbind,再啟動nfs;如果服務器自身已經安裝過NFS,那就用restart重啟兩個服務):
[root@local /]# service rpcbind start Starting rpcbind: [ OK ][root@local /]# service nfs start Starting NFS services: [ OK ] Starting NFS quotas: [ OK ] Starting NFS mountd: [ OK ] Stopping RPC idmapd: [ OK ] Starting RPC idmapd: [ OK ] Starting NFS daemon: [ OK ][root@local /]#
6、設置NFS服務開機自啟動:
[root@local /]# chkconfig rpcbind on[root@local /]# chkconfig nfs on
三、客戶端掛載配置
1、創建一個掛載點:
[root@localhost ~]# mkdir /mnt/store
2、查看NFS服務器上的共享:
[root@localhost /]# showmount -e 192.168.0.10 Export list for 192.168.0.10: /sharestore *
3、掛載:
[root@localhost ~]# mount -t nfs 192.168.0.10:/sharestore /mnt/store
4、查看已掛載共享:
[root@localhost ~]# mount /dev/mapper/VolGroup-lv_root 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) /dev/sda1 on /boot type ext4 (rw) /dev/mapper/VolGroup-lv_home on /home type ext4 (rw) none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw) nfsd on /proc/fs/nfsd type nfsd (rw) 192.168.0.10:/mailstore1/ on /mailstore_new type nfs (rw,vers=4,addr=192.168.0.10,clientaddr=192.168.0.11)
文件格式轉換工具75折限時促銷點擊查看>>>>
本站文章除注明轉載外,均為本站原創或翻譯。歡迎任何形式的轉載,但請務必注明出處、不得修改原文相關鏈接,如果存在內容上的異議請郵件反饋至chenjj@fc6vip.cn