AIX NFS Server and NFS Client

Hi 2 ALL,

try to run NFS Server in AIX 7.1 :

  1. Step by step on NFS Server node
mkdir /tmp/test
chgrp staff /tmp/test
chmod 775 /tmp/test

-- create export directory (fs)

mknfsexp -d /tmp/test -t ro

exportfs -va
show mount -e
[
root@host1]:/# exportfs -av
exports: 1831-187 re-exported /tmp/test
mknfs -B
  1. Step by step on NFS Client ( AIX 7.1 node)
[root@host2]:/# ping host1
PING host1: (10.4.12.111): 56 data bytes
64 bytes from 10.4.12.111: icmp_seq=0 ttl=255 time=0 ms
64 bytes from 10.4.12.111: icmp_seq=1 ttl=255 time=0 ms
64 bytes from 10.4.12.111: icmp_seq=2 ttl=255 time=0 ms
64 bytes from 10.4.12.111: icmp_seq=3 ttl=255 time=0 ms

--- host1 ping statistics ---
4 packets transmitted, 4 packets received, 0% packet loss
round-trip min/avg/max = 0/0/0 ms[root@host2]:/# showmount -e host1
export list for host1:
/tmp/test (everyone)

[root@host2]:/# mount host1:tmp/test /test
nfsmnthelp: 1831-019 host1: System call error number -1.

mount: 1831-008 giving up on:
host1:/tmp/test
System call error number -1.

i try and with ip address but some error

where wrong ?

sorry for my mistake english

---------- Post updated at 05:44 PM ---------- Previous update was at 04:11 PM ----------

Ops, i fix my problem

add cross ip and hostname between nodes /etc/hosts

Thanks for the update.

Your fix was to be my recommendation.

a) AIX, to boot (quickly) needs to have two IP addresses in /etc/hosts
127.0.0.1 loopback localhost
A.B.C.D hostname

b) for the AIX NFS server both server and client must agree on the name and IP address used by the client to connect (mount) on the server. There was a time that when the client used a shortname and the server a "longname" the mount would fail (I hope the shortname check is enough these days)

In short, when NFS mounts are taking a long time verify the IP address used to connect (especially from multi-homed clients). Back in telnet days I would just telnet in to the server and then use the who command to see what IP address/hostname the server reported. If it was an IP address I knew I needed to do something because the hostname - short or long - was not resolving. It might also be what I considered the alias - again, if not the name the client was announcing - the AIX server will refuse the mount.

Hope this helps your understanding!

On AIX can you not enable search in /etc/resolv.conf (or equivalent), declaring search files first and then add any short names plus the IP's you need to get something to connect?

This approach works fine on Solaris, for example.

###NFS Server AIX 7.1 (HOWTO)

host1 = 10.4.12.11 [NFS Server]

host2 = 10.4.12.12 [NFS Client]
  1. ON NFS Server

--setting up /etc/hosts each node

-host1

echo "10.4.12.12 host2" >> /etc/hosts

-host2

echo "10.4.12.11 host1" >> /etc/hosts

-- create need a files/settings (node1 NFS Server)

mkdir /tmp/test
vi /etc/exports

-- add line :

/tmp/test -sec=sys:krb5p:krb5i:krb5:dh,rw,root=10.4.12.12

-- re-export directory with commands :

exportfs -va
show mount -e

--Start the NFS subsystems

mknfs -B

or

-- optional start nfs

# lssrc -g nfs
# startsrc -s nfsd
# startsrc -g nfs
# startsrc -s mountd
  1. ON NFS Client
mkdir /mnt/test

showmount -e 10.4.12.11

mount 10.4.12.11:/tmp/test /mnt/test

The two common ways for modfying search order is to use either the environment NSORDER or an entry in /etc/netsvc.conf.

e.g., I usually set
hosts=local4,bind4

in /etc/netsvc.conf

the 4 specifies to only check for IP4 addresses resolution, a 6 would search only IP6, and no number searches IP4 then IP6 space.

If nothing is set, the default is equivalent to
hosts=bind,nis,local (or maybe it is nis,bind,local I have not even tried to use nis in 15 to 20 years - so I forget ;-| )

Having bind first - when a default is defined, but network is not working - can slow a reboot a long time. Setting the timeout and retry in either /etc/environment via environment variables, or in /etc/resolv.conf - can shorten this drastically.

While I have never used it myself - I expect that any bind/dns setting you can use on a POSIX system, such as Solaris - should work in the same way on AIX.