SQL Database Design For Developers at php[tek] 2024
Scalr Demo
1. Scalr Demo
…..or how to scale Wordpress on AWS in 20 minutes
24 May 2012
Andreas Chatzakis
Teo Kotsilinis
AWS Usergroup Greece
2. Here is the plan
We will set up a scalable web infra in minutes and
install wordpress to prove it works!
– ELB as load balancer
– Multiple autoscaling EC2 Apache servers
– EC2 memcache
– EC2 MySQL master-slave setup
– S3/cloudfront for static storage
We will show Scalr features like
Deployments Server Snapshots
Farms setup and config Failover, Autoscaling
Scripting engine DNS, Vhosts
DB management Services configuration
2
4. Prep done in advance
Registered for an AWS account
Registered for a trial www.scalr.net account
Added my AWS keys on Scalr
Created S3 bucket and setup permissions
4
18. Discovery
I can use DNS, API or command line to get a view of my surounding environment,
automating config changes:
int.master.mysql.farm-hash.scalr-dns.net
int.slave.redis.farm-hash.scalr-dns.net
ext.master.postgresql.farm-hash.scalr-dns.net
ext.server-index.farm-role-id.farm-hash.scalr-dns.net
#ls /etc/scalr/private.d/hosts
app memcache
mysql-slave mysql-master
#ls /etc/scalr/private.d/hosts/mysql-master
10.241.6.71
18
19. Edit php.ini via the browser
session.save_handler = memcache
.
session.save_path="tcp://memcachserver:port ”
19
20. Snapshot
Now that we have prepared our app server, let's “save” it in a server snapshot:
Easy rollback:
20
22. The chaos monkey
Kill mysql instance #1 (the master)
Scalr triggers failover
Slave server promoted to master
Other slaves reconfigured to replicate from new master
Extra slave initialized if minimum servers dictates so
Scalr always initializes slaves from latest snapshot
Slave in same AZ? Scalr re-uses EBS volume
Slave in other AZ? Scalr creates snapshot of the dead-
master EBS volume, creates new EBS volume from it
22