Warning: Undefined array key "cperpage" in /www/wwwroot/www.now163.com/wp-content/themes/typology/functions.php on line 230

Warning: Undefined variable $output in /www/wwwroot/www.now163.com/wp-content/themes/typology/functions.php on line 300

Warning: Undefined variable $fixed_tags in /www/wwwroot/www.now163.com/wp-content/themes/typology/functions.php on line 301

Warning: Undefined variable $isshowdots in /www/wwwroot/www.now163.com/wp-content/themes/typology/functions.php on line 302

Warning: Undefined variable $tag_aditional in /www/wwwroot/www.now163.com/wp-content/themes/typology/functions.php on line 305

Warning: Undefined variable $tag_aditional in /www/wwwroot/www.now163.com/wp-content/themes/typology/functions.php on line 308

Warning: Undefined variable $tag_aditional in /www/wwwroot/www.now163.com/wp-content/themes/typology/functions.php on line 311

Warning: Undefined variable $post in /www/wwwroot/www.now163.com/wp-content/themes/typology/functions.php on line 320

Warning: Attempt to read property "ID" on null in /www/wwwroot/www.now163.com/wp-content/themes/typology/functions.php on line 320

Warning: Undefined variable $post in /www/wwwroot/www.now163.com/wp-content/themes/typology/functions.php on line 320

Warning: Attempt to read property "ID" on null in /www/wwwroot/www.now163.com/wp-content/themes/typology/functions.php on line 320

Warning: Undefined variable $more_text_link in /www/wwwroot/www.now163.com/wp-content/themes/typology/functions.php on line 320
AIX平台NFS配置 – 理想社会

AIX平台NFS配置

A

AIX平台NFS配置

1、 Nfs依赖的2种协议,包括表示层的XDR(external data representation 外部数据表示)和会话层的RPC(remote procedure call远程过程调用)。

2、 nfs守候进程和它们的子系统

22840716_1334289320UUFS

 

 

 

 

3、2和3成对完成预读后写功能。保证系统响应速度。

4、4和5配对,完成文件锁定功能。

5、服务端需要1,6,2,4,5进程;客户端需要1,3,4,5进程。

1、服务器端配置

PS:在配置NFS的第一步是在服务器和客户机两端启动NFS服务。

NFS服务由/etc/rc.nfs命令文件来启动的。

1、启动NFS服务 mknfs 或者 smit mknfs

# mknfs -N

# mknfs -N

0513-029 The portmap Subsystem is already active.

Multiple instances are not supported.

………………………………………..

Multiple instances are not supported.

Completed NFS services.

可以通过lssrc -g nfs查看nfs的服务情况

#lssrc -g nfs

Subsystem Group PID Status

biod nfs 712706 active

nfsd nfs 635260 active

rpc.mountd nfs 462932 active

rpc.lockd nfs 639418 active

rpc.statd nfs 757914 active

nfsrgyd nfs inoperative

gssd nfs inoperative

当然,以上也可以通过startsrc -g nfs与stopsrc -g nfs启动与停止该服务组子系统。

2、关闭NFS服务。rmnfs 或者smit rmnfs

3、手工创建配置文件 touch /etc/exports

# more /etc/exports
/tmp -ro,access=192.168.1.156

如果没有/etc/exports文件,使用mknfs命令之后,nfsd、rpc.mounted进程不会启动,需要添加一个空的此文件。(试验已经证明)

另外如果单独使用startssrc命令来单独启动这2个进程,例如: startsrc -s rpc.mounted.也可以启动所有nfs进程,如,startsrc -g nfs.

4、服务器端配置过程

a.运行mknfs

b.导出nfs目录,smitty mknf***p

[TOP] [Entry Fields]

* Pathname of directory to export [] /

Anonymous UID [-2]

Public filesystem? no +

* Export directory now, system restart or both both +

Pathname of alternate exports file []

Allow access by NFS versions [] +

External name of directory (NFS V4 access only) []

* Security method [sys,krb5p,krb5i,krb5,> +

* Mode to export directory read-write +

Hostname list. If exported read-mostly []

Hosts & netgroups allowed client access []

Hosts allowed root access []

Security method [] +

Mode to export directory [] +

[MORE…18]

主要需要指定导出的目录就可以了。而这个工具最终会修改/etc/exports文件。这个文件的内容很简单的。当然是否导出也只是这个文件在控制。

#cat /etc/exports

/home/nfs -sec=sys:krb5p:krb5i:krb5:dh:none,rw

/home/kk -sec=sys;krb5p:krb5i:krb5:dh:none,ro

可以看出来这个nfs已经导出2个目录,留意这个所谓导出的目录,需要是本地本地系统存在的目录,意思是这些目录里面的内容可以供客户端读取(写入),否则会出现导出失败的报错。如果手工修改这个文件,执行

# exportfs

/home/nfs -sec=sys:krb5p:krb5i:krb5:dh:none,rw

/home/kk -sec=sys:krb5p:krb5i:krb5:dh:none,ro

来重新读取这个文件,使之生效即可。

验证导出是否成功

#showmount -e server_name

该命令在NFS Server/client上都可以正常运行,列出了由 server_name 当前导出的所有文件系统。

2、客户端配置

1、nfs的client配置比较简单,需要portmap服务正常即可。

#lssrc -s portmap

Subsystem Group PID Status

portmap portmap 225506 active

2、在aix上mount nfs服务器上的目录

在aix上mount 名外一台aix上提供的nfs目录,可以使用smit nfs或者使用命令方式进行mount ,使用smit nfs的Add a File System for Mounting进行加载一个nfs目录,按照页面要进行填写即可;

使用命令方式:mount -n nfshostname 远程nfs导出目录 本地要挂载的目录(如果目录不存在需要先进行建立)

例:mount 192.168.112.85 /qadai /nnt

在客户端验证NFS结果

df -k

demo:/testnfs 65536 63432 4% 19 1% /demotest

使用rpcinfo 命令,用户可以从本地工作站上确认任意nfs服务器上的rpc服务的状态;

只需要执行rpcinfo -p hostname即可;

使用nfsstat命令可以统计nfs服务性能;

 

AIX的/etc/filesystems详解

etc/filesystems概述

文件系统是一个完整的目录结构,包括根目录和他底下任何文件的目录,并且文件系统被限定在单一的逻辑卷上。在AIX上所有的文件系统信息/etc/filesystems 集中化的管理文件系统属性而存在,他的作用和Linux上的/etc/fstab文件类似。

/etc/filesystems的常见属性
属性 描述
account     使用dodisk命令统计文件系统的详细信息,属性值为true或false。具体参加dodisk命令的用法
check         使用fsck命令来确认文件系统是否需要检查,为true时进行检查,false时不检查。当check的属性值为数字时,表示将文件系统划分为不同的组,同组中的文件系统被依次进行fsck检查,不同的组在分隔的平行进程中被检查
dev             系统的对应物理设备的块设备名称
mount       使用mount命令来决定是否挂载文件系统,不同的属性值如下

automatic 当系统启动时自动挂载文件系统,和ture值不同的是automatic值不会在执行mount all命令时自动挂载,在umount all命令时自动卸载,默认情况下/,/usr,/tmp和/var文件系统都是automatic值

false:默认情况下不进行挂载

readonly:以readonly方式挂载文件系统

removeable:以removeable方式挂载文件系统,当有文件在removeable上打开的时候,removeable文件系统和一般挂载的文件系统没有区别。然而,当在该文件系统上没有文件被打开,没有进程访问,所有的磁盘缓存都写入介质的时候,操作系统将无法访问该文件系统,类似于弹出的U盘,光盘设备。

true 文件系统可以被mount all命令挂载,可以被umount all命令卸载。mount all命令在系统初始化的时候会自动挂载这类文件系统。
log 记录文件系统的修改信息,该属性值必须为逻辑卷的绝对路径,且只对jfs和jfs2文件系统有效
vol mkfs命令在创建文件系统时所使用的标签,最长为6个字符串
type 用于批量的挂载相同属性的文件系统,当执行mount -t “Typ属性”时,所有和“Typ属性”一致且未挂载的文件系统的文件系统都将被挂载
vfs 文件系统类型

About the author

Add comment

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据

By now163

Your sidebar area is currently empty. Hurry up and add some widgets.