centos7安装nfs服务

通过nfs服务可以将一个机器上的硬盘共享给别的机器使用。

nfs服务端:

1.安装

yum -y install nfs-utils rpcbind

2.挂载

此处我要共享/data/adx目录让任意机器可读可写,编辑/etc/exports文件

/data/adx *(rw,no_root_squash,no_all_squash,sync)

配置文件为每个目录一行,目录后跟允许访问的客户端和客户端配置,多个客户端拿空格分割。具体配置可以参考man exports手册。

执行挂载命令:

exportfs -r

启动服务:

service rpcbind start
service nfs start

3.查看

showmount -e localhost

nfs客户端:

1.安装

yum -y install nfs-utils

2.挂载

# 查看nfs server
showmount -e 10.143.151.44
# 挂载磁盘
mkdir -p /data/adx
mount -t nfs 10.143.151.44:/data/adx /data/adx

猜你喜欢

转载自blog.csdn.net/catcher92/article/details/88575170