Skip to content

Commit 74fa553

Browse files
2 parents 7cdf27e + a54de49 commit 74fa553

File tree

4 files changed

+31
-1
lines changed

4 files changed

+31
-1
lines changed

Java/AppEngine/src/main/java/myapp/DemoServlet.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import javax.servlet.http.HttpServletResponse;
88

99
public class DemoServlet extends HttpServlet {
10+
private static final long serialVersionUID = -5314714338427418156L;
1011
int MAX_NUMBER = 1000000;
1112

1213
@Override
Binary file not shown.

Setup/Java-ComputeEngine.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,28 @@
11
# Java Compute Engine
22

3+
Begin by going to cloud.google.com and setting up a project. To set up the instance, begin by clicking compute engine and then "create instance".
4+
5+
When setting up the instance, you will choose which region and zone your instance will run in.
6+
Here, we chose northamerica-northeast1 region and zone a.
7+
38
![](https://github.com/ColeChronowski/GCP-RNG/raw/master/Setup/images/Screenshot%20(19).png "screenshot")
49

510
![](https://github.com/ColeChronowski/GCP-RNG/raw/master/Setup/images/Screenshot%20(20).png "screenshot")
611

12+
Next, the machine type should be chosen. For our instance, we wanted to use the least expensive type, f1-micro.
13+
714
![](https://github.com/ColeChronowski/GCP-RNG/raw/master/Setup/images/Screenshot%20(21).png "screenshot")
815

16+
Next, the boot disk needs to be configured to run Ubuntu 18.04 LTS.
17+
918
![](https://github.com/ColeChronowski/GCP-RNG/raw/master/Setup/images/Screenshot%20(22).png "screenshot")
1019

20+
Check both boxes to allow HTTP and HTTPS traffic.
21+
1122
![](https://github.com/ColeChronowski/GCP-RNG/raw/master/Setup/images/Screenshot%20(23).png "screenshot")
1223

13-
![](https://github.com/ColeChronowski/GCP-RNG/raw/master/Setup/images/Screenshot%20(24).png "screenshot")
24+
The next step is to change the firewall rules of the instance. Here, the system needs to allow tcp:80,8080.
25+
To do this, click on the name of the firewall rule and edit the protocol to allow tcp:80,8080.
1426

1527
![](https://github.com/ColeChronowski/GCP-RNG/raw/master/Setup/images/Screenshot%20(29).png "screenshot")
1628

@@ -22,14 +34,31 @@
2234

2335
![](https://github.com/ColeChronowski/GCP-RNG/raw/master/Setup/images/Screenshot%20(33).png "screenshot")
2436

37+
Next, open the instance in another window. Here, a few commands need to be run to ensure your instance is up-to-date.
38+
39+
![](https://github.com/ColeChronowski/GCP-RNG/raw/master/Setup/images/Screenshot%20(24).png "screenshot")
40+
2541
![](https://github.com/ColeChronowski/GCP-RNG/raw/master/Setup/images/Screenshot%20(25).png "screenshot")
2642

2743
![](https://github.com/ColeChronowski/GCP-RNG/raw/master/Setup/images/Screenshot%20(26).png "screenshot")
2844

45+
Next, clone the github repository that contains the random number generated code for Java Compute Engine.
46+
2947
![](https://github.com/ColeChronowski/GCP-RNG/raw/master/Setup/images/Screenshot%20(27).png "screenshot")
3048

49+
Change the directory of your instance to the one that contains the Java Compute Engine code.
50+
3151
![](https://github.com/ColeChronowski/GCP-RNG/raw/master/Setup/images/Screenshot%20(28).png "screenshot")
3252

53+
Run the code by typing
54+
java -jar start.jar
55+
56+
![](https://github.com/ColeChronowski/GCP-RNG/raw/master/Setup/images/Screenshot%20(36).png "screenshot")
57+
58+
In your browser, copy the external IP address of your instance and go to http://[external IP]:8080/rng.
59+
3360
![](https://github.com/ColeChronowski/GCP-RNG/raw/master/Setup/images/Screenshot%20(35).png "screenshot")
3461

62+
This address shows the output of the random number generator.
63+
3564
![](https://github.com/ColeChronowski/GCP-RNG/raw/master/Setup/images/Screenshot%20(34).png "screenshot")

Setup/images/Screenshot (36).png

189 KB
Loading

0 commit comments

Comments
 (0)