[Spread-users] Trouble Talking Between 2 Servers

Cameron Stuart cstuart at wdg.com.au
Tue Jan 2 23:45:24 EST 2007


Hi,

I was wondering if someone can run their eye over my config's, as I can't seem to get 2 spread servers talking to each other.

The machine host names are spread1 (10.1.1.213) and spread2 (10.1.1.214)
They are freebsd 6.1 running spread 3.17.3 as a freebsd port installation.
I have the port 4803 open on both boxes, and have tested that using separate perl scripts that communicate over sockets.

I am using 2 perl scripts to test communications, and they seem to work ok when run on a single server, but not across 2 servers.

These are the config files:
----------------------->
### Spread 1 Config File
Spread_Segment  10.1.1.255:4803 {
        spread2         10.1.1.214
        spread1         10.1.1.213
}
DebugFlags = { ALL !DATA_LINK }
EventLogFile = /var/log/spread.log
EventTimeStamp = "[%a %d %b %Y %H:%M:%S]"
SocketPortReuse = ON
AllowedAuthMethods = "NULL"
----------------------->
### Spread 2 Config File
Spread_Segment  10.1.1.255:4803 {
        spread2         10.1.1.214
        spread1         10.1.1.213
}
DebugFlags = { ALL !DATA_LINK }
EventLogFile = /var/log/spread.log
EventTimeStamp = "[%a %d %b %Y %H:%M:%S]"
SocketPortReuse = ON
AllowedAuthMethods = "NULL"
----------------------->

Here is the script that waits for a message to come in:
----------------------->
#!/usr/bin/perl
use strict;
use Spread;
use Data::Dumper;
# Connect
my($mbox, $private_group) = Spread::connect( {
        spread_name => '4803 at 10.1.1.214',
        private_name => 'cam' . $$, 
} );

my $sperrno;
my $sperrorno;

 # Join groups
my(@group_to_join) = ( 'Group1');
my(@joined_groups) = grep( Spread::join($mbox, $_), @group_to_join );

my($messsize) = Spread::poll($mbox);
if(defined($messsize)) { print "Next message: $messsize bytes\n"; }
else { print "Spread::poll $sperrno\n"; }

while (1) {
  # Receive messages (see spread's man pages for more description)
  my($service_type, $sender, $groups, $mess_type, $endian, $message) =
        Spread::receive($mbox);
  next if ($message =~ m/^\@/);
  #next if ($message =~ m/^?/);
  print "Got Message: [" . $message . "] From: [" . $sender . "]\n";
}

# Disconnect
if(Spread::disconnect($mbox)) { print "Successful disconnect\n"; }
  else { print "Spread::disconnect -- $sperrorno\n"; }

exit;
----------------------->

And here is the script that sends a message:
----------------------->
#!/usr/bin/perl
use strict;
use Spread;
use Data::Dumper;
# Connect
my($mbox, $private_group) = Spread::connect( {
        spread_name => '4803',
        private_name => 'cam' . $$,
} );

 # Join groups
my(@group_to_join) = ( 'Group1');
my(@joined_groups) = grep( Spread::join($mbox, $_), @group_to_join );
  
# Multicast to group(s)
Spread::multicast($mbox, FIFO_MESS, 'Group1', 0, "Message sent by cam");

print "Message sent\n";

exit;
----------------------->

Can anybody help?
Cheers,
Cam
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.spread.org/pipermail/spread-users/attachments/20070103/912f0760/attachment.html 


More information about the Spread-users mailing list