AIX 上使用NFS实现AIX之间文件网络共享
admin
2023-03-15 16:41:29
0

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

       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端就可以访问该共享文件夹了。在上面还可进行权限的管理 有兴趣的自己实验吧。 


相关内容

热门资讯

ICC逮捕令致内塔尼亚胡出行受... 【环球网报道】据以色列《新消息报》网站26日报道,由于国际刑事法院(ICC)2024年就以色列在巴勒...
“罗永浩怒斥电视机厂商”戳中了... 7月25日晚,罗永浩发文怒斥当下电视机的产品设计。据都市快报报道,罗永浩表示,他为家中老人换了两次电...
各地各部门坚持人民至上筑牢防汛... 新华社北京7月25日电 题:风雨同舟映初心——各地各部门坚持人民至上筑牢防汛抗洪坚实堤坝新华社记者当...
法院回应LV起诉地产开发商 7月26日,厦门市湖里区人民法院发布情况通报,网传案情“路易威登公司起诉地产开发商,因楼盘外立面四叶...
携程的问题不仅在于垄断,更在于... 国内平台科技企业一般都是通过向B端收费、抽佣获利,尽量给消费者创造一个比较清爽的使用环境。携程算是最...
海信电视用遥控器关闭后打不开 原因可能是遥控器的电池没有装好或者是没电了,需要重新安装一下电池或者更换新的电池试一试;原因可能是电...
电视机突然没电源打不开了 有可能是电视开关的电源线断了;可能是电视在使用时短路;可能是电源插头插座松动;可能是电视内部零件接触...
电热水器下面那个小龙头漏水是怎... 电热水器下面那个小龙头漏水是怎么回事?1、因为安全阀发生了故障或者是已经被损坏了,就会有漏水的现象;...
回答下电脑桌面一片空白怎么恢复 电脑桌面上如果是一片空白,那说明您的电脑图标被隐藏了,想要恢复就要按照如下的三个步骤去操作才行。 第...
澳总理要找特朗普“理论”关税:... 当地时间7月26日,澳大利亚总理阿尔巴尼斯表示,他将直接向美国总统特朗普提出抗议,反对美国新近宣布的...