This time i would like to explain how to setup a failover solution for critical non-stop sites.

Suppose you have a website, its applications and static content is replicated in two machines, lets call them “content1″ and “content2″.  These machines export their content directory with NFS:

To do this you edit the /etc/dfs/sharetab file and enter something like this (in both servers of course).

share -F nfs -o ro /export/content

Now, in the webserver root you want to mount this directories, and to have a failover solution you can setup two or more servers, if one in unavailable, the next one is used.

You may use in the webserver a command like this:

mount -F nfs -o ro solaris1:/export/content,solaris2:/export/content /usr/local/htdocs/mysite

Or for a definitive solution that survives a reboot, edit the /etc/vfstab file and enter:

solaris1,solaris2:/export/content - /usr/local/htdocs/mysite nfs - no -o ro