Browse Source

changed example for cloud computing

master
Sebastian Rieger 7 years ago
parent
commit
eee35ca74b
  1. BIN
      VerteilteSysteme-Examples/build/RMIEchoServer.jar
  2. BIN
      VerteilteSysteme-Examples/build/RMIMandelbrotCalculationsServer.jar
  3. BIN
      VerteilteSysteme-Examples/build/TCPPerfServer.jar
  4. BIN
      VerteilteSysteme-Examples/build/TCPServer.jar
  5. BIN
      VerteilteSysteme-Examples/build/TCPServerMulti.jar
  6. BIN
      VerteilteSysteme-Examples/build/TCPTimeCounterRESTServer.jar
  7. BIN
      VerteilteSysteme-Examples/build/TCPTimeCounterServer.jar
  8. BIN
      VerteilteSysteme-Examples/build/UDPServer.jar
  9. BIN
      VerteilteSysteme-Examples/build/UDPServerMulti.jar
  10. BIN
      VerteilteSysteme-Examples/build/UDPTimeCounterServer.jar
  11. 2
      VerteilteSysteme-Examples/src/verteiltesysteme/aws/TCPTimeCounterClient.java
  12. 9
      VerteilteSysteme-Examples/src/verteiltesysteme/aws/TCPTimeCounterRESTService.java
  13. 4
      VerteilteSysteme-Examples/src/verteiltesysteme/aws/TCPTimeCounterServer.java
  14. 4
      VerteilteSysteme-Examples/src/verteiltesysteme/aws/tcptimecounterrest-test.html

BIN
VerteilteSysteme-Examples/build/RMIEchoServer.jar

BIN
VerteilteSysteme-Examples/build/RMIMandelbrotCalculationsServer.jar

BIN
VerteilteSysteme-Examples/build/TCPPerfServer.jar

BIN
VerteilteSysteme-Examples/build/TCPServer.jar

BIN
VerteilteSysteme-Examples/build/TCPServerMulti.jar

BIN
VerteilteSysteme-Examples/build/TCPTimeCounterRESTServer.jar

BIN
VerteilteSysteme-Examples/build/TCPTimeCounterServer.jar

BIN
VerteilteSysteme-Examples/build/UDPServer.jar

BIN
VerteilteSysteme-Examples/build/UDPServerMulti.jar

BIN
VerteilteSysteme-Examples/build/UDPTimeCounterServer.jar

2
VerteilteSysteme-Examples/src/verteiltesysteme/aws/TCPTimeCounterClient.java

@ -28,7 +28,7 @@ class TCPTimeCounterClient {
}
public static void main(String args[]) throws Exception {
String hostname = "VertSys-ELB1-b88aad9416b2929b.elb.eu-central-1.amazonaws.com";
String hostname = "cloudcomp-loadbalancer-1492513132.eu-central-1.elb.amazonaws.com";
//String hostname = "52.68.46.135";
//String hostname = "";
int tcpPort = 36038;

9
VerteilteSysteme-Examples/src/verteiltesysteme/aws/TCPTimeCounterRESTService.java

@ -14,7 +14,8 @@ public class TCPTimeCounterRESTService {
static final String bucketName = "vertsys-counter";
static final String bucketRegion = "eu-central-1";
static final String dnsNameELB = "VertSys-ELB1-b88aad9416b2929b.elb.eu-central-1.amazonaws.com";
static final String dnsNameELB = "cloudcomp-loadbalancer-1492513132.eu-central-1.elb.amazonaws.com";
static final int portELBTarget = 36042;
private Long getCounter() {
// Verbindung zu S3
@ -40,7 +41,7 @@ public class TCPTimeCounterRESTService {
public String getCounterHtml() {
return "<html><head><title>TCPTimeCounter REST Service</title>" +
"<meta http-equiv=\"refresh\" content=\"5\"/></head><body>" +
"<h2>Verteilte Systeme HS Fulda - TCPTimeCounter REST Service</h2>"+
"<h2>Cloud Computing HS Fulda - TCPTimeCounter REST Service</h2>"+
"<p><b>HTML-Output:</b> " + getCounter() + "</p></body></html>";
}
@ -68,10 +69,10 @@ public class TCPTimeCounterRESTService {
currentCounterValue = currentCounterValue + (new Long(input)).longValue();
setCounter(currentCounterValue);
return "<html><head><title>TCPTimeCounter REST Service</title></head></body>" +
"<h2>Verteilte Systeme HS Fulda - TCPTimeCounter REST Service</h2>" +
"<h2>Cloud Computing HS Fulda - TCPTimeCounter REST Service</h2>" +
"<p><b>HTML-Output:</b> counter increased by " +
input + " to " + currentCounterValue + "</p>" +
"<form method=POST action=\"http://" + dnsNameELB + ":36042/counter\">" +
"<form method=POST action=\"http://" + dnsNameELB + ":" + portELBTarget + webContextPath +"\">" +
"<input name=\"input\" value=\"\"></form></body></html>";
}

4
VerteilteSysteme-Examples/src/verteiltesysteme/aws/TCPTimeCounterServer.java

@ -76,14 +76,14 @@ class TCPTimeCounterServer {
counter = counter + number;
s3Client.putObject(bucketName, bucketRegion, new Long(counter).toString());
System.out.println("Anfrage von Client " + connectionSocket.getInetAddress() + ":" + connectionSocket.getPort() + " Zahl: " + number + " Zählerstand: " + counter);
System.out.println("Request from Client " + connectionSocket.getInetAddress() + ":" + connectionSocket.getPort() + " Zahl: " + number + " Zählerstand: " + counter);
// Try/Catch hinzugefügt, nachdem bei Einsatz Amazon AWS (Healthcheck des ELB) clientSentence null war
try {
// Antwort vom Server senden
String output = (Long.toString(counter) + " Zeit: " + System.currentTimeMillis() + " "
+ df.format(new Date(System.currentTimeMillis())) + " " + InetAddress.getLocalHost());
System.out.println("Antwort des Servers: " + output);
System.out.println("Reply from Server: " + output);
// Zeilenumbruch anfügen, da Client mit readLine auf komplette Zeile wartet
outToClient.writeBytes(output + '\n');
} catch (IOException ioe) {

4
VerteilteSysteme-Examples/src/verteiltesysteme/aws/tcptimecounterrest-test.html

@ -1,3 +1,3 @@
<form method=POST action="http://vertsys-elb1-b88aad9416b2929b.elb.eu-central-1.amazonaws.com:36042/counter">
Enter value to increment VertSys Demo Counter: <input name="input" value="">
<form method=POST action="http://cloudcomp-loadbalancer-1492513132.eu-central-1.elb.amazonaws.com:36042/counter">
Enter value to increment HS Fulda Cloud Computing Demo Counter: <input name="input" value="">
</form>
Loading…
Cancel
Save