CentOS7 nfs搭建
来源:互联网 发布:淘宝助理显示不全 编辑:程序博客网 时间:2024/06/05 10:55
网络环境
192.168.2.164 nfs服务器
192.168.2.165 nfs客户端
安装环境
yum install nfs-utils.x86_64 rpcbind -y
查看gid与uid
[root@localhost /]# id rootuid=0(root) gid=0(root) groups=0(root)
修改配置文件(默认是空文本)
[root@localhost ~]# cat /etc/exports/opt/test 192.168.2.165(rw,no_root_squash,no_all_squash,sync,anonuid=0,anongid=0)
ll_squash:将远程访问的所有普通用户及所属组都映射为匿名用户或用户组(nfsnobody);
no_all_squash:与all_squash取反(默认设置);
root_squash:将root用户及所属组都映射为匿名用户或用户组(默认设置);
no_root_squash:与rootsquash取反;
anonuid=xxx:将远程访问的所有用户都映射为匿名用户,并指定该用户为本地用户(UID=xxx);
anongid=xxx:将远程访问的所有用户组都映射为匿名用户组账户,并指定该匿名用户组账户为本地用户组账户(GID=xxx);
创建目录及开启服务器
[root@localhost /]# mkdir /opt/test[root@localhost /]# systemctl stop firewalld.service[root@localhost /]# systemctl start rpcbind.service[root@localhost /]# systemctl start nfs-server.service [root@localhost /]# systemctl enable firewalld.service[root@localhost /]# systemctl enable rpcbind.service[root@localhost /]# systemctl enable nfs-server.service
查看可使用nfs mount情况
[root@localhost /]# showmount -eExport list for localhost.localdomain:/opt/test 192.168.2.165前提可识别主机名,使用hostname查看主机名然后添加到/etc/hosts中即可[root@localhost /]# hostname[root@localhost /]# vim /etc/hosts
客户端
yum install nfs-utils.x86_64 rpcbind -y
创建目录及开启服务器
[root@localhost /]# mkdir /opt/test[root@localhost /]# systemctl stop firewalld.service[root@localhost /]# systemctl start rpcbind.service[root@localhost /]# systemctl start nfs-server.service [root@localhost /]# systemctl enable firewalld.service[root@localhost /]# systemctl enable rpcbind.service[root@localhost /]# systemctl enable nfs-server.service
挂载
[root@localhost test]# mount 192.168.2.164:/opt/test /opt/test
开机自动挂载
[root@localhost test]# vim /etc/fstab # /etc/fstab # Created by anaconda on Fri May 13 23:48:07 2016 # # Accessible filesystems, by reference, are maintained under '/dev/disk' # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info # /dev/mapper/centos-root / xfs defaults 0 0 UUID=2a54fd18-e02c-48b1-8952-110e67a696fa /boot xfs defaults 0 0 /dev/mapper/centos-swap swap swap defaults 0 0 192.168.2.164:/opt/test /opt/test nfs4 defaults 0 0
查看nfs版本-在客户端
[root@localhost test]# nfsstat -m/opt/test from 192.168.2.164:/opt/test Flags: rw,relatime,vers=4.0,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=192.168.2.165,local_lock=none,addr=192.168.2.164
0 0
- CentOS7 nfs搭建
- CentOS7搭建NFS服务
- CentOS7搭建简易nfs
- centos7 搭建nfs服务器和客户端
- CentOS7搭建NAS,包括NFS、ISCSI
- centos7下的NFS 服务器端的搭建
- CentOS7搭建NAS,包括NFS、ISCSI
- NFS 搭建
- 搭建NFS
- NFS搭建
- 搭建NFS
- 搭建nfs
- nfs搭建
- centos7 nfs服务器配置
- CentOS7部署NFS服务
- centos7安装nfs服务
- CentOS7安装NFS
- Centos7配置NFS服务
- 剑指offer <从1 到 n 整数中1 出现的次数>(8)
- 利用MyEclipse建立JavaWeb应用并部署
- JS跨域问题以及采用JSONP方式解决跨域问题
- nyoj 801 Haffman编码
- WebView,HttpURLConnection,HttpClient的简单使用
- CentOS7 nfs搭建
- Tycho基本POM配置
- lightoj 1027 A Dangerous Maze
- Android实现支持缩放平移图片
- HDU 2639 Bone Collector II 01背包第k优解
- cocos2d-x 创建lua项目问题
- 打印沙漏
- hive分区partition(动态和静态分区混合使用; partition的简介)
- 抽象类和接口的区别