NFS question when you have a subdirectory that you don't want to be shared?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers NFS question when you have a subdirectory that you don't want to be shared?
# 1  
Old 11-05-2015
Question NFS question when you have a subdirectory that you don't want to be shared?

I have a somewhat interesting problem, we've decided to load balance a java application and as such I'll be running our application on four physical machines as opposed to the single machine it's currently running on.

I've centralized the directory that the application requires (including the application itself), along with all of its subdirectories and necessary files/libraires/etc and shared/exported out via NFS to the four machines that will each run a copy of the application. I will be using Nginx to load balance through these 4 instances via round robin.

However, for logging purposes it's best NOT to share one log file amongst the four physical servers that will each be running an instance of the application (basically each one is running its own jvm), as it's most likely an invitation to log corruption at some point.

Unfortunately, the configuration files to tell each instance to write its own logfile (with a unique name) live in a subdirectory of the parent directory which I'm sharing via NFS. And the java application was written in a way such that the relative path of the configuration files is hard coded within the application itself, and thus I can't just move the configuration directory to a non-NFS local directory on each machine.

Is there anyway I can have a local only subdirectory (for each machine) inside of an NFS share? I'm assuming no, b/c of the fact that the NFS share itself does not exist on the local machines but rather is basically just a link to the central machine...But I thought I'd ask if there was a way this could be done.
# 2  
Old 11-06-2015
symlinks perhaps this will satisfy your needs.

Remove the subdirectory in question on NFS server and create a link with same name inside that mountpoint on each NFS client pointing to local directory.

Hope that helps
Regards
Peasant.
# 3  
Old 11-06-2015
Yes, a symbolic link on the nfs is the way to go.
A link tmp -> /tmp is quite common.
The same applies to a log directory; the destination directory with correct attributes must exist on each client.
Eventual log rotation/cleanup must run on each client - the best method is to let the application do it.
--
An alternative is to use automounter and a hierarchical mount. Probably more complicated and less preferrable.

Last edited by MadeInGermany; 11-06-2015 at 03:51 AM..
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Setting UID and GID for shared folder using NFS method in Linux system

Hi everyone, have a good day to you. I am trying to use NFS to share a folder between 2 linux systems. Let's say the server which is sharing the folder is server A and the client which need to access this shared folder is server B. In server B, i am having a Joe user which UID and GID is 500.... (1 Reply)
Discussion started by: michael_hoang
1 Replies

2. Solaris

ZFS shared with NFS makes directory cover filesystem

I'm having a strange issue that I'm unsure what to do with. I have a new Solaris home server that I want hard mount /home to all our servers. I've made each user's home directory a filesystem so that I can manage every user with a quota. In each one of my server vfstab files I have it set as: ... (4 Replies)
Discussion started by: mijohnst
4 Replies

3. Solaris

How to find the available shared directories at the NFS client machine?

I'm using nfs client machine. One of my colleague said that he shared the directories using nfs server ......... How can i know the nfs shared directories available to mount at my machine....?? Thanks in Advance.:b: (3 Replies)
Discussion started by: vamshigvk475
3 Replies

4. UNIX for Dummies Questions & Answers

ACL (POSIX and NFSv4) Support over NFS shared drives on different Unix platforms

Hello, I have a question regarding ACLs and their availability across different Unix platforms via NFS share. If I have an AIX/FreeBSD/Solaris/HP-UX client that has an nfs share from a different system mounted on it, will the ACLs on the nfs share be processed properly? My guess is that as... (2 Replies)
Discussion started by: bstring
2 Replies

5. HP-UX

NFS Client unable to access shared DIR's

I ve a client : <clientname> and a server: <servername> Both of them running: HPUX B.11.31 SERVER outputs: I ve shared a folder in <servername> called /test and the O/P for # exportfs - /test root=<clientname>,rw=<clientname>,ro "" # showmount -e export list for... (6 Replies)
Discussion started by: Amit Kulkarni
6 Replies

6. Solaris

Strange thing with solaris ls on nfs shared directory

I shared from linux server a dir with nfs3,solaris mount ok,and can tar files,but if i do ls or cp.. on mnt i have mount the nfs share root@solaris: mnt $ touch 2 root@solaris: mnt $ ls -lh ls: can't read ACL on .: Permission denied root@solaris: mnt $ ls 1.tar 2 root@solaris: mnt $ cp... (4 Replies)
Discussion started by: Linusolaradm1
4 Replies

7. Filesystems, Disks and Memory

can folder shared with NFS (/usr/)

hello i wanted to ask you i try to setting: pc server name: A pc user name: B pc user name: C server A is opensuse 11.2 with kde 4.3.5 and last kernel so i create NFS server, i think.. folder (/usr is all softwares and library) because server A can share to PC A. because all... (0 Replies)
Discussion started by: tunjin
0 Replies

8. AIX

changing values for nfs shared file system on aix

Hi, I want to change the values for shared file system in aix for that I have run the command smitty chnfsexp but I am not getting the all the values which I have seen while adding the file system while exporting example smitty chnfsexp but after selecting shared file system using F4... (3 Replies)
Discussion started by: manoj.solaris
3 Replies

9. UNIX for Dummies Questions & Answers

[Question]How to copy files to all subdirectory

I want to copy php.ini to all subdirectory. what command that should i run? (2 Replies)
Discussion started by: dzufauzan
2 Replies
Login or Register to Ask a Question