AIX 上使用NFS实现AIX之间文件网络共享

简介:

AIX 上使用NFS实现AIX之间文件网络共享

tomroom.cublog.cn  作者:tomroom 环保男  环境AIX 6.1

       AIX 可以使用NFS在AIX之间实现类似window共享文件夹功能,在多台aix上安装系统补丁的时候比较有用只需要在一台服务器上FTP上传,其他AIX通过共享访问(注意不要多台一起访问可能会由于I/O繁忙带有问题)

注意:

1.         多台AIX之前在同一个局域网子网段中没有问题,若跨网段请确认网络开通NFS端口

2.         下面我都是用root账户登录操作

3.         要在A,B两端的/etc/hosts里互相都加上彼此的IP地址和hostname(若不用DNS都通过hosts表里name

 

l  第一部分在AIX服务器A 上面建里要通过NFS共享的目录比如:根目录下/test目录

# ls -l

total 8

-rw-r-----    1 root     system          543 Jul 24 03:39 temp.txt

/test目录中存放一个文件temp.txt内容如下,后面可以用这个验证共享成功

# cat temp.txt

SBMJOB CMD(STROBJCVN LIB(*ALLUSR))

       LOG(4 0 *SECLVL)            

 

 

 

S6564E5B

定时任务 DAILY4  HOLD

 

磁带机中磁带 卷标 001176推入磁带机TAP07

 

Opt  Queue Manager                                     Port 

     HHT                                                1417

                                                            

 

MQM HHT

 

 

Opt  Queue Manager                                     Port   

     HHT                                                1414  

     HHT                                                1417  

A机器上运行# smit nfs

先选择Network File System (NFS)

 

                                                              NFS

 

Move cursor to desired item and press Enter.

 

  Configure TCP/IP (If Not Already Configured)

  Network File System (NFS)

  Network Information Service (NIS)

  Configure Secure NFS & NIS

 

再选择Add a Directory to Exports List(先Change / Show Attributes of an Exported Directory确认目录之前没有被Exported

                                                  Network File System (NFS)

 

Move cursor to desired item and press Enter.

 

  Configure NFS on This System

  Add a Directory to Exports List

  Change / Show Attributes of an Exported Directory

  Remove a Directory from Exports List

  Add a File System for Mounting

  Change / Show Attributes of an NFS File System

  Remove an NFS File System

  Flush NFS V4 Translation Cache

  Add NFSv4 File System FSID Options

  Change / Show NFSv4 File System FSID Options

  Reset NFSv4 File System FSID Options

下面画面中* Pathname of directory to export 输入导出目录路径和名称    [/test]

 

                                               Add a Directory to Exports List

 

Type or select values in entry fields.

Press Enter AFTER making all desired changes.

 

[TOP]                                                   [Entry Fields]

* Pathname of directory to export                    [/test]                  

  Anonymous UID                                      [-2]

  Public filesystem?                                  no                       

* Export directory now, system restart or both        both                    

       []                       

 

 

运行完成之后如下提示

                                                       COMMAND STATUS

 

Command: running       stdout: yes           stderr: no

 

Before command completion, additional instructions may appear below.

 

0513-059 The nfsd Subsystem has been started. Subsystem PID is 5505044.

0513-059 The rpc.mountd Subsystem has been started. Subsystem PID is 7077952.

 

l  第二部分在另外一台服务器B上

运行smitty nfs选择Network File System (NFS)

                                                             NFS

 

Move cursor to desired item and press Enter.

 

  Configure TCP/IP (If Not Already Configured)

  Network File System (NFS)

  Network Information Service (NIS)

  Configure Secure NFS & NIS

B机器上选择Add a File System for Mounting

                                                  Network File System (NFS)

 

Move cursor to desired item and press Enter.

 

  Configure NFS on This System

  Add a Directory to Exports List

  Change / Show Attributes of an Exported Directory

  Remove a Directory from Exports List

  Add a File System for Mounting

  Change / Show Attributes of an NFS File System

  Remove an NFS File System

  Flush NFS V4 Translation Cache

  Add NFSv4 File System FSID Options

  Change / Show NFSv4 File System FSID Options

  Reset NFSv4 File System FSID Options

Pathname of mount point 填B机上mount点

Pathname of remote directory填A机上路径

Host where remote directory resides填A机主机名(在A机器上运行hostname获得)

                                               Add a File System for Mounting

 

Type or select values in entry fields.

Press Enter AFTER making all desired changes.

 

[TOP]                                                   [Entry Fields]

* Pathname of mount point                           [/tmp/test/]                  

* Pathname of remote directory                       [/test]

* Host where remote directory resides                [svr05427]

  Mount type name                                    []

* Security method                                    [sys]                         

* Mount now, add entry to /etc/filesystems or both?   now                           

* /etc/filesystems entry will mount the directory     no                           

   on system restart.

 

 

注意: 要在A,B两端的/etc/hosts里互相都加上彼此的IP地址和hostname

若提示not in hosts database 需要修改B机器上/etc/hosts文件增加A服务器的IP地址和hostname

 

                                                       COMMAND STATUS

 

Command: failed        stdout: yes           stderr: no

 

Before command completion, additional instructions may appear below.

 

mount: 1831-009 svr05427 not in hosts database

mount: 1831- 008 giving up on:

svr05427:/test

A route to the remote host is not available.

 

若有如下错误可能网络上没有开放NFS需要的端口

                                                       COMMAND STATUS

 

Command: failed        stdout: yes           stderr: no

 

Before command completion, additional instructions may appear below.

 

nfsmnthelp: 1831-019 svr05427: System call error number -1.

 

mount: 1831- 008 giving up on:

svr05427:/test

System call error number -1.

成功之后可以在B机上smit mount中 List all能看到mount上文件验证,并访问共享文件内容确认可以访问


l  卸载

取消在B机上可以用smit umount指定上面B机上mount点可以在B机器上取消该NFS

在A机器上卸载,smit nfs选择Remove a Directory from Exports List 输入路径

 

                                                  Network File System (NFS)

 

Move cursor to desired item and press Enter.

 

  Configure NFS on This System

  Add a Directory to Exports List                      

  Change / Show Attributes of an Exported Directory  

  Remove a Directory from Exports List

  Add a File System for Mounting

  Change / Show Attributes of an NFS File System     

  Remove an NFS File System

  Flush NFS V4 Translation Cache

  Add NFSv4 File System FSID Options

  Change / Show NFSv4 File System FSID Options

  Reset NFSv4 File System FSID Options

 

l  权限

我两台机器都是用root账户访问权限两台都是如下一样

# ls -l

total 8

-rw-r-----    1 root     system          543 Jul 24 06:10 temp.txt

l  附录

l  windows端也能访问AIX NFS ,也有建议window访问aix文件系统SAMBA比NFS好

比如:http://www.chinaunix.net/jh/9/503373.html

经常碰到一些客户需要将PC Server的数据定期放到运行AIX操作系统的6000小机的 磁带机上备份,做了几个这样的案例 Share一下:) 
1、下载SFU 
     SFU是微软的一款与UNIX系统进行文件共享的软件 100M左右。可在Windows端模拟NFS Server 或者使 Windows成为NFS Client。他是免费的。下载时需要.net帐户(msn的就行) 
2、在Windows端安装SFU软件。选择作为NFS Client。安装时间较长。安装结束后可以在网上邻居中发现新增加了一个叫做SFU的 工作组(好像是这个名字) 
在上面点击右键选择添加,将6000的IP地址加入。在6000一端开启NFS服务。刷新后就可看到该服务器了 
3、身分认证:在两端建立相同帐号,需要在6000上编辑/etc/hosts文件。将需要访问NFS路径的服务器IP地址与机器名称加入。这是 在PC Server端就可以访问该共享文件夹了。在上面还可进行权限的管理 有兴趣的自己实验吧。 




本文转自 Mr_sheng 51CTO博客,原文链接:http://blog.51cto.com/sf1314/1971766
相关文章
|
30天前
|
Linux Shell Windows
通过Linux挂载Windows端NFS服务实现板端Linux传输文件到PC
通过Linux挂载Windows端NFS服务实现板端Linux传输文件到PC
|
26天前
|
Shell Linux C语言
【Shell 命令集合 网络通讯 】Linux 查看系统中的UUCP日志文件 uulog命令 使用指南
【Shell 命令集合 网络通讯 】Linux 查看系统中的UUCP日志文件 uulog命令 使用指南
29 0
|
26天前
|
网络协议 Shell Linux
【Shell 命令集合 网络通讯 】Linux 提供SMB共享 smbd命令 使用指南
【Shell 命令集合 网络通讯 】Linux 提供SMB共享 smbd命令 使用指南
38 0
|
3月前
|
存储 监控 网络协议
【Linux】文件服务NFS(Network File System)
【Linux】文件服务NFS(Network File System)
34 0
|
2天前
|
网络协议 Linux
基于 NFS 的文件共享实现
基于 NFS 的文件共享实现
|
6天前
|
存储 安全 测试技术
网络奇谭:虚拟机中的共享、桥接与Host-Only模式解析
网络奇谭:虚拟机中的共享、桥接与Host-Only模式解析
14 0
|
1月前
|
存储 测试技术 C++
P2P网络下分布式文件共享场景的测试
P2P网络下分布式文件共享场景的测试
28 6
|
2月前
|
编解码 文件存储 计算机视觉
YOLOv5改进 | 2023Neck篇 | BiFPN双向特征金字塔网络(附yaml文件+代码)
YOLOv5改进 | 2023Neck篇 | BiFPN双向特征金字塔网络(附yaml文件+代码)
182 0
|
3月前
|
网络协议 Linux 网络安全
Linux服务器配置指南:网络、用户管理、共享服务及DNS配置详解
Linux服务器配置指南:网络、用户管理、共享服务及DNS配置详解
144 0
|
3月前
|
网络协议 安全 Shell
【网络协议】网络文件共享协议SMB(Server Message Block)
SMB协议允许在局域网(LAN)或广域网(WAN)上共享文件、打印机和其他资源。
46 0