Website building exercise


Published on

use 5 servers to build a company web site
website build exercise

Published in: Technology
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Website building exercise

  1. 1. 5 servers to build website A website building exercise chuenlye leo
  2. 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. 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. 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. 5. Idea Design ● shared nothing architecture ● no single point of failure ● automate everything
  6. 6. implementation
  7. 7. 5 servers at the beginning one LB server two application server two db server(mysql replication, master/slave)
  8. 8. issues one LB server: single point of failure. multiple LB servers + shared IP can fix this problem.
  9. 9. issues Application servers: No single point of file system is used? session problem? store sessions in a memcached cluster, but seems not easy?
  10. 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.
  11. 11. details Load Balancer with apache soft lb alternatives: ● HAProxy ● Varnish ● Squid ● nginx ● …...
  12. 12. details website template morph use wordpress, this exercise use drupal.
  13. 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. 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. 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. 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. 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. 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. 19. how to use this demo site please see operations guide. Thanks!