centos7中nfs文件系统的使用

news/2024/7/5 10:17:46
需求:file01:1.1.1.1(内网ip 172.20.103.212),file02:2.2.2.2(内网ip 172.20.103.211) 这两台机器的 /dev/mapper/myvg-mylv /data  这个盘都挂载到 video01 47.254.78.171, video02 47.254.83.81 这两台机器上即将file01和file02的/data目录都挂载到video01和video02上处理:
file01和file02安装
yum install -y exportfs nfs-utilsvideo01和video02安装
yum install -y nfs-utils1.在file01和file02添加共享的文件夹和客户端可以访问的IP地址[root@eus_filmora_file01:~]# vim /etc/exports
/data *(insecure,rw,no_root_squash,sync,anonuid=500,anongid=500)# 查看共享文件夹[root@eus_filmora_file01:/data]# exportfs -rv
exporting *:/data# 重启file01的NFS服务  
systemctl restart nfs2.目标机器video01和video02上创建挂载点并挂载# 客户端video01和video02操作
mkdir /file01_nfs
mkdir /file02_nfs# 挂载file01和file02
mount -t nfs 172.20.103.212:/data /file01_nfs -o proto=tcp -o nolock
mount -t nfs 172.20.103.211:/data /file02_nfs -o proto=tcp -o nolock# 卸载nfs
[root@eus_filmora_video01:~]# umount 172.20.103.212:/data列出nfs服务端共享的目录:
[root@eus_filmora_video01:/file02_nfs]# showmount -e 172.20.103.212
Export list for 172.20.103.212:
/data *[root@eus_filmora_video01:/file02_nfs]# showmount -e 172.20.103.211
Export list for 172.20.103.211:
/data *# 添加开机自动挂载
[root@eus_filmora_video01:~]# cat /etc/rc.local 
#!/bin/bashmount -t nfs 172.20.103.212:/data /file01_nfs -o proto=tcp -o nolock
mount -t nfs 172.20.103.211:/data /file02_nfs -o proto=tcp -o nolock报错:
mount: wrong fs type, bad option, bad superblock on 10.25.177.47:/opt/data07,missing codepage or helper program, or other error(for several filesystems (e.g. nfs, cifs) you mightneed a /sbin/mount.<type> helper program)In some cases useful info is found in syslog - trydmesg | tail or so.解决:
yum install -y nfs-utils报错:
mount.nfs: access denied by server while mounting 10.25.177.47:/data/voice 
解决:
nfs服务端vim /etc/sysconfig/nfs
修改如下:
RPCNFSDARGS="-N 2 -N 3"----->启用
# Turn off v4 protocol support
RPCNFSDARGS="-N 4"     ---->启用
重启生效
systemctl restart nfs

 

转载于:https://www.cnblogs.com/reblue520/p/9689587.html


http://lihuaxi.xjx100.cn/news/236998.html

相关文章

智能合约从入门到精通:智能合约的应用场景

链客&#xff0c;专为开发者而生&#xff0c;有问必答&#xff01; 此文章来自区块链技术社区&#xff0c;未经允许拒绝转载。 智能合约的出现&#xff0c;给区块链带来了巨大的变化&#xff0c;区块链也从一种账本形式&#xff0c;变成了下一代计算网络的雏形。这一章我们将…

java静态代理与动态代理

2019独角兽企业重金招聘Python工程师标准>>> 代理模式是java常见的设计模式。其目的是为其他对象提供一个代理以控制对某个真实对象的访问。通过代理类这一中间层&#xff0c;有效控制对真实委托类的对象的直接访问&#xff0c;同时可以实现自定义的控制策略。 根据…

区块链智能合约是什么?有哪些应用和优缺点?

链客&#xff0c;专为开发者而生&#xff0c;有问必答&#xff01; 此文章来自区块链技术社区&#xff0c;未经允许拒绝转载。 关注区块链就会经常听到“智能合约”的术语&#xff0c;那么如何理解“智能合约”&#xff1f;它从何而来&#xff0c;它如何运作&#xff1f;它有什…

main函数参数

参考&#xff1a;Where Does GCC Look to Find its Header Files? 命令行参数 VS 程序参数 ./a.out 1 2 3 4 5 6 1 2 3 4 5 6是程序参数&#xff0c;是传给a.out这个程序处理的&#xff0c;main里面的argv来接收 ./a.out 1 2 3 4 5 6完整的这一串才是命令行参数 代码演示 如下…

Rokid webhook 指南 手把手教你做个懒人

若琪用户 Amadeus 在社区里分享过很多视频。当你进门10秒后还未关闭房门&#xff0c;若琪会一直报警提醒&#xff1b;当你走进门后将门反锁的那一刻&#xff0c;若琪会为你播报今天的天气、为你播放设定的轻音乐。 看到这些视频中对传感器、智能情景的熟练运用&#xff0c;你很…

区块链中的“智能合约”有何应用?

链客&#xff0c;专为开发者而生&#xff0c;有问必答&#xff01; 此文章来自区块链技术社区&#xff0c;未经允许拒绝转载。 如刺金般闪耀的区块链时代&#xff0c;投资者的热潮还将持续升温&#xff0c;与此同时金融的大佬已经开始注意到区块链应用落地场景的实现&#xff…

软工实践原型设计——PaperRepositories

软工实践原型设计——PaperRepositories 写在前面 本次作业链接队友&#xff08;031602237吴杰婷&#xff09;博客链接pdf文件地址原型设计地址(加载有点慢...)结对成员:031602237吴杰婷 & 031602636许舒玲原型设计工具:Axure RP 8PSP表格 PSP3.1Personal Software Process…

Xshell5中常用linux服务器命令集合

简易版&#xff1a;http://www.zhimengzhe.com/linux/84546.html 详细版&#xff1a;http://www.cnblogs.com/peida/tag/%E6%AF%8F%E6%97%A5%E4%B8%80linux%E5%91%BD%E4%BB%A4/default.html?page4转载于:https://www.cnblogs.com/keye/p/8982440.html