
NFS配置
发布日期:2021-05-09 05:08:51
浏览次数:11
分类:博客文章
本文共 4020 字,大约阅读时间需要 13 分钟。
由于权限问题,开发人员没有访问生产环境was相关日志权限,因此他们是通过生产环境nfs挂载至测试环境,开发人员能够访问的环境进行查询。
NFS1.配置NFS LOG挂载目录源端操作[root@yc01v yc1]# cat /etc/redhat-release Red Hat Enterprise Linux Server release 6.5 (Santiago)[root@yc01v yc1]# cat /etc/exports /opt/tmp 10.8.5.158(rw,no_root_squash)/opt/IBM/WebSphere/yc1/logs 10.8.4.102(rw,no_root_squash)/opt/IBM/WebSphere/logs 10.8.4.102(ro)编辑NFS文件配置vi /etc/exports/opt/IBM/WebSphere/yc1/logs/yc1 10.8.0.56(ro,no_root_squash)重启nfs服务[root@yc01v yc1]# /etc/init.d/rpcbind restart[root@yc01v yc1]# /etc/init.d/nfs restart服务器端nfs服务是否开机自启动进行验证[root@yc01v yc1]# chkconfig --list nfsnfs 0:off 1:off 2:off 3:off 4:off 5:off 6:offchkconfig --level 345 nfs on服务器nfs开启自启动已配置验证,之前restart 是否影响其他客户端nfs服务,再次重启nfs服务,可以发现已配置的客户端,还是能正常读取,识别文件客户端操作安装nfs安装包Red Hat Enterprise Linux Server release 5.4 (Tikanga)[root@qaswebdb ~]# rpm -qa | grep nfsnfs-utils-lib-1.0.8-7.6.el5nfs-utils-1.0.9-42.el5[root@qaswebdb ~]# rpm -qa | grep portmapportmap-4.0-65.2.2.1[root@qaswebdb ~]# service portmap restart[root@qaswebdb ~]# service nfs restart需要挂载目录,创建# mkdir /logs/yc01测试挂载[root@qaswebdb ~]# showmount -e 10.8.5.157Export list for 10.8.5.157:/opt/IBM/WebSphere/yc1/logs/yc1 10.8.0.56# mount -t nfs 10.8.5.157:/opt/IBM/WebSphere/yc1/logs/yc1 /logs/yc01# df -h10.8.5.157:/opt/IBM/WebSphere/yc1/logs/yc1 36G 11G 23G 32% /logs [root@qaswebdb logs]# tail -200f SystemOut.log[root@qaswebdb logs]# umount /logs/yc01umount: /logs/yc01: device is busyumount: /logs/yc01: device is busy# fuser -km /logs/yc01# umount /logs/yc01# vi /etc/rc.local mount -t nfs 10.8.5.157:/opt/IBM/WebSphere/yc1/logs/yc1 /logs/yc01再次执行[root@qaswebdb logs]# touch a.logtouch: cannot touch `a.log': Permission denied无写权限 [root@qaswebdb logs]# tail -1f SystemOut.log[9/17/19 10:41:00:057 HKT] 0000007e Syst有读权限2.客户端,重启主机后,NFS未正常挂载客户端-bash-3.2# df -hFilesystem Size Used Avail Use% Mounted on10.8.2.100:/opt/IBM/WebSphere/Emp2/logs/emp2 18G 14G 2.8G 84% /emp_log/emp2-bash-3.2# cat /etc/rc.local #!/bin/sh## This script will be executed *after* all the other init scripts.# You can put your own initialization stuff in here if you don't# want to do the full Sys V style init stuff.touch /var/lock/subsys/localmount 10.8.2.100:/opt/IBM/HTTPServer/logs /hrlogmount 10.8.4.148:/opt/nginx/logs /ekplog/mount 10.8.4.10:/ytnfsa/accesslog /opt/accesslogmount 10.8.2.100:/opt/IBM/WebSphere/Emp2/logs/emp2 /emp_log/emp2mount 10.8.3.183:/opt/IBM/WebSphere/Emp1/logs/emp1 /emp_log/emp1确实发现 /emp_log/emp1 文件夹丢失手工MOUNT报错-bash-3.2# mount 10.8.3.183:/opt/IBM/WebSphere/Emp1/logs/emp1 /emp_log/emp1mount: mount to NFS server '10.8.3.183' failed: RPC Error: Program not registered.登陆NFS服务端[root@emp1 ~]# cat /etc/exports /opt/IBM/WebSphere/Emp1/logs/emp1 10.8.3.102(ro)[root@emp1 emp1]# ping 10.8.3.102PING 10.8.3.102 (10.8.3.102) 56(84) bytes of data.64 bytes from 10.8.3.102: icmp_seq=1 ttl=64 time=0.436 ms[root@emp1 emp1]# service portmap statusportmap (pid 3735) is running...[root@emp1 emp1]# service nfs statusrpc.mountd is stoppednfsd is stoppedrpc.rquotad is stopped[root@emp1 emp1]# service nfs startStarting NFS services: [ OK ]Starting NFS quotas: [ OK ]Starting NFS daemon: [ OK ]Starting NFS mountd: [ OK ][root@emp1 emp1]# chkconfig --list nfsnfs 0:off 1:off 2:off 3:off 4:off 5:off 6:off[root@emp1 emp1]# [root@emp1 emp1]# [root@emp1 emp1]# [root@emp1 emp1]# chkconfig --level 345 nfs on[root@emp1 emp1]# chkconfig --list nfs nfs 0:off 1:off 2:off 3:on 4:on 5:on 6:off客户端-bash-3.2# mount 10.8.3.183:/opt/IBM/WebSphere/Emp1/logs/emp1 /emp_log/emp1-bash-3.2# df -hFilesystem Size Used Avail Use% Mounted on10.8.3.183:/opt/IBM/WebSphere/Emp1/logs/emp1 21G 16G 3.5G 83% /emp_log/emp1
发表评论
最新留言
做的很好,不错不错
[***.243.131.199]2025年04月11日 20时39分04秒
关于作者

喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!
推荐文章
MapReduce实验
2021-05-09
[apue] getopt 可能重排参数
2021-05-09
移动互联网恶意软件命名及分类
2021-05-09
PySide图形界面开发(一)
2021-05-09
vue3 template refs dom的引用、组件的引用、获取子组件的值
2021-05-09
882. Reachable Nodes In Subdivided Graph
2021-05-09
375. Guess Number Higher or Lower II
2021-05-09
764. Largest Plus Sign
2021-05-09
等和的分隔子集(DP)
2021-05-09
L - Large Division (大数, 同余)
2021-05-09
39. Combination Sum
2021-05-09
41. First Missing Positive
2021-05-09
80. Remove Duplicates from Sorted Array II
2021-05-09
83. Remove Duplicates from Sorted List
2021-05-09
410. Split Array Largest Sum
2021-05-09
程序员视角:鹿晗公布恋情是如何把微博搞炸的?
2021-05-09
系统编程-进程间通信-无名管道
2021-05-09
为什么我觉得需要熟悉vim使用,难道仅仅是为了耍酷?
2021-05-09
一个支持高网络吞吐量、基于机器性能评分的TCP负载均衡器gobalan
2021-05-09