[Spread-users] Re: Spread localhost setup

Yair Amir yairamir at cs.jhu.edu
Tue Nov 20 08:24:30 EST 2007

Dear Ilya,

Spread is not designed to work like this because there is no reason to
have multiple daemons in the same spread network residing on the same
host - it is just suboptimal.

However, this is how Spread was initially developed (on one pc :)
So - you *may* be able to build a daemon that can do this for you if you
change one line of the code and set it up as follows:

- You have to put each daemon in its own segment
- You have to give each daemon a different IP address (which will have
   no consequence in terms of communication). This is so that
   each of the daemons has its own ID.
- It does not matter what multicast address you give to each segment
   because, since there is only one daemon per segment, it will not
   be used. I usually give in such cases.
- It is important that the port of each segment will be different
   and with enough "port space" between them.
   4803, 4813, 4823, 4833 would definitely work.
- When running the daemon, you will need to start it with ./spread -n daemon_name
   where daemon_name is the name of the instance in the configuration file
   you want this process to play.

Ok, so now for the important part - the single line you need to change
in the code: It is in the file data_link.c

Look for the define for HOME_PC and change the ip address there
to what will be computed as that computer ip address (I think you
could use the localhost address - probably what is there corresponds
to 192.168.x.y or something like that).

Currently, I think the line is:

	soc_addr.sin_addr.s_addr= htonl(-1073741814);
#endif /* ARCH_PC_HOME */

You can take the ifdef/endif out or just define it - but probably need to change
the number there to fit your host ip address.

If you build spmonitor as well, it will be able to monitor this "network"

There might be other complications that I cannot think of right now.
If you try this, tell us how it goes.


	:) Yair.

Ilya Sterin wrote:
> Ah, just realized that starting two daemons this way doesn't make
> sense, it doesn't form a group.  So I guess now I'm just back with the
> question if it's possible to have a multi-node setup on localhost.
> Ilya
> On Nov 19, 2007 4:33 PM, Ilya Sterin <sterini at gmail.com> wrote:
>> I'm sure this was probably covered before, but I can't seem to locate
>> this or search it (maybe I'm using wrong terminology for the search).
>> I'm developing a db replication app and for testing, need to be able
>> to test multiple spread nodes on localhost.  Can't seem to find any
>> docs on doing this.  I'm ok with either running two segments and/or
>> two daemons in a segment.
>> My current setup is that of two spread conf files, each running on
>> it's own port.  The hostname aliases are set up in /etc/hosts
>> # spread1.conf
>> Spread_Segment {
>>         spread1
>>         spread2
>> }
>> # spread2.conf
>> Spread_Segment {
>>         spread2
>>         spread1
>> }
>> I didn't get as far as testing the setup yet, wanted to get some input
>> on whether there is a problem with this setup and if it is, what's the
>> proposed setup/configuration if at all possible to achieve this.
>> Thanks.
>> Ilya Sterin
> _______________________________________________
> Spread-users mailing list
> Spread-users at lists.spread.org
> http://lists.spread.org/mailman/listinfo/spread-users

More information about the Spread-users mailing list