nfs高可用及NFS程序安装

2016-12-14 16:40:00
村里来的扫地僧
原创
1203

一、安装NFS程序:

[root@linux-01 nfsdata]# rpm -qa nfs-utils rpcbind
[root@linux-01 nfsdata]# yum groupinstall "NFS file server"  
Loaded plugins: fastestmirror, security
base                                                                                                          | 3.7 kB     00:00     
base/primary_db                                                                                               | 4.7 MB     00:01     
extras                                                                                                        | 3.4 kB     00:00     
extras/primary_db                                                                                             |  37 kB     00:00     
updates                                                                                                       | 3.4 kB     00:00     
updates/primary_db                                                                                            | 2.1 MB     00:00     
Setting up Group Process
Determining fastest mirrors
 * base: mirror.bit.edu.cn
 * extras: mirror.bit.edu.cn
 * updates: centos.ustc.edu.cn
base/group_gz                                                                                                 | 226 kB     00:02     
Resolving Dependencies
--> Running transaction check
---> Package nfs-utils.x86_64 1:1.2.3-39.el6 will be updated
---> Package nfs-utils.x86_64 1:1.2.3-70.el6_8.1 will be an update
--> Processing Dependency: libtirpc >= 0.2.1-11 for package: 1:nfs-utils-1.2.3-70.el6_8.1.x86_64
--> Processing Dependency: python-argparse for package: 1:nfs-utils-1.2.3-70.el6_8.1.x86_64
---> Package nfs4-acl-tools.x86_64 0:0.3.3-6.el6 will be updated
---> Package nfs4-acl-tools.x86_64 0:0.3.3-8.el6 will be an update
--> Running transaction check
---> Package libtirpc.x86_64 0:0.2.1-6.el6_4 will be updated
---> Package libtirpc.x86_64 0:0.2.1-11.el6 will be an update
---> Package python-argparse.noarch 0:1.2.1-2.1.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=====================================================================================================================================
 Package                            Arch                      Version                               Repository                  Size
=====================================================================================================================================
Updating:
 nfs-utils                          x86_64                    1:1.2.3-70.el6_8.1                    updates                    335 k
 nfs4-acl-tools                     x86_64                    0.3.3-8.el6                           base                        43 k
Installing for dependencies:
 python-argparse                    noarch                    1.2.1-2.1.el6                         base                        48 k
Updating for dependencies:
 libtirpc                           x86_64                    0.2.1-11.el6                          base                        82 k

Transaction Summary
=====================================================================================================================================
Install       1 Package(s)
Upgrade       3 Package(s)

Total download size: 507 k
Is this ok [y/N]: y
Downloading Packages:
(1/4): libtirpc-0.2.1-11.el6.x86_64.rpm                                                                       |  82 kB     00:00     
(2/4): nfs-utils-1.2.3-70.el6_8.1.x86_64.rpm                                                                  | 335 kB     00:00     
(3/4): nfs4-acl-tools-0.3.3-8.el6.x86_64.rpm                                                                  |  43 kB     00:00     
(4/4): python-argparse-1.2.1-2.1.el6.noarch.rpm                                                               |  48 kB     00:00     
-------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                462 kB/s | 507 kB     00:01     
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
Importing GPG key 0xC105B9DE:
 Userid : CentOS-6 Key (CentOS 6 Official Signing Key) <centos-6-key@centos.org>
 Package: centos-release-6-5.el6.centos.11.1.x86_64 (@anaconda-CentOS-201311272149.x86_64/6.5)
 From   : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
Is this ok [y/N]: y
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : python-argparse-1.2.1-2.1.el6.noarch                                                                              1/7 
  Updating   : libtirpc-0.2.1-11.el6.x86_64                                                                                      2/7 
  Updating   : 1:nfs-utils-1.2.3-70.el6_8.1.x86_64                                                                               3/7 
  Updating   : nfs4-acl-tools-0.3.3-8.el6.x86_64                                                                                 4/7 
  Cleanup    : 1:nfs-utils-1.2.3-39.el6.x86_64                                                                                   5/7 
  Cleanup    : libtirpc-0.2.1-6.el6_4.x86_64                                                                                     6/7 
  Cleanup    : nfs4-acl-tools-0.3.3-6.el6.x86_64                                                                                 7/7 
  Verifying  : 1:nfs-utils-1.2.3-70.el6_8.1.x86_64                                                                               1/7 
  Verifying  : nfs4-acl-tools-0.3.3-8.el6.x86_64                                                                                 2/7 
  Verifying  : libtirpc-0.2.1-11.el6.x86_64                                                                                      3/7 
  Verifying  : python-argparse-1.2.1-2.1.el6.noarch                                                                              4/7 
  Verifying  : 1:nfs-utils-1.2.3-39.el6.x86_64                                                                                   5/7 
  Verifying  : nfs4-acl-tools-0.3.3-6.el6.x86_64                                                                                 6/7 
  Verifying  : libtirpc-0.2.1-6.el6_4.x86_64                                                                                     7/7 

Dependency Installed:
  python-argparse.noarch 0:1.2.1-2.1.el6                                                                                             

Updated:
  nfs-utils.x86_64 1:1.2.3-70.el6_8.1                               nfs4-acl-tools.x86_64 0:0.3.3-8.el6                              

Dependency Updated:
  libtirpc.x86_64 0:0.2.1-11.el6                                                                                                     

Complete!
[root@linux-01 nfsdata]# 
二、创建 共享NFS目录

[root@linux-01 /]# mkdir /nfsdata
三、授权目录

[root@linux-01 /] chmod -R 777 nfsdata/
[root@linux-01 /]chown -R root.root nfsdata
四、添加服务启动

[root@linux-01 /]# chkconfig nfs on
[root@linux-01 /]# chkconfig rpcbind on
五、编辑配置文件

[root@linux-01 /]# vim /etc/exports 
/nfsdata 192.168.32.* (rw,sync)
六、启动nfs,rpcbind

[root@linux-01 ~]# /etc/init.d/nfs restart
Shutting down NFS daemon:                                  [  OK  ]
Shutting down NFS mountd:                                  [  OK  ]
Shutting down NFS quotas:                                  [  OK  ]
Shutting down NFS services:                                [  OK  ]
Shutting down RPC idmapd:                                  [  OK  ]
Starting NFS services:                                     [  OK  ]
Starting NFS quotas:                                       [  OK  ]
Starting NFS mountd:                                       [  OK  ]
Starting NFS daemon:                                       [  OK  ]
Starting RPC idmapd:                                       [  OK  ]
七、显示可挂载

[root@linux-01 ~]# showmount -e 192.168.32.200
Export list for 192.168.32.200:
/nfsdata 192.168.32.*
[root@linux-01 ~]# 

发表评论
肆 乘 壹 =
评论通过审核后显示。