Operating System - Linux
1819761 Members
3040 Online
109606 Solutions
New Discussion юеВ

NFS localhost - OK : NFS hostname - Fails

 
Michael Steele_2
Honored Contributor

NFS localhost - OK : NFS hostname - Fails

What up?

I'm playing around with red hat 5.3 and getting familiar with NFS. I've successfully exported /home using localhost:

# cat /etc/exports
/home localhost(ro,sync)

# cat /etc/fstab
localhost:/home /mnt/home nfs defaults 0 0

...But with hostname of PC, failure:

# cat /etc/exports
/home dhcp-64-102-35-224(ro,sync)

# cat /etc/fstab
dhcp-64-102-35-224:/home /mnt/home nfs defaults 0 0

showmount -e
mount clntudp_create: RPC: Port mapper failure - RPC: Unable to receive

exportfs -av
exporting dhcp-64-102-35-224.xxxxx.com:/home

mount: mount to NFS server 'dhcp-64-102-35-224' failed: System Error: Connection refused.

Procedure I've followed after changes include stopping iptables, and restarting first portmap and then nfs services.

So I've seen this error on the internet but there is nothing definite except, it's a firewall issue. Well, iptables is off and all the ports are up.

[root@dhcp-64-102-35-224 log]# rpcinfo -p
program vers proto port
100000 2 tcp 111 portmapper
100000 2 udp 111 portmapper
100024 1 udp 780 status
100024 1 tcp 783 status
100007 2 udp 669 ypbind
100007 1 udp 669 ypbind
100007 2 tcp 672 ypbind
100007 1 tcp 672 ypbind
100021 1 udp 65189 nlockmgr
100021 3 udp 65189 nlockmgr
100021 4 udp 65189 nlockmgr
100021 1 tcp 19353 nlockmgr
100021 3 tcp 19353 nlockmgr
100021 4 tcp 19353 nlockmgr
100011 1 udp 748 rquotad
100011 2 udp 748 rquotad
100011 1 tcp 763 rquotad
100011 2 tcp 763 rquotad
100003 2 udp 2049 nfs
100003 3 udp 2049 nfs
100003 4 udp 2049 nfs
100003 2 tcp 2049 nfs
100003 3 tcp 2049 nfs
100003 4 tcp 2049 nfs
100005 1 udp 759 mountd
100005 1 tcp 771 mountd
100005 2 udp 759 mountd
100005 2 tcp 771 mountd
100005 3 udp 759 mountd
100005 3 tcp 771 mountd

a) How to make hostname work when you are exporting and mounting from same box? ( Works with localhost ).

Support Fatherhood - Stop Family Law
7 REPLIES 7
Steven Schweda
Honored Contributor

Re: NFS localhost - OK : NFS hostname - Fails

And we _know_ that dhcp-64-102-35-224 is the
right name for this system?

I've seen NFS implementations which required
a fully qualified name, but if that were the
problem here, then I'd expect different error
messages.

> [...] Connection refused.

Normally means that no one is listening at
the desired port.

netstat -an

> showmount -e
> mount clntudp_create: RPC: Port mapper failure - RPC: Unable to receive

Sure looks like a port mapper communication
problem.
Michael Steele_2
Honored Contributor

Re: NFS localhost - OK : NFS hostname - Fails

Hi

So you've used your hostname to export and mount from the same box successfully?

And I've seen the portmap solutions on the internet. So far that's a dry well.
Support Fatherhood - Stop Family Law
Ivan Ferreira
Honored Contributor

Re: NFS localhost - OK : NFS hostname - Fails

Sometimes the problem is related to having the hostname added to localhost in the /etc/hosts file. Ensure that the /etc/hosts file has correct the entries.

Wrong:

127.0.0.1 dhcp-64-102-35-224.xxxxx.com localhost.localdomain localhost

Correct

127.0.0.1 localhost.localdomain localhost
x.x.x.x dhcp-64-102-35-224.xxxxx.com

Also, check that "hostname" match the host name in /etc/hosts.

├В┬┐What is the SELinux status?
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Michael Steele_2
Honored Contributor

Re: NFS localhost - OK : NFS hostname - Fails

disabled

# getenforce
Disabled
Support Fatherhood - Stop Family Law
Steven E. Protter
Exalted Contributor

Re: NFS localhost - OK : NFS hostname - Fails

Shalom,

A host implementation such as Ivan' recommends should work.

You might also find setting the variable DHCP_HOSTNAME to the name set by the domain for this IP address resolves some of the issues.

Is it possible to see /etc/hosts and run some tests with dig or nslookup to insure lookup is working as expected?

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Steven Schweda
Honored Contributor

Re: NFS localhost - OK : NFS hostname - Fails

> So you've used your hostname to export and
> mount from the same box successfully?

No, never. I use NFS to let two _different_
systems share files. I've never felt the
need to configure NFS to give one system
access to files which it already had access
to directly. Call me unimaginative.
Michael Steele_2
Honored Contributor

Re: NFS localhost - OK : NFS hostname - Fails

Hi

This is a sand box environment only, something for me to do while my new environment is built.

The purpose of NFS's to myself was just to become more familiar / or refresh myself with the Red Hat environment.

The test being, if I can NFS to myself then I can NFS to another box. In this case, I can NFS to localhost but not to myself and have to believe that its DHCP related.

I play with it again someday and report anything interesting.

Once again, thank you all for being there, in real time, when someone has a question.
Support Fatherhood - Stop Family Law