Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
    
Are the webservers stopped prior to making the change? I can see an issue with shared open files that could lead to a problem like this. –  mdpc Jul 20 '11 at 21:33
    
No they are both running. –  mhost Jul 20 '11 at 23:07
    
Does the issue go away on its own after 60 seconds? –  sciurus Jul 22 '11 at 2:36
    
Actually, it happened again today, but to the other web server (web2). I took it out of the rotation in haproxy because I had limited access today. I just went to try and fix it and I noticed it resolved itself automatically exactly 10 hours and 50 minutes later. –  mhost Jul 22 '11 at 7:26
    
Actually, I just realized it fixed itself when my log rotation script ran and restarted apache. –  mhost Jul 22 '11 at 7:33

1 Answer 1

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.