Friday, 23 August 2013

EC2 to the rescue

In recent days we had a problem with connectivity between our main data centre in the US and APAC based customers. That's a pretty big problem...

While the connectivity problem was being resolved we stood up a instance in EC2 running the following:
  •     Squid, for proxying requests from customers to our UI platform.
  •     Apache Traffic Server, for reverse proxying requests from customers to our search platform.
  •     vsftpd, for handling some content delivery.
Using existing documentation from previous projects we managed to stand this up in 45 minutes. While not perfect it acted as a bridge between APAC and the US, pleasing our affected customers no end.

Apache Traffic Server was as easy as:

yum install tcl-devel pcre-devel
cd /tmp
bunzip2 trafficserver-*.tar.bz2 
tar -xf trafficserver-*.tar
cd trafficserver-*
make install
trafficserver start

Now I added this to the bottom of /usr/local/etc/trafficserver/remap.config:

map http://ec2_external_instances_name / http://orginal_url

and changed this string here /usr/local/etc/trafficserver/records.config:

CONFIG proxy.config.http.server_port INT 80

and then issued a

trafficserver restart

Job done. And don't forget to update the EC2 security group.

No comments:

Post a Comment