9 |
use Data::Dump qw(dump); |
use Data::Dump qw(dump); |
10 |
use Storable qw(); |
use Storable qw(); |
11 |
use File::Slurp; |
use File::Slurp; |
12 |
|
use Cwd qw(abs_path); |
13 |
|
|
14 |
my @cloud = qw(localhost tab.lan llin.lan); |
my @cloud = qw(localhost tab.lan llin.lan); |
15 |
|
|
21 |
|
|
22 |
my $listen_port = 4444; |
my $listen_port = 4444; |
23 |
|
|
24 |
my $node_path = $0; |
my $node_path = abs_path $0; |
25 |
$node_path =~ s{server.pl}{client.pl}; |
$node_path =~ s{server.pl}{client.pl}; |
26 |
|
|
27 |
my $lsn = IO::Socket::INET->new(Listen => 1, LocalPort => $listen_port, Reuse => 1) or die $!; |
my $lsn = IO::Socket::INET->new(Listen => 1, LocalPort => $listen_port, Reuse => 1) or die $!; |
55 |
my $node_port = 4000; |
my $node_port = 4000; |
56 |
|
|
57 |
foreach my $host ( @cloud ) { |
foreach my $host ( @cloud ) { |
58 |
system "echo $node_path | cpio --create --dereference | ssh -T -F $cloud_path.ssh $host cpio --extract --make-directories --unconditional --verbose"; |
system "find /srv/Sack/ | cpio --create --dereference | ssh -T -F $cloud_path.ssh $host cpio --extract --make-directories --unconditional"; |
59 |
fork_node( $node_port++, $host ); |
fork_node( $node_port++, $host ); |
60 |
} |
} |
61 |
|
|