CS6650 Lab 1

CS6650 Building Scalable Distributed Systems

CS6650 Lab 1

This lab is designed to guide you to create an EC2 instance on AWS running AWS Linux, install Tomcat, and deploy your webserver built using Go-Gin framework onto it.

AWS Linux 2 is the version to use. You may choose another Linux instance but will be on your own. AWS Linux 2023 should be ok but we haven’t tested it.

Prerequisite

Completed the two tutorials in Lab 0.

https://go.dev/doc/tutorial/getting-started

https://go.dev/doc/tutorial/web-service-gin

Note for second tutorial. change the address of your server in main function to remove the localhost reference as below.

Original : router.Run("localhost:8080")
Change to: router.Run(":8080")

This is to enable the server to run on EC2.

Lab 1 - Getting started with AWS EC2 Instance

Aims: Cross Compile Your Go-Gin code

Aims: Set Up Your EC2 Instance and Tomcat

Install tomcat 9 (not 10 - it implements a breaking API change)

Follow these instruction for the first 5 steps

Once you get this far, life looks pretty good. First mission accomplished! In 3 weeks you’ll be able to do all this in your sleep.

Some notes based on first experience with the Learner Lab:

Aims: Upload your binary executable file to EC2 and Run it.

image

Once you get this far, life looks pretty good. First mission accomplished! In 3 weeks you’ll be able to do all this in your sleep.

Notes

Some notes based on first experience with the Learner Lab:

Here is some troubleshooting guide if something is not working.

Notes on AWS Academy Learner Labs and Charging

We will be using AWS Academy Learner Labs for this course.

AWS Academy Learner Lab - Foundation Services provides a long-running sandbox environment for ad hoc exploration of AWS services. Within this class, you will have access to a restricted set of AWS services. Not all AWS documentation walk-through or sample labs that operate in an AWS Production account will work in the sandbox environment. You will retain access to the AWS resources set up in this environment for the duration of this course. You are limited in budget ($100), so you should exercise caution to prevent charges that will deplete your budget too quickly. If you exceed your budget, you will lose access to your environment and lose all of your work.

Each session lasts for 4 hours by default, although you can extend a session to run longer by pressing the start button to reset your session timer. At the end of each session, any resources you created will persist. However, AWS automatically shuts EC2 instances down. Other resources, such as RDS instances, keep running. Keep in mind that AWS does not stop some AWS features, so they can still incur charges between sessions. For example, an Elastic Load Balancer or a NAT. You may wish to delete those types of resources and recreate them as needed to test your work during a session. You will have access to this environment for the duration of the class they enrolled you in. When the class ends, your access to the learner lab will also end.

When you stop/start your EC2 instance, the public IP address will change. The extract below is from stackoverlow.

Actually, When you stop/start your instance, the IP address will change. If you reboot the instance, it will keep the same IP addresses. Unfortunately, it is not possible for us to reassign the address to your instance as that address would have been released back into the pool used by other EC2 instances.

If you want to avoid this issue in the future, depending on your needs:

And from here

You are not billed for stopped EC2 instances.

Back to Course Home Page