[Dxspider-support] Two different Spider nodes on the same Linux PC

Dirk Koopman djk at tobit.co.uk
Mon Jan 8 21:22:23 CET 2007

On Mon, 2007-01-08 at 19:43 +0100, Luigi - IK5ZUK wrote:
> Hello, and happy new year !
> I would like to run two different spider nodes on the same linux box, with
> different call, different inet port for incoming connections and of course
> with different config files. I've tryed to install two different spider on
> the same linux pc, but when I try to start up the second node, it hangs due
> to the lock file (spider/local/cluster.lck).
> Please Dirk, or someone that have experienced the same thing, could tell me
> more about this problem ??
> May be possible to run them ??

It is not hard, but it can be fiddly.

1. copy the entire spider to another directory. 

Then in the new directory (which, for the sake of argument I shall
call /home/gb7tst).

2. alter local/DXVars.pm so that $clusterport = 27755 (or some other
number other than 27754).

3. alter local/Listeners.pm to change the listening port from 7300 (or
whatever you are using).

4. start up the node with the new root in the environment, eg:

 DXCLUSTER_ROOT=/home/gb7tst /spider/perl/cluster.pl 

5. If you use the console.pl program you will need to alter the
environment for that as well (as well grepdbg and watchdbg if you use
those). Creating some suitably named shell scripts such as 'newdx'
containing something like (don't forget to 'chmod +x xxxx'):-

exec DXSPIDER_ROOT=/home/gb7tst /home/gb7tst/perl/console.pl $@

would help here (and similar for grepdbg and watchdbg).

In /etc/inittab you will need something like:

ts:2345:respawn:su -c "DXSPIDER_ROOT=/home/gb7tst perl /home/gb7tst/perl/cluster.pl > /dev/null 2>&1" spider

If you have more than one external IP address then there are other
possibilities of using the same port number (eg: 7300) but having one IP
address go to one node and the another IP address to the new one.  But
this requires setting up Listeners.pm correctly for both nodes (and
stops you using localhost for one of them).

If you want to run the same code base always then:-

In /home/gb7tst:

1. rm -rf perl cmd
2. ln -s /spider/perl .
3. ln -s /spider/cmd .

That will at least keep the code the same. If prefixes and bands change
then these will need to changed in each tree.

Also don't forget that you will almost certainly want a
different /home/gb7tst/local_cmd/crontab for each node :-)

Have fun

Dirk G1TLH

More information about the Dxspider-support mailing list