1 symbolic link to 2 different places?

I was wondering is it possible todo something like following:
A) Settings:-

  • 2 servers on the network
  • both can be reached via /net/SERVER1/datadir and /net/SERVER2/datadir
  • i'm running rsync to syncronize the data coming to server1 from whatever application

B) Wanted:
on other workstations say workstation1 i have /share which is a symlink to /net/SERVER1/datadir whats wanted that if i want to 'cd /net/SERVER1/datadir' and incase SERVER1 is down it automaticly jump to SERVER2

C) How:
i was thinking about timeouts if it hangs for 1 - 3 seconds it automaticly jums to SERVER2 or with if statement that does something like
ls /net/SERVER1/datadir > /dev/null
RETURN=$?
if [ $RETURN = 0 ]
then
cd /net/SERVER1/datadir
else
cd /net/SERVER2/datadir
fi

or if there is easier way todo it.

Thanks in advance.

Hi,

may be a little bit more work to do, but may be better is to you an additional IP Adress and DNS entry. For Server1 and/or Server2.

On Client side, you had never to change some thing. You only need one script on an third PC which is monitoring both servers, and when one server goes down, you will assign this special IP Adress with rsh or whatever on the other up and running system.

With this way, you can also implement a bigger high avaiblity environment.

Here the example:

Server1
eth0 : 192.168.0.1

Server2
eth0: 192.168.0.2

Normaly, Server1 is the main server for your filesystem, so you have an additonal IP Adress on it eth0:0 192.168.0.100 with the DNS name server.

All links are configured to server and not to server1 or server2.

IF the monitoring script detects the server1 is down or not avaible for what reason ever, it connects server2 with rsh or whatever and activated on server2 eth0:0 with the IP adress 192.168.0.100 and DNS name server.
with this way, for the clients nothing will change and everything goes well.

Regards
Alex

yeah i know htats good idea some sort of clustering, but what i wanted is i dont have to change IPs or anything like that