1. 5 servers to build
website
A website building exercise
chuenlye leo
nova.leo@gmail.com
2. assignment
use 5 servers to build one company
website:
● automation repetitive admin tasks
● make it fully operational as "production"
● complete for operation side and
documentation as well
3. My works
some assumptions on this website:
● site purpose: a typical company website
for company introduction, market
brochure, information dissemination ,
etc.
● scale: not very big like popular social
community site, but should be flexible to
4. from the technical point of view
● read-intensive, not write-intensive
● redundancy/availability: it is a must
● scalability: better to let it be high
scalable
● performance: not very strict, but no
single point of contention is good.
● automation: it is a must in the cloud
times
5. Idea Design
● shared nothing architecture
● no single point of failure
● automate everything
10. issues
DB servers:
this site is considered as read-intensive,
so mysql replication can be considered to
be OK.
one write db server and multiple read-only
db servers to distribute read loads.
No need partitioning/sharding and no-sql.
13. scale: phased, incremental
approach
personally, scale vertically
(CPU/MEM/IO/NW) is not prefered.
scale horizontally for application servers
scale horizontally(to some extent) for
mysql servers
14. automation
❖ automation of installation/configuration
❖ auto-scaling:
● half-auto by hand with
chef/puppet/ansible, etc
● full-auto with auto-scaling system, like
AWS auto-scaling/Scalr/RightScale/DIY
15. automation details
$ knife role list
lb-apache # for LB sever
deploy-drupal # for app server
mysql-master # for master
mysql-slave # for slave
16. automation details
we can :
● compose multiple roles for one server
e.g: all-in-one 1 server system for dev/test
● create multiple servers with the same
role in production environment for
scalability.
17. automation details
LB server:
use chef search to get all balancer
members(app servers) automatically.
members = search(:node, "role:deploy-drupal*")
<% @members.sort_by{|i| i['ipaddress'] }.each do |member| %>
BalancerMember http://<%= member['ipaddress'] %>:80
<% end %>
chef-client can be used as a daemon to update
automatically.
18. Run chef from web UI
● for people who don't use chef
● simple web demo can be extended to
one-click deploy system.
Demo site: http://lb-server/runchef
19. how to use this demo site
please see operations guide.
Thanks!