博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
nfs的安装和配置
阅读量:7090 次
发布时间:2019-06-28

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

hot3.png

nfs的安装和配置,经常安装,做个比较复制快些。

1. yum 安装

yum install nfs-utils -yyum install rpcbind -yyum install mount.nfs -y

 

2. 选择好要nfs的目录

mkdir /var/exportfsmkdir /var/exportfs/uploadmkdir /var/exportfs/share

如果是挂载的其它盘则使用

cat /etc/fstab/dev/vdb1		/var/redis		ext4	defaults	0 0/dev/vdb2		/var/exports		ext4	defaults	0 0
mount -a    //挂载

或者:

mount [-t type] [-o option] device dirmount -t ext4 /dev/vdb1 /var/redis//卸载umount /dev/vdb1    或umount /var/redis

 

3. 编写exports文件(nfs配置文件)

cat /etc/exports/var/exportfs/upload		10.30.196.147/32(rw,no_root_squash,no_all_squash,sync) 10.30.196.142/32(rw,no_root_squash,no_all_squash,sync) 10.27.109.112/32(rw,no_root_squash,no_all_squash,sync) 10.27.110.20/32(rw,no_root_squash,no_all_squash,sync) 10.27.110.13/32(rw,no_root_squash,no_all_squash,sync)/var/exportfs/share		10.30.196.147/32(rw,no_root_squash,no_all_squash,sync) 10.30.196.142/32(rw,no_root_squash,no_all_squash,sync) 10.27.109.112/32(rw,no_root_squash,no_all_squash,sync) 10.27.110.20/32(rw,no_root_squash,no_all_squash,sync) 10.27.110.13/32(rw,no_root_squash,no_all_squash,sync) 10.27.60.27/32(rw,no_root_squash,no_all_squash,sync) 10.28.109.8/32(rw,no_root_squash,no_all_squash,sync) 10.28.142.168/32(rw,no_root_squash,no_all_squash,sync) 10.27.210.240/32(rw,no_root_squash,no_all_squash,sync)

设定那些机器具有那些权限

 

4. 启动nfs

service rpcbind startservice nfs start

如果出现

Starting NFS mountd: rpc.mountd: svc_tli_create: could not open connection for udp6rpc.mountd: svc_tli_create: could not open connection for tcp6rpc.mountd: svc_tli_create: could not open connection for udp6rpc.mountd: svc_tli_create: could not open connection for tcp6rpc.mountd: svc_tli_create: could not open connection for udp6rpc.mountd: svc_tli_create: could not open connection for tcp6                                                           [FAILED]

这个是ipv6的支持,不需要则可以

vi /etc/netconfig udp tpi_clts v inet udp - -tcp tpi_cots_ord v inet tcp - -#udp6 tpi_clts v inet6 udp - -#tcp6 tpi_cots_ord v inet6 tcp - -rawip tpi_raw - inet - - -local tpi_cots_ord - loopback - - -unix tpi_cots_ord - loopback - - -

如果出现

Starting NFS daemon: rpc.nfsd: writing fd to kernel failed: errno 111 (Connection refused)rpc.nfsd: address family inet6 not supported by protocol TCPrpc.nfsd: unable to set any sockets for nfsd

这是rpcbind没有启动,需要先启动rpcbind, service rpcbind start

6. 需要主要的地方:

service rpcbind startrpcbind需要比nfs先启动然后在service nfs start过程中需要确保nfs 和rpcbind 服务会开机启动。chkconfig rpcbind --listchkconfig nfs --listchkconfig rpcbind onchkconfig nfs on

 

7. nfs客户机

也需要rpcbind,和nfs。

使用showmount -e 192.168.111.111来查看

使用mount -t nfs 192.168.111.111:/var/exportfs/share /opt/share

还可以是用 /etc/fstab里添加如下代码实现开机自动挂载

10.27.110.25:/var/exportfs/upload	/usr/local/upload	nfs	defaults	0 010.27.110.25:/var/exportfs/share		/opt/share		nfs	defaults	0 0

 

转载于:https://my.oschina.net/lenglingx/blog/875501

你可能感兴趣的文章
app耗电优化之二 使用电源管理来安排任务
查看>>
使用开源免费类库在.net中操作Excel
查看>>
LeetCode Problem 20
查看>>
Sass:字符串函数-To-upper-case()、To-lower-case()
查看>>
C# Parse and TryParse 方法详解
查看>>
针对ASP.NET页面实时进行GZIP压缩优化的几款压缩模块的使用简介及应用测试!(附源码)...
查看>>
修改cms 管理栏目路径
查看>>
HDFS读写数据块--${dfs.data.dir}选择策略
查看>>
事件冒泡简述及应用
查看>>
linux redis的启动---后台启动
查看>>
设计模式学习笔记--状态模式
查看>>
(摘) Web架构师应学些什么具备哪些能力
查看>>
[LeetCode]题解(python):124-Binary Tree Maximum Path Sum
查看>>
Java异常面试题
查看>>
JDBC对Mysql utf8mb4字符集的处理
查看>>
使用express-generator初始化你的项目目录
查看>>
使用JavaScript脚本控制媒体播放(顺序播放和随机播放)
查看>>
01背包
查看>>
poj1363 Rails
查看>>
ELK-Python(二)
查看>>