Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting up NFS client and server on the same machine.

Status
Not open for further replies.

cibee

Programmer
Dec 15, 2004
38
US
Hi all,
I'm running a FC2 machine and I have set up a NFS server to share a directory called "shared" over the network.
Is it advisable to access that directory("shared") thru NFS, if I make the same machine also to be a NFS client. what are the alternatives?
Please let me know if I'm not clear. Any lead is appreciated.

TIA,
Cibee
 
You could, but why not simply access the directory locally and avoid the overhead of NFS?
 
Hi,
Yes, I could access it locally but, I would have to change the code that actually does read/write into that directory for this machine alone.

How would I go about making this the client for the same machine?

I tried adding this on /etc/fstab -
servername:/home/shared /usr/local/apache/shared nfs rw,hard,nosuid 0 0

but I got an error saying permission denied when I tried to access it. This problem is just from this client. Other clients are fine.

 
Assuming your scripts are all pointing to /home/shared as the mount point, you could make /home/shared on that client a link to its /usr/local/apache/shared path. Otherwise, I'm not sure why you have a permissions error connecting through the share. Have you tried localhost: instead of servername:?
 
I tried localhost but its not helping, I still get the same error.
Do I need to have to have a directory called /usr/local/apache/shared before I mount the NFS?

Thanks for ur help.
Cibee
 
Ah, yes, you do need that directory to be created and empty if you want to mount the share to it. I'm not sure how I was looking at that earlier.
 
Nope, Still get the same error. wonder why?
 
I don't think you can mount an NFS share as root for the server machine, so you may need to try it as something other than root or use set up NFS with no_root_squash .. I have to agree with lgarner though. If you can change your scripts to point to the mount instead of an nfs share, you can use a symbolic link on the local computer and fstab mounts for everyone else without changing the code.
 
Hi,
You said:
Assuming your scripts are all pointing to /home/shared as the mount point, you could make /home/shared on that client a link to its /usr/local/apache/shared path.

meaning: I have the all the data in /home/shared and when I say ls /usr/local/apache/shared, its gonna show tht content of /home/shared. Is that right?

Just a clarification.

Thanks,
Cibee.

 
How would I go about creating the symbolic link?
 
ln -sd /real/directory /fake/link/directory
Don't create the /fake/link/directory first as ln will create it for you.
 
Thanks for all your help.
I created the symlink and it partially worked.(One of the modules used in the script to access does not support symlink File::path), I'm looking into fixing that. If I can't, I'll probably try to set up NFS with no_root_squash.

Thanks for your help again,
Cibee
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top