I have 2 web servers that share files over NFS. When we update our php code to a new version, our update script moves the existing directory and copies in the new version in its place. We make the change directly on the NFS server.
Every time we do this, web1 stops working. It gives HTTP 500 errors and the PHP log says it couldn't include fileX.php. However, when if I manually go to the directory in the command line, I can see the file and its the updated version.
In order to fix it, I need to remount the NFS directory and restart apache. Any idea why this is happening? It only happens on web1, not web2 and they both have identical configurations. And, like I said, I can see the files on web1 in the command-line, only apache doesn't see them.
Here are the mount options (/proc/mounts):
192.168.1.1:/var/exports/www/ /var/www nfs rw,sync,noatime,vers=3,rsize=524288,wsize=524288,namlen=255,hard,proto=tcp,port=65535,timeo=600,retrans=2,sec=sys,local_lock=none,addr=192.168.1.1 0 0
Thanks.
Do an strace on apache.
If its just two servers. Why use NFS. Look at DRBD (Active / Active). I use it and it works like a bomb (You will need OCFS2).
HTH