博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Fedora 17 x64如何配置nfs服务
阅读量:4177 次
发布时间:2019-05-26

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

测试环境:

[root@tp system]# uname -a

Linux tp 3.3.4-5.fc17.x86_64 #1 SMP Mon May 7 17:29:34 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
配置nfs exports:

vim /etc/exports

/run/media/k/Elements/unzip/ora11gR2forLinux64  192.168.221.0/24(rw,sync,no_root_squash)

激活exports,可直接用exportfs刷新或者重启服务:

1. exportfs刷新:

[root@tp system]# exportfs -avf

exporting 192.168.221.0/24:/run/media/k/Elements/unzip/ora11gR2forLinux64
2. 重启服务:
[root@tp system]# systemctl restart nfs-server.service

查看本机共享出的nfs文件夹:

[root@tp system]# showmount -e

Export list for tp:
/run/media/k/Elements/unzip/ora11gR2forLinux64 192.168.221.0/24
换台机器挂载nfs文件夹:

[root@rac1 ~]# mount -t nfs 192.168.221.1:/run/media/k/Elements/unzip/ora11gR2forLinux64 /mnt

[root@rac1 ~]# df -h
文件系统              容量  已用 可用 已用% 挂载点
/dev/mapper/VolGroup00-LogVol00
                      188G  2.7G  176G   2% /
/dev/sda1              99M   23M   71M  25% /boot
tmpfs                 2.0G     0  2.0G   0% /dev/shm
/dev/sr0              3.6G  3.6G     0 100% /media
192.168.221.1:/run/media/k/Elements/unzip/ora11gR2forLinux64
                      932G  806G  127G  87% /mnt
[root@rac1 ~]#
注意问题:

1. 检查配置没有问题后,仍无法发现nfs共享,可以先临时关闭防火墙(systemctl stop iptables.service)和SELINUX(setenforce 0),再试试看。

2. 客户机上能发现nfs共享,并且可以成功mount,但是没有权限列出mount后的目录,需要加no_root_squash到nfs exports选项里,这样客户机能以root权限来查看nfs共享文件夹。

man exports

       root_squash

              Map requests from uid/gid 0 to the anonymous uid/gid. Note  that
              this  does  not  apply  to  any other uids or gids that might be
              equally sensitive, such as user bin or group staff.
       no_root_squash
              Turn off root squashing. This option is mainly useful for  disk‐
              less clients.

REF:

1. Fedora 17 - NFS Server : Server World

http://www.server-world.info/en/note?os=Fedora_17&p=nfs

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

你可能感兴趣的文章
Spring boot集成jxls实现导入功能
查看>>
Spring boot读取配置的方式(指定配置文件)
查看>>
Spring Boot切换不同环境配置
查看>>
Spring cloud之Ribbon搭建
查看>>
TreeMap 与 HashMap 的区别
查看>>
初识CAS
查看>>
Fork/Join 框架
查看>>
服务雪崩效应
查看>>
策略模式实例
查看>>
PostgreSQL数据库管理 第八章日常运维
查看>>
PostgreSQL数据库管理第十章Repmgr
查看>>
Linux shell正则表达式-sed-awk-grep应用
查看>>
linux系统管理—第五章Linux-bashshell
查看>>
PostgreSQL数据库管理 第二章体系结构
查看>>
PostgreSQL数据库管理 第三章实例管理与管理工具
查看>>
PostgreSQL数据库管理第七章流复制
查看>>
PostgreSQL数据库管理第十章Repmgr
查看>>
PostgreSQL数据库管理 第八章日常运维
查看>>
MySQL数据库管理-体系结构
查看>>
软考UML
查看>>