Date post: | 01-Nov-2014 |
Category: |
Technology |
Upload: | meilai521 |
View: | 230 times |
Download: | 1 times |
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
assignment
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 scale up/down.
My works
● 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●
from the technical point of view
● shared nothing architecture● no single point of failure● automate everything
Idea Design
implementation
one LB servertwo application servertwo db server(mysql replication, master/slave)
5 servers at the beginning
one LB server: single point of failure.multiple LB servers + shared IP can fix this problem.
issues
Application servers:
No single point of file system is used?session problem?store sessions in a memcached cluster, but seems not easy?
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.
issues
Load Balancer with apachesoft lb alternatives:● HAProxy● Varnish● Squid● nginx● …...
details
website template morph use wordpress,this exercise use drupal.
details
personally, scale vertically(CPU/MEM/IO/NW) is not prefered.scale horizontally for application serversscale horizontally(to some extent) for mysql servers
scale: phased, incremental approach
❖ 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
automation
$ knife role listlb-apache # for LB severdeploy-drupal # for app servermysql-master # for mastermysql-slave # for slave
automation details
we can :● compose multiple roles for one servere.g: all-in-one 1 server system for dev/test● create multiple servers with the same
role in production environment for scalability.
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.
automation details
● for people who don't use chef● simple web demo can be extended to
one-click deploy system.
Demo site: http://lb-server/runchef
Run chef from web UI
please see operations guide.
Thanks!
how to use this demo site