13.1 Getting Setup
Last updated
Was this helpful?
Last updated
Was this helpful?
The wordpress software is installed on the EC2 instances and the MySQL DB instance, so the structured blogs data and users' data will be stored in RDS.
When admin visit the wordpress website, he will be directed to visit one of the server (write.[domain-name].com) running in an auto-scaling group which sits behind a Classic Load Balancer. When the users visit the wordpress website, they will be directed to visit one of the servers ([domain-name].com) running in an auto-scaling group which sits behind an Application Load Balancer. Those servers can read/write the data from/into RDS. The servers for admin visiting replicates any change of the wordpress software source code and the media assets (pictures, videos, etc) of the users to S3 buckets periodically using cron jobs. The servers for users visiting downloads those data from the S3 buckets periodically using cron jobs.
When you add an auto-scaling group to Load Balancer:
If you are adding an auto-scaling group to a Classic Load Balancer, you just need to indicate the Name of this classic load balancer.
If you are adding an auto-scaling group to an Application Load Balancer, you need to indicate a Target Group of this application load balancer, and this target group should have been configured to receive traffic from its associated application load balancer.
Both of the ALB and the CLB are receiving the requests that sent from the Route53.
The Origin of the CloudFront is the S3 bucket MediaAssets. You use URL RewriteRule to redirect the requests to the server that querying the media assets on the S3 bucket to CloudFront. The users can visit your read/write server, when they click on an image, they will be redirect to CloudFront, instead of S3 bucket. This URL rewriting forces the users to visit the media assets through CloudFront, instead of S3.
The software called "stress" can be used to do the load testing of your servers.
When you launch an instance, a public IP (if your subnet allows) and private IP will be assigned to it. When you stop the instance and start it again, its public IP address will be changed. To solve this problem using one of the two ways:
Using EIP. You can create an Elastic IP address and assign it to your instance. You can do this because you will always own that Elastic IP address.
Using A record. You can put this instance behind a ELB and use its DNS name. In this way, you create a custom domain name in Route53 using A record and set it to be an alias of the DNS name of the ELB. You can do this because you can always visit your own custom domain name created in the Route53 record set.
In this lab, what we used is the second way.
If you want to reboot your DB instance, you can choose Reboot with Failover or not. If you choose reboot with failover, it will reboot the DB instance on the standby instance. This is a kind of "enforced failover". It can be used in the scenario that if you have an upgraded DB instance ready to go online, but now your primary DB instance is running, so the new DB instance could only be the standby. Now you can reboot the primary DB instance with failover to make the standby upgraded DB instance online. This may make your website have 2 to 3 minutes downtime because of the failover.