Windows通过nfs挂载Linux目录并创建oracle逻辑目录(网络错误 - 122、- 53、 - 5等问题的解决)

NFS配置以及管理

NFS服务所需软件及主要配置文件:
安装NFS服务,需要安装两个软件,分别是:
• RPC主程序:rpcbind
NFS 其实可以被视为一个 RPC 服务,因为启动任何一个 RPC 服务之前,我们都需要做好 port 的对应 (mapping) 的工作才行,这个工作其实就是『 rpcbind 』这个服务所负责的!也就是说, 在启动任何一个 RPC 服务之前,我们都需要启动 rpcbind 才行! (在 CentOS 5.x 以前这个软件称为 portmap,在 CentOS 6.x 之后才称为 rpcbind 的!)。
• NFS主程序:nfs-utils
就是提供 rpc.nfsd 及 rpc.mountd 这两个 NFS daemons 与其他相关 documents 与说明文件、执行文件等的软件!这个就是 NFS 服务所需要的主要软件。


NFS服务配置(windows->linux)

检查服务程序是否存在:

[root@localhost /]# rpm -q nfs-utils rpcbind
nfs-utils-1.3.0-0.el7.x86_64
rpcbind-0.2.0-23.el7.x86_64
[root@localhost /]# ^C

正确启动顺序应该是先启动rpcbind,再启动NFS:

[root@localhost /]# service rpcbind start
Redirecting to /bin/systemctl start  rpcbind.service
[root@localhost /]# service nfs start
Redirecting to /bin/systemctl start  nfs.service
[root@localhost /]#

查看nfs运行状态:

[root@localhost /]# service nfs status
Redirecting to /bin/systemctl status  nfs.service
nfs-server.service - NFS Server
   Loaded: loaded (/usr/lib/systemd/system/nfs-server.service; disabled)
   Active: active (exited) since 五 2020-09-18 09:49:36 CST; 45s ago
  Process: 10692 ExecStopPost=/usr/sbin/exportfs -f (code=exited, status=0/SUCCESS)
  Process: 10691 ExecStop=/usr/sbin/rpc.nfsd 0 (code=exited, status=0/SUCCESS)
  Process: 10704 ExecStart=/usr/sbin/rpc.nfsd $RPCNFSDARGS $RPCNFSDCOUNT (code=exited, status=0/SUCCESS)
  Process: 10700 ExecStartPre=/usr/sbin/exportfs -r (code=exited, status=0/SUCCESS)
  Process: 10697 ExecStartPre=/usr/libexec/nfs-utils/scripts/nfs-server.preconfig (code=exited, status=0/SUCCESS)
 Main PID: 10704 (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/nfs-server.service

918 09:49:36 localhost.localdomain systemd[1]: Starting NFS Server...
918 09:49:36 localhost.localdomain systemd[1]: Started NFS Server.

设置开机自启以及防火墙放行:

[root@localhost init.d]# systemctl enable rpcbind
[root@localhost init.d]# systemctl start nfs-server nfs-secure-server
Job for nfs-secure-server.service failed. See 'systemctl status nfs-secure-server.service' and 'journalctl -xn' for details.
[root@localhost init.d]# systemctl enable nfs-server nfs-secure-server
ln -s '/usr/lib/systemd/system/nfs-server.service' '/etc/systemd/system/nfs.target.wants/nfs-server.service'
ln -s '/usr/lib/systemd/system/nfs-secure-server.service' '/etc/systemd/system/nfs.target.wants/nfs-secure-server.service'
[root@localhost init.d]# firewall-cmd --permanent --add-service=nfs
success
[root@localhost init.d]# firewall-cmd  --reload
success
[root@localhost init.d]#

配置共享文件目录,编辑配置文件:

[root@localhost /]# mkdir /public
[root@localhost etc]# vi /etc/exports
	/public 192.168.221.0/24(rw)
[root@localhost etc]# systemctl reload nfs

在这里插入图片描述

windows的NFS客户端配置:

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
windows2008x64上操作:【添加角色:文件服务器,勾选网络文件系统服务】才有mount命令!

在这里插入图片描述
在这里插入图片描述
(以上网络错误 – 53 为防火墙问题)

挂载命令:month \192.168.221.138\public x:
取消挂载命令:umount x:

关闭防火墙命令:systemctl stop firewalld
NFS目录赋权:chmod -R 777 /public

oracle创建nfs共享的逻辑目录:

SQL> create or replace directory dmp as '\\10.62.232.246\oradata\dmp';

目录已创建。

SQL> grant read,write on directory dmp to SYSTEM;

附:网络错误 - 122、- 5:

需要注意hosts.allow、hosts.deny文件限制情况:
在这里插入图片描述
1、为 /etc/hosts.allow文件添加"ALL: ALL"
2、为 /etc/hosts.deny文件注释行:“ALL:ALL”

  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

DBA狗剩儿

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值