|
1 | 1 | # Java Compute Engine
|
2 | 2 |
|
| 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 | + |
3 | 8 | .png "screenshot")
|
4 | 9 |
|
5 | 10 | .png "screenshot")
|
6 | 11 |
|
| 12 | +Next, the machine type should be chosen. For our instance, we wanted to use the least expensive type, f1-micro. |
| 13 | + |
7 | 14 | .png "screenshot")
|
8 | 15 |
|
| 16 | +Next, the boot disk needs to be configured to run Ubuntu 18.04 LTS. |
| 17 | + |
9 | 18 | .png "screenshot")
|
10 | 19 |
|
| 20 | +Check both boxes to allow HTTP and HTTPS traffic. |
| 21 | + |
11 | 22 | .png "screenshot")
|
12 | 23 |
|
13 |
| -.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. |
14 | 26 |
|
15 | 27 | .png "screenshot")
|
16 | 28 |
|
|
22 | 34 |
|
23 | 35 | .png "screenshot")
|
24 | 36 |
|
| 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 | +.png "screenshot") |
| 40 | + |
25 | 41 | .png "screenshot")
|
26 | 42 |
|
27 | 43 | .png "screenshot")
|
28 | 44 |
|
| 45 | +Next, clone the github repository that contains the random number generated code for Java Compute Engine. |
| 46 | + |
29 | 47 | .png "screenshot")
|
30 | 48 |
|
| 49 | +Change the directory of your instance to the one that contains the Java Compute Engine code. |
| 50 | + |
31 | 51 | .png "screenshot")
|
32 | 52 |
|
| 53 | +Run the code by typing |
| 54 | + java -jar start.jar |
| 55 | + |
| 56 | +.png "screenshot") |
| 57 | + |
| 58 | +In your browser, copy the external IP address of your instance and go to http://[external IP]:8080/rng. |
| 59 | + |
33 | 60 | .png "screenshot")
|
34 | 61 |
|
| 62 | +This address shows the output of the random number generator. |
| 63 | + |
35 | 64 | .png "screenshot")
|
0 commit comments