博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
NFS安装及优化过程--centos6.6
阅读量:7062 次
发布时间:2019-06-28

本文共 3305 字,大约阅读时间需要 11 分钟。

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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
查看安装软件
[root@lufengcentos ~]
# rpm -qa nfs-utils rpcbind
[root@lufengcentos ~]
# yum install nfs-utils rpcbind -y
[root@lufengcentos ~]
# rpm -qa nfs-utils rpcbind       
rpcbind-0.2.0-12.el6.x86_64
nfs-utils-1.2.3-70.el6_8.2.x86_64
 
 
启动相关服务
[root@lufengcentos ~]
# LANG=en
[root@lufengcentos ~]
# /etc/init.d/rpcbind status   
rpcbind is stopped
[root@lufengcentos ~]
# /etc/init.d/rpcbind start
Starting rpcbind:
[root@lufengcentos ~]
# /etc/init.d/rpcbind status
rpcbind (pid  1225) is running...
 
[root@lufengcentos ~]
# lsof -i :111
COMMAND  PID USER   FD   TYPE DEVICE SIZE
/OFF 
NODE NAME
rpcbind 1225  rpc    6u  IPv4  11011      0t0  UDP *:sunrpc 
rpcbind 1225  rpc    8u  IPv4  11014      0t0  TCP *:sunrpc (LISTEN)
rpcbind 1225  rpc    9u  IPv6  11016      0t0  UDP *:sunrpc 
rpcbind 1225  rpc   11u  IPv6  11019      0t0  TCP *:sunrpc (LISTEN)
[root@lufengcentos ~]
# netstat -lntup|grep rpcbind
tcp        0      0 0.0.0.0:111                 0.0.0.0:*                   LISTEN      1225
/rpcbind        
tcp        0      0 :::111                      :::*                        LISTEN      1225
/rpcbind        
udp        0      0 0.0.0.0:976                 0.0.0.0:*                               1225
/rpcbind        
udp        0      0 0.0.0.0:111                 0.0.0.0:*                               1225
/rpcbind        
udp        0      0 :::976                      :::*                                    1225
/rpcbind        
udp        0      0 :::111                      :::*                                    1225
/rpcbind
[root@lufengcentos ~]
# rpcinfo -p localhost
   
program vers proto   port  service
    
100000    4   tcp    111  portmapper
    
100000    3   tcp    111  portmapper
    
100000    2   tcp    111  portmapper
    
100000    4   udp    111  portmapper
    
100000    3   udp    111  portmapper
    
100000    2   udp    111  portmapper
 
[root@lufengcentos ~]
# /etc/init.d/nfs status
rpc.svcgssd 已停
[root@lufengcentos ~]
# /etc/init.d/nfs start
Starting NFS services:                                     [  OK  ]
Starting NFS quotas:                                       [  OK  ]
Starting NFS mountd:                                       [  OK  ]
Starting NFS daemon:                                       [  OK  ]
正在启动 RPC idmapd:                                      [确定]
[root@lufengcentos ~]
# /etc/init.d/nfs status
rpc.svcgssd 已停
rpc.mountd (pid 1318) is running...
nfsd (pid 1334 1333 1332 1331 1330 1329 1328 1327) is running...
rpc.rquotad (pid 1313) is running...
 
 
设置自启动
[root@lufengcentos ~]
# chkconfig nfs on
[root@lufengcentos ~]
# chkconfig --list rpcbind
rpcbind         0:off   1:off   2:on    3:on    4:on    5:on    6:off
 
[root@nfs-server ~]
# tail -3 /etc/rc.local
touch 
/var/lock/subsys/local
/etc/init
.d
/rpcbind 
start
/etc/init
.d
/nfs 
start
 
 
服务器配置及挂载
[root@lufengcentos ~]
# vi /etc/exports   
"/etc/exports" 
1L, 28C written
[root@lufengcentos ~]
# cat /etc/exports      
/data 
192.1.1.0
/24
(rw,
sync
,all_squash)
 
[root@lufengcentos ~]
# showmount -e 127.0.0.1
Export list 
for 
127.0.0.1:
/data 
192.1.1.0
/24
 
[root@lufengcentos ~]
# mount -t nfs 192.1.1.8:/data /mnt
[root@lufengcentos ~]
# df -h
Filesystem       Size  Used Avail Use% Mounted on
/dev/sda3        
7.1G  1.5G  5.3G  22% /
tmpfs            491M     0  491M   0% 
/dev/shm
/dev/sda1        
190M   27M  153M  15% 
/boot
192.1.1.8:
/data  
7.1G  1.5G  5.3G  22% 
/mnt
 
[root@lufengcentos ~]
# grep 65534 /etc/passwd
nfsnobody:x:65534:65534:Anonymous NFS User:
/var/lib/nfs
:
/sbin/nologin
[root@lufengcentos ~]
# chown -R nfsnobody /data
   
内核优化
cat 
>>
/etc/sysctl
.conf<<EOF
net.core.rmmem_default=8388608
net.core.wmmem_default=8388608
net.core.rmmem_max=16777216
net.core.wmmem_max=16777216
EOF
 
挂载优化:
mount 
-t nfs -o nosuid,noexec,nodev,noatime,nodiratime,rsize=131072,wsize=131072 192.1.1.8:
/data/ 
/mnt

 

本文出自 “” 博客,请务必保留此出处

转载地址:http://tnnll.baihongyu.com/

你可能感兴趣的文章
Promise面试题2实现异步串行执行
查看>>
ECS应用管理最佳实践
查看>>
JavaSE小实践1:Java爬取斗图网站的所有表情包
查看>>
微信小程序上拉加载:onReachBottom详解+设置触发距离
查看>>
python docx文档转html页面
查看>>
【跃迁之路】【463天】刻意练习系列222(2018.05.14)
查看>>
windows-nginx-https-本地配置
查看>>
JDK9: 集成 Jshell 和 Maven 项目.
查看>>
【跃迁之路】【444天】程序员高效学习方法论探索系列(实验阶段201-2018.04.25)...
查看>>
回流、重绘及其优化
查看>>
入口文件开始,分析Vue源码实现
查看>>
微信开放平台全网发布【失败】的几点排查方法
查看>>
vue-router 实现分析
查看>>
js如何打印object对象
查看>>
体验javascript之美-第五课 匿名函数自执行和闭包是一回事儿吗?
查看>>
Ruby 2.x 源代码分析:扩展 概述
查看>>
我感觉这是史上最牛的防sql注入方法类
查看>>
angular2开源库收集
查看>>
ArchSummit深圳APM专场总结:性能监控与调优实践干货分享
查看>>
Vue性能优化:如何实现延迟加载和代码拆分?
查看>>