comparison scripts/paxos.pl @ 182:1559aa74dc74

add paxos sh
author akahori
date Sat, 02 Feb 2019 15:18:17 +0900
parents
children
comparison
equal deleted inserted replaced
181:33b4966d4d24 182:1559aa74dc74
1 #!usr/bin/perl
2
3 my $debug = 0;
4
5 sub mysystem {
6 my ($cmd) = @_;
7 if ($debug) {
8 print $cmd ,"\n";
9 } else {
10 system $cmd;
11 }
12 }
13
14 ruby ./paxos.rb $1 $2 $3 > Log/paxos.dot
15
16 my $nodes = $ENV{'PBS_NODEFILE'};
17 my $java11binPath = "/mnt/data/christie_workspace/jdk-11.0.1/bin/";
18 my $christieDir = "/mnt/data/christie_workspace/";
19 my $dotFile = "${christieDir}scripts/Log/paxos.dot"
20 my $logFile = "${christieDir}Log/";
21 my $logNum = "0000";
22
23 open my $fd,"<",$nodes or die("can't read file $nodes $!");
24
25 while (<$fd>) {
26 chop ;
27 unshift(@nodes,$_);
28 }
29
30 mysystem("ssh $nodes[0] \"cd $christieDir;${java11binPath}java -cp Christie.jar christie.topology.manager.StartTopologyManager --localPort 10000 --confFile ${dotFile} > $logFile$logNum\" &");
31
32 $logNum++;
33 for my $i (1..($#nodes)) {
34 print "nodes[i]: $i $nodes[$i]\n";
35 mysystem("ssh $nodes[$i] \"cd $christieDir;${java11binPath}java -cp Christie.jar christie.test.topology.paxos.StartPaxosNode --localPort 10000 --managerHost $nodes[0] --managerPort 10000 > $logFile$logNum\" &");
36 $logNum++;
37 }