AWS Global Accelerator is a networking service that sends your user’s traffic through Amazon Web Service’s global network infrastructure, improving your internet user performance by up to 60%. When the internet is congested, Global Accelerator’s automatic routing optimizations will help keep your packet loss, jitter, and latency consistently low.

With Global Accelerator, you are provided two global static customer facing IPs to simplify traffic management. On the back end, add or remove your AWS application origins, such as Network Load Balancers, Application Load Balancers, Elastic IPs, and EC2 Instances, without making user facing changes. To mitigate endpoint failure, Global Accelerator automatically re-routes your traffic to your nearest healthy available endpoint.

Requirements

  • AWS Account

Architecture

For this lab, we going to create two instances, one in us-east-2 and one in eu-west-1, we going to install a web server, customize the pages to know what is the server we are get into and create a Global Accelerator and test it.

Hands-On

  1. In the AWS Management Console go to Ohio Region

2. Go to EC2

3. Go to instances

4. Click on Launch instances

5. Select Amazon Linux 2 AMI - 64 bits

6. Select t2.micro and click on Next

7. In the next window make sure you have the Auto-assign Public IP enabled, select 1 instance,  select a sub-network and leave everything else on defaults and click Next

8. In the Add Storage step you can leave it as default, and click on Next

9. In Add tags, leave as default and click Next

10. In the next window, create a new security group and give it a name, you will have as default the port 22 open to connect via ssh, click on Add Rule and add the port 80 for the nginx server (type HTTP), and click Review and Launch

11. Review the information and click on Launch

12. In the next window, select Create a new key pair, give it a name, download and click on Launch instances

13. Change the Region to London

14. In the AWS Management Console go to EC2

15. Go to instances

16. Click on Launch instances

17. Select Amazon Linux 2 AMI - 64 bits

18. Select t2.micro and click on Next

19. In the next window make sure you have the Auto-assign Public IP enabled, select 1 instance,  select a sub-network and leave everything else on defaults and click Next

20. In the Add Storage step you can leave it as default, and click on Next

21. In Add tags, leave as default and click Next

22. In the next window, create a new security group and give it a name, you will have as default the port 22 open to connect via ssh, click on Add Rule and add the port 80 for the nginx server (type HTTP), and click Review and Launch

23. Review the information and click on Launch

24. In the next window, select Create a new key pair, give it a name, download and click on Launch instances

Now that we have the instances running, let's customize the web pages to know what server is responding on the port 80.

25. Go to EC2, Instances

26. Select the instance and click on Connect

27. Select the tab EC2 Instance Connect and click on Connect, this will open a new window

28. This will open a new window with an emulated terminal in the instance, now install nginx

sudo su -
amazon-linux-extras install -y nginx1

29. Check the status of nginx

systemctl status nginx
● nginx.service - The nginx HTTP and reverse proxy server
   Loaded: loaded (/usr/lib/systemd/system/nginx.service; disabled; vendor preset: di
sabled)
   Active: inactive (dead)

Dec 14 21:04:22 ip-172-31-23-56.eu-west-2.compute.internal systemd[1]: Unit nginx...
Hint: Some lines were ellipsized, use -l to show in full.

30. Start the nginx server

systemctl start nginx

31. Open in a new browser tab the public IP to check is working (you can find the Public IP on the bottom of the terminal page)

32. Now lets customize the landing page, then use exit to close the connection, and close the tab or window.

echo "This is the London server" > /usr/share/nginx/html/index.html
exit
exit

33. Refresh and you will see the custom message

Now let's do the same to the server in Ohio Region

34. Go to Ohio Region

35. Go to EC2, Instances

36. Select the instance and click on Connect

37. Select the tab EC2 Instance Connect and click on Connect, this will open a new window

38. This will open a new window with an emulated terminal in the instance, now install nginx

sudo su -
amazon-linux-extras install -y nginx1

39. Check the status of nginx

systemctl status nginx
● nginx.service - The nginx HTTP and reverse proxy server
   Loaded: loaded (/usr/lib/systemd/system/nginx.service; disabled; vendor preset: di
sabled)
   Active: inactive (dead)

Dec 14 21:04:22 ip-172-31-14-83.us-east-2.compute.internal systemd[1]: Unit nginx...
Hint: Some lines were ellipsized, use -l to show in full.

40. Start the nginx server

systemctl start nginx

41. Open in a new browser tab the public IP to check is working (you can find the Public IP on the bottom of the terminal page)

42. Now lets customize the landing page, then use exit to close the connection, and close the tab or window.

echo "This is the Ohio server" > /usr/share/nginx/html/index.html
exit
exit

43. Refresh and you will see the custom message

44. Go to Global Accelerator

45. Click on Create accelerator

46. Give it a name and click on next

47. Add a listener in the port 80 and protocol TCP and click on Next

48. Add the endpoints, select on Region us-east-2 (Ohio) and click on Add endpoint group and add the eu-west-2 (London) and click Next

49. In the next window we need to select the endpoint (EC2 instance) of each Region, as Endpoint type select EC2 instance and select the EC2 ID of the instance on each region and click on Create accelerator

50. Wait until the status of the global accelerator is On

Great, you have your Global Accelerator, you can use the static IP addresses and the DNS name for accessing the servers.

Test

  1. Use the DNS name to access the near server to you on the browser, as I'm on USA it connects me with Ohio

2. Use some proxy or VPN in another place closer to the London location, I'm going to use the web page hidemyass.com

3. is connecting as it should to the London server

Conclusion

With AWS Global Accelerator we can accelerate the connection up to 60% because we don't make so many hoops to reach the destination, for example if you have content in one AZ or Region, when a user want to connect from other country the connection is going to travel longer than using Global Accelerator.

Without Global Acceleration
With Global Acceleration

Global Accelerator can determine where the user is connecting from and direct the traffic to the near Edge location

Clean-Up

  1. On AWS Global Accelerator, select the Global Accelerator we create for this lab and click on Delete

2. Click on Disable accelerator, and wait until is disabled

3. Once is disabled, confirm the deletion

4. Go to London Region

5. Go to EC2

6. Go to Instances

7. Select the instance and click on Instance state, then select Terminate instance

8. Confirm

9. Go to Key Pairs

10. Select the Key Pair we create for the instance in London, and click on Actions and then Delete

11. Confirm

12. Go to Security Groups

13. Select the Security groups we create for this lab and click on Actions and then Delete Security Groups

14. Confirm

15. Go to Ohio Region

16. Go to EC2

6. Go to Instances

7. Select the instance and click on Instance state, then select Terminate instance

8. Confirm

9. Go to Key Pairs

10. Select the Key Pair we create for the instance in Ohio, and click on Actions and then Delete

11. Confirm

12. Go to Security Groups

13. Select the Security groups we create for this lab and click on Actions and then Delete Security Groups

14. Confirm

References