1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50 1[root@insurance project]# yum list installed | grep 'nfs' 检查是否已经安装NFS
2[root@insurance project]# yum -y install nfs-utils rpcbind 安装NFS
3Loaded plugins: fastestmirror
4Setting up Install Process
5Loading mirror speeds from cached hostfile
6base | 3.7 kB 00:00
7epel | 4.7 kB 00:00
8epel/primary_db | 6.0 MB 00:00
9extras | 3.4 kB 00:00
10updates | 3.4 kB 00:00
11Resolving Dependencies
12--> Running transaction check
13---> Package nfs-utils.x86_64 1:1.2.3-75.el6_9 will be installed
14--> Processing Dependency: nfs-utils-lib >= 1.1.0-3 for package: 1:nfs-utils-1.2.3-75.el6_9.x86_64
15--> Processing Dependency: libtirpc >= 0.2.1-11 for package: 1:nfs-utils-1.2.3-75.el6_9.x86_64
16--> Processing Dependency: keyutils >= 1.4-4 for package: 1:nfs-utils-1.2.3-75.el6_9.x86_64
17--> Processing Dependency: python-argparse for package: 1:nfs-utils-1.2.3-75.el6_9.x86_64
18--> Processing Dependency: libgssglue.so.1(libgssapi_CITI_2)(64bit) for package: 1:nfs-utils-1.2.3-75.el6_9.x86_6 4
19--> Processing Dependency: libgssglue for package: 1:nfs-utils-1.2.3-75.el6_9.x86_64
20--> Processing Dependency: libevent for package: 1:nfs-utils-1.2.3-75.el6_9.x86_64
21--> Processing Dependency: libtirpc.so.1()(64bit) for package: 1:nfs-utils-1.2.3-75.el6_9.x86_64
22--> Processing Dependency: libnfsidmap.so.0()(64bit) for package: 1:nfs-utils-1.2.3-75.el6_9.x86_64
23--> Processing Dependency: libgssglue.so.1()(64bit) for package: 1:nfs-utils-1.2.3-75.el6_9.x86_64
24--> Processing Dependency: libevent-1.4.so.2()(64bit) for package: 1:nfs-utils-1.2.3-75.el6_9.x86_64
25---> Package rpcbind.x86_64 0:0.2.0-13.el6_9.1 will be installed
26--> Running transaction check
27---> Package keyutils.x86_64 0:1.4-5.el6 will be installed
28---> Package libevent.x86_64 0:1.4.13-4.el6 will be installed
29---> Package libgssglue.x86_64 0:0.1-11.el6 will be installed
30---> Package libtirpc.x86_64 0:0.2.1-13.el6_9 will be installed
31---> Package nfs-utils-lib.x86_64 0:1.1.5-13.el6 will be installed
32---> Package python-argparse.noarch 0:1.2.1-2.1.el6 will be installed
33--> Finished Dependency Resolution
34
35Dependencies Resolved
36
37=================================================================================================================
38 Package Arch Version Repository Size
39=================================================================================================================
40Installing:
41 nfs-utils x86_64 1:1.2.3-75.el6_9 updates 336 k
42 rpcbind x86_64 0.2.0-13.el6_9.1 updates 51 k
43Installing for dependencies:
44 keyutils x86_64 1.4-5.el6 base 39 k
45 libevent x86_64 1.4.13-4.el6 base 66 k
46 libgssglue x86_64 0.1-11.el6 base 23 k
47 libtirpc x86_64 0.2.1-13.el6_9 updates 82 k
48 nfs-utils-lib x86_64 1.1.5-13.el6 base 71 k
49 python-argparse noarch 1.2.1-2.1.el6 base 48 k
50
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67 1Transaction Summary
2=================================================================================================================
3Install 8 Package(s)
4
5Total download size: 716 k
6Installed size: 2.0 M
7Downloading Packages:
8(1/8): keyutils-1.4-5.el6.x86_64.rpm | 39 kB 00:00
9(2/8): libevent-1.4.13-4.el6.x86_64.rpm | 66 kB 00:00
10(3/8): libgssglue-0.1-11.el6.x86_64.rpm | 23 kB 00:00
11(4/8): libtirpc-0.2.1-13.el6_9.x86_64.rpm | 82 kB 00:00
12(5/8): nfs-utils-1.2.3-75.el6_9.x86_64.rpm | 336 kB 00:00
13(6/8): nfs-utils-lib-1.1.5-13.el6.x86_64.rpm | 71 kB 00:00
14(7/8): python-argparse-1.2.1-2.1.el6.noarch.rpm | 48 kB 00:00
15(8/8): rpcbind-0.2.0-13.el6_9.1.x86_64.rpm | 51 kB 00:00
16-----------------------------------------------------------------------------------------------------------------
17Total 2.8 MB/s | 716 kB 00:00
18Running rpm_check_debug
19Running Transaction Test
20Transaction Test Succeeded
21Running Transaction
22 Installing : libgssglue-0.1-11.el6.x86_64 1/8
23 Installing : libtirpc-0.2.1-13.el6_9.x86_64 2/8
24 Installing : rpcbind-0.2.0-13.el6_9.1.x86_64 3/8
25 Installing : python-argparse-1.2.1-2.1.el6.noarch 4/8
26 Installing : libevent-1.4.13-4.el6.x86_64 5/8
27 Installing : keyutils-1.4-5.el6.x86_64 6/8
28 Installing : nfs-utils-lib-1.1.5-13.el6.x86_64 7/8
29 Installing : 1:nfs-utils-1.2.3-75.el6_9.x86_64 8/8
30 Verifying : rpcbind-0.2.0-13.el6_9.1.x86_64 1/8
31 Verifying : libtirpc-0.2.1-13.el6_9.x86_64 2/8
32 Verifying : keyutils-1.4-5.el6.x86_64 3/8
33 Verifying : libevent-1.4.13-4.el6.x86_64 4/8
34 Verifying : nfs-utils-lib-1.1.5-13.el6.x86_64 5/8
35 Verifying : libgssglue-0.1-11.el6.x86_64 6/8
36 Verifying : 1:nfs-utils-1.2.3-75.el6_9.x86_64 7/8
37 Verifying : python-argparse-1.2.1-2.1.el6.noarch 8/8
38
39Installed:
40 nfs-utils.x86_64 1:1.2.3-75.el6_9 rpcbind.x86_64 0:0.2.0-13.el6_9.1
41
42Dependency Installed:
43 keyutils.x86_64 0:1.4-5.el6 libevent.x86_64 0:1.4.13-4.el6 libgssglue.x86_64 0:0.1-11.el6
44 libtirpc.x86_64 0:0.2.1-13.el6_9 nfs-utils-lib.x86_64 0:1.1.5-13.el6 python-argparse.noarch 0:1.2.1-2.1.el6
45
46Complete! 安装完成
47[root@insurance project]# service nfs status 查看当前NFS 服务状态
48rpc.svcgssd is stopped 并未启动
49rpc.mountd is stopped
50nfsd is stopped
51[root@insurance project]# service rpcbind start 启动服务
52Starting rpcbind: [ OK ]
53[root@insurance project]# service nfs start 启动服务
54Starting NFS services: [ OK ]
55Starting NFS mountd: rpc.mountd: svc_tli_create: could not open connection for udp6
56rpc.mountd: svc_tli_create: could not open connection for tcp6
57rpc.mountd: svc_tli_create: could not open connection for udp6
58rpc.mountd: svc_tli_create: could not open connection for tcp6
59rpc.mountd: svc_tli_create: could not open connection for udp6
60rpc.mountd: svc_tli_create: could not open connection for tcp6
61 [ OK ]
62Starting NFS daemon: rpc.nfsd: address family inet6 not supported by protocol TCP
63 [ OK ]
64Starting RPC idmapd: [ OK ]
65[root@insurance project]#
66
67
共享设置
1、在172.17.150.79设置共享目录,把该目录开放给*********,编辑/etc/exports,增加一行
/data/project/insurance_web/upload 172.17.150.79(rw,no_root_squash,no_all_squash,sync)
使配置生效,输入命令:exportfs -r
3、查看已共享的目录,命令:
本机:showmount -e
其他:showmount -e IP
1
2
3
4
5
6 1[root@insurance project]# exportfs -r
2[root@insurance project]# showmount -e
3Export list for insurance:
4/data/project/insurance_web/upload 172.17.150.79
5
6
4、在********挂载共享文件夹,输入命令:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 1[root@insurance insurance-mall]# mount -t nfs 172.17.150.79:/data/project/insurance_web/upload/ /data/project/insurance-mall/upload
2[root@insurance insurance-mall]# ls
3css detail.html fonts form.html images index.html index.jsp js META-INF payment.html pay-success.html upload WEB-INF
4[root@insurance insurance-mall]# ls upload/
520180428120107263854.jpg 20180503105220526107.png 20180503123215672584.png 20180503135022174694.png 20180503152644483515.jpg 201805031806495746.jpg 20180504172445484913.jpg 20180510165903984799.jpg 20180515100239888142.png
620180428120303367285.jpg 20180503105348438164.png 20180503123252897243.png 2018050313583141970.png 20180503152856893189.jpg 20180504092426276881.jpg 20180504172634183370.jpg 20180510165946326882.png 20180515100309974224.png
720180428120506834278.jpg 20180503105350096980.png 20180503123549638868.png 20180503135845444243.png 20180503153119032462.jpg 20180504115041780679.jpg 20180504172739446406.jpg 20180510170000883910.png 20180515101627862971.png
820180428120759467189.jpg 20180503105553595891.txt 20180503124856857812.png 20180503140000035940.png 20180503153858556445.jpg 20180504115114842953.jpg 2018050417322546729.jpg 20180510170014895122.jpg 20180515102732738279.png
920180428120836170972.jpg 20180503112516938675.png 20180503124918949759.png 20180503140643997635.png 20180503154007183550.jpg 20180504115227816876.jpg 20180504175512363259.jpg 20180510170028731721.jpg 20180515103238561509.png
1020180428121106825248.jpg 20180503112800561585.png 20180503125124155430.png 20180503140803692109.png 20180503155138478341.jpg 20180504115559724856.jpg 20180504181041667857.jpg 2018051017110829167.png 20180515103822699619.png
1120180428142928142350.jpg 20180503113315568287.png 20180503125146198840.png 20180503140844160699.png 20180503155215376605.jpg 20180504115851041980.jpg 20180504182340754177.jpg 201805101711532413.jpg 20180515104302200943.png
1220180428143144053113.jpg 20180503113340177304.png 20180503125234137231.png 20180503140850811284.png 20180503155413262760.jpg 20180504124000965117.jpg 20180504182721751873.jpg 20180510171217809702.jpg 20180515173900150773.png
1320180428143511609876.jpg 20180503113540889585.png 20180503125317371246.png 20180503141250053511.png 20180503160012380142.jpg 20180504143411680467.jpg 20180504184424844985.jpg 20180511155233591987.jpg 20180516142601347497.png
1420180428143701975532.jpg 20180503113622747675.png 20180503125429621246.png 2018050314162540750.png 20180503161337421993.jpg 20180504144228098566.jpg 20180507120503685564.png 20180511155421343984.jpg 20180518155240109825.png
1520180428143753463104.jpg 20180503114302753620.png 20180503125612074698.png 20180503141630126214.png 20180503161639457248.jpg 20180504145900031454.jpg 20180507121119930691.png 20180511155508163733.png 20180518155659402994.png
1620180428143949763466.jpg 20180503114704582415.png 2018050312564058336.png 20180503141634831689.png 20180503162125501895.jpg 20180504150020163627.jpg 2018050712135390043.png 20180511160410283600.png 20180518155936698602.jpg
172018042815193138872.jpg 20180503115213554499.png 20180503125908553267.png 20180503142037861616.png 20180503162155798106.jpg 20180504151434770809.jpg 20180507122346529893.png 20180511170658464210.png 20180518155954983586.jpg
1820180428152646455694.jpg 20180503115411345865.png 20180503133222177944.png 20180503142046269156.png 20180503162553864987.jpg 20180504151953494341.jpg 20180507122641960158.png 20180511181559935780.jpg 20180518160123849368.png
1920180428153349611431.jpg 20180503115523874309.png 20180503134150205479.png 20180503142130532478.png 20180503162703833497.jpg 20180504152950708380.jpg 20180509153819107909.jpg 20180511181619615275.png 20180518160142449575.jpg
20201804281657209049
21