RightScale Tutorial


Overview

RightScale Overview

Setup

Creating security groups

Security groups are a firewall setting for Amazon EC2 servers.

Open Clouds > AWS US > Security Groups and click New.

Create group AiCache with any description you like and open ports 22 (SSH, required by RightScale) and 80 (AiCache web).




Setting up alerts

Alerts will notify you about AiCache server problems. This step is completely optional, but very helpful if you building high availability system.

Open Design > Alert Escalations > View All

AiCache generates only warning alerts, so open this level and make sure you have send_email action on Actions tab.




Dns configuration

By default Amazon EC2 instances receive dynamic IP. To avoid IP change, we can purchase Elastic IP, which we will associate with aiCache DNS name.

Open Clouds > AWS US > Elastic IP and click New. Rename new Elastic IP (174.129.27.110 in my case) to AiCache.



Now we need to set up A record for test site. Later same IP will be assigned to main site  A record (aicache.com and www.aicache.com in my example).




Preparing aiCache config file

Template config file can be downloaded here
This file provides sane defaults to start, but few variables listed below must be manually adjusted anyway.

Website name:
 website
 hostname aicache.com
 cname www.aicache.com
 cname test.aicache.com

Alerts:
 alert_req_sec_max  2500 # When set, an alert is generated when number of RPS exceeds this number
 alert_req_sec_min    10 # When set, an alert is generated when number of RPS is less than this number
 alert_bad_resp_sec    2 # When set, an alert is generated when total number of failed responses from origin servers exceeds this number
 alert_os_rt         200 # When set, an alert is generated when origin server response time is more than this number (milliseconds)
                         # To disable any above alerts, just remove or comment corresponding line in config file

Healthcheck:
 healthcheck /url HTTP 5 4
 healthcheck url match NN MM # When specified, each origin server for this website is sent a health check request for "url", response is matched for "match".
                             # Such HC requests are sent every NN seconds and the response must be obtained within MM seconds.
                             # In case of error (no response within MM or response data that doesn't match "match" string) origin server is temporarily disabled.

Patterns:
 
pattern \.php regexp 1m # cache for 1 minute, use with caution
pattern .css simple 7d no_log # cache for a week, do not log in acces log file


Origin servers:
 origin 74.125.67.100 80 # Google server as testing origin, replace it with your server


Rest of the settings can be found in aiCache Administrator Guide.

This config file will be fetched from S3 bucket.

Open Clouds > AWS Global > S3 Browser. Click New Bucket and create bucket like <company_name>_config. In my case it was aicache_config. Keep in mind that S3 buckets name must be globally unique.

Upload updated config file.




Import aiCache template


Open Design > Server templates > View Library. Find AiCache template and import it.


Launching aiCache server


Now we're ready to launch new aiCache RightScale template.

Go to deployuemt you want to use and click Add server below.

Open Imported group and AiCache Template v2, add AiCache security group, select AiCache Elastic IP, check "associate IP at launch".



Find newly created instance and click Launch.

Adjust input variables:



Launch server and wait till it become operational, then check Audit Entries tab:



Testing aiCache and switching to production


Open test url in the browser. It was test.aicache.com in my case. If it shows google (example origin server) or your server page, AiCache works. Otherwise check Troubleshooting section.

To update config file of the running instance, upload new config to S3, open Scripts tab of the AiCache server and find "AIC S3 Configure" script.



Run it and check status in Audit Entries.

If everything is fine, update root and www A records for main site.


Turn off aiCache


Restore old IPs on www and root A records. Do not terminate AiCache instance immidiately - wait for DNS records to refresh.

After DNS records expire, AiCache server can be terminated.


Troubleshooting

; aiCache does not work and I have no idea why!
: Check audit entries
: Try to run "AIC S3 Configure" operational script - it will refresh config and restart aiCache.
: Use Pattern testing tool from Download Page to check patterns

  Sign in   Recent Site Activity   Terms   Report Abuse   Print page  |  Powered by Google Sites