Diese Präsentation wurde erfolgreich gemeldet.
Wir verwenden Ihre LinkedIn Profilangaben und Informationen zu Ihren Aktivitäten, um Anzeigen zu personalisieren und Ihnen relevantere Inhalte anzuzeigen. Sie können Ihre Anzeigeneinstellungen jederzeit ändern.

Plone Deployment (PloneConf Edition)

957 Aufrufe

Veröffentlicht am

System administrator's introduction to the Plone stack

Veröffentlicht in: Technologie
  • Loggen Sie sich ein, um Kommentare anzuzeigen.

Plone Deployment (PloneConf Edition)

  1. 1. Plone Deployment:Secrets & TricksSteve McMahonPlone Conference, 2012, Arnhem, NL
  2. 2. On ly! Tod ay ricks! ts orT t Se cre Wit houPlone Deployment:Secrets & TricksSteve McMahonPlone Conference, 2012, Arnhem, NL
  3. 3. You: SysAdmin or Friend of SysAdmin
  4. 4. ix y SX , Un D, O , BSLi nux You: SysAdmin or Friend of SysAdmin
  5. 5. ix y SX , Un D, O , BSLi nux You: SysAdmin or Friend of SysAdmin Me: SysAdmin and person who talks to SysAdmins
  6. 6. Looking for something moreadvanced?
  7. 7. Looking for something moreadvanced? Martin is in the disco room!
  8. 8. Looking for something moreadvanced? Martin is in the disco room! How I get my twins to do my bidding with scrum methodology and buildout.
  9. 9. How we look to PHP folks
  10. 10. How they look to us.
  11. 11. Real life, for both.
  12. 12. What we want.
  13. 13. Stand-AloneZope / Plone Internet✤ This works, but … Zope / Plone Port 80 or 8080✤ Lacks: ✤ Versatility ✤ SSL ZODB / Blobs ✤ Plays poorly with others
  14. 14. + Web Server Internet✤ Modern Web Server as Reverse Web Server Proxy 80 / 443✤ Handles SSL✤ Efficiently queues requests Zope / Plone Port 8080✤ Handles URL rewrites✤ Battle-hardened logging and request sanitizing ZODB / Blobs✤ Plays well with others
  15. 15. + Web Apps Internet Web Server 80 / 443✤ URL Rewriting makes it easy to map in other best-of-breed apps. Zope / Plone Other Web Apps Port 8080 Ports: ?✤ Can share special authentication, single-sign-on requirements. ZODB / Blobs
  16. 16. Optimizations
  17. 17. “Premature optimization is the root of all evil.” Donald Knuth
  18. 18. “Measure, measure, measure. Then act.” E. Leddy Budapest: Keynote Lecture in Appreciation of Donald Knuth
  19. 19. Load BalancingLoad Balancing means always having a canon ready to fire.L. DaVinci, Authenticity Disputed
  20. 20. +ZEO ZEO Client 1 ZEO Client 2 ZEO Client … Port 8081 Port 8082 Ports …✤ Efficient with modern multi- core processors even on single machines. ZEO Server Port 8000✤ Can scale to multiple machines.✤ A good option even without load balancing: debugging and run scripts. ZODB / Blobs✤ Pack database by command line utility.
  21. 21. +Load Internet Web Server 80 / 443 Balancing Load Balancer✤ Distributes work among ZEO Port 9000 clients.✤ Can help avoid service ZEO Client ZEO Client ZEO Client interruptions. 1 2 … Port 8081 Port 8082 Ports …✤ Balancing scheme can matter. ZEO✤ Session maintenance can Server ZODB / Port 8000 Blobs matter.
  22. 22. Proxy Caching“Good caching makes light work.”John Heywood, 1546, Often Misquoted.
  23. 23. +Server Cache Web Server Internet 80 / 443 Proxy Cache Port 6000✤ Reverse-Proxy Cache✤ Typically between web server and load balancer. Load Balancer Port 9000✤ Can be on a separate machine.✤ Cache in memory or on disk. ZEO Cluster
  24. 24. “Caching is hard.” D. Glick, Cioppino 2012
  25. 25. plone.app.caching“plone.app.caching is your frenemy.”Winston Churchill, 1944, Authenticity Disputed.
  26. 26. Choosing ToolsTake care of your tools and they will take care of you.Traditional
  27. 27. Web Server Internet 80 / 443 Proxy CacheBest of Breed Port 6000Approach Load Balancer Port 9000 ZEO Cluster
  28. 28. Internet Web Server 80 / 443 Nginx Proxy CacheBest of Breed Port 6000Approach Load Balancer Port 9000 ZEO Cluster
  29. 29. Internet Web Server 80 / 443 Nginx Proxy Cache VarnishBest of Breed Port 6000Approach Load Balancer Port 9000 ZEO Cluster
  30. 30. Internet Web Server 80 / 443 Nginx Proxy Cache VarnishBest of Breed Port 6000Approach Load Balancer Port 9000 HAProxy ZEO Cluster
  31. 31. Web Server Internet Web ServerDoes it All 80 / 443Entia non sunt multiplicanda praeter Proxy Cachenecessitatem. Port 6000(Entities must not be multiplied beyondnecessity.) — William of Occam (14th Century SysAdmin) Load Balancer Port 9000Keep is Simple, Stupid. — Occam’s Razor, translated to modern sysadmin speak ZEO Cluster
  32. 32. How To?http://collective-docs.readthedocs.org/en/latest/hosting/Is This The Right Place For This Resource? Good Question!
  33. 33. “Backup is serious shit.” E. Leddy, Cioppino 2012
  34. 34. re an re ups a f befo back are o nsive ake c prehe k to t Com nt tas f drin king. im porta weekend o star ting a“Backup is serious shit.” E. Leddy, Cioppino 2012
  35. 35. re an re ups a f befo back are o nsive ake c prehe k to t Com nt tas f drin king. im porta weekend o star ting a rehe nsive“Backup is serious shit.” omp k of c o a weeke nd of rse, a lac ad t O f cou can also le bac kups and t ears. drink ing — E. Leddy, Cioppino 2012
  36. 36. re an re ups a f befo back are o nsive ake c prehe k to t Com nt tas f drin king. im porta weekend o star ting a rehe nsive“Backup is serious shit.” omp k of c o a weeke nd of rse, a lac ad t O f cou can also le bac kups and t ears. king — IRC, 2012 drin id G lick, ilkes Dav Matt hewW Caut ion to E. Leddy, Cioppino 2012
  37. 37. backup, rsync, restore Is there another way?
  38. 38. backup, rsync, restorerecipe = collective.recipe.backup Is there another way?
  39. 39. Logs“Rotate your logs or your server will die.”E. Steele, The Missing 18 Minutes
  40. 40. “sudo apt-get install logrotate” Traditional Proverb, England, 12th Century
  41. 41. logrotate rules# rotate logs for client #2/var/db/plone4.1/zeocluster/var/client2/Z2.log/var/db/plone4.1/zeocluster/var/client2/event.log { rotate 5 weekly sharedscripts postrotate kill -USR2 `cat /var/db/…/client2.pid` endscript}
  42. 42. logrotate rules# rotate logs for client #2/var/db/plone4.1/zeocluster/var/client2/Z2.log/var/db/plone4.1/zeocluster/var/client2/event.log { rotate 5 weekly sharedscripts postrotate kill -USR2 `cat /var/db/…/client2.pid` endscript}
  43. 43. And, while on the log topic:
  44. 44. And, while on the log topic:2012-10-02T06:43:51 ERROR Zope.SiteErrorLog 1349185431.820.261142121162 http://colonialart.org/archive/artListTraceback (innermost last): Module ZPublisher.Publish, line 126, in publish Module ZPublisher.mapply, line 77, in mapply Module ZPublisher.Publish, line 46, in call_object Module Shared.DC.Scripts.Bindings, line 322, in __call__ Module Shared.DC.Scripts.Bindings, line 359, in _bindAndExec Module Products.PageTemplates.ZopePageTemplate, line 334, in _exec Module Products.PageTemplates.ZopePageTemplate, line 431, in pt_render Module Products.PageTemplates.PageTemplate, line 79, in pt_render Module zope.pagetemplate.pagetemplate, line 113, in pt_render Module zope.tal.talinterpreter, line 271, in __call__ Module zope.tal.talinterpreter, line 343, in interpret Module zope.tal.talinterpreter, line 888, in do_useMacro Module zope.tal.talinterpreter, line 343, in interpret Module zope.tal.talinterpreter, line 533, in do_optTag_tal Module zope.tal.talinterpreter, line 518, in do_optTag Module zope.tal.talinterpreter, line 513, in no_tag Module zope.tal.talinterpreter, line 343, in interpret Module zope.tal.talinterpreter, line 954, in do_defineSlot Module zope.tal.talinterpreter, line 343, in interpret Module zope.tal.talinterpreter, line 533, in do_optTag_tal Module zope.tal.talinterpreter, line 518, in do_optTag Module zope.tal.talinterpreter, line 513, in no_tag Module zope.tal.talinterpreter, line 343, in interpret Module zope.tal.talinterpreter, line 858, in do_defineMacro Module zope.tal.talinterpreter, line 343, in interpret Module zope.tal.talinterpreter, line 954, in do_defineSlot Module zope.tal.talinterpreter, line 343, in interpret Module zope.tal.talinterpreter, line 533, in do_optTag_tal
  45. 45. And, while on the log topic:2012-10-02T06:43:51 ERROR Zope.SiteErrorLog 1349185431.820.261142121162 http://colonialart.org/archive/artListTraceback (innermost last): Module ZPublisher.Publish, line 126, in publish Module ZPublisher.mapply, line 77, in mapply Module ZPublisher.Publish, line 46, in call_object Module Shared.DC.Scripts.Bindings, line 322, in __call__ Module Shared.DC.Scripts.Bindings, line 359, in _bindAndExec Module Products.PageTemplates.ZopePageTemplate, line 334, in _exec Module Products.PageTemplates.ZopePageTemplate, line 431, in pt_render Module Products.PageTemplates.PageTemplate, line 79, in pt_render Module zope.pagetemplate.pagetemplate, line 113, in pt_render Read your Module zope.tal.talinterpreter, line 271, in __call__ Module zope.tal.talinterpreter, line 343, in interpret Module zope.tal.talinterpreter, line 888, in do_useMacro Module zope.tal.talinterpreter, line 343, in interpret Module zope.tal.talinterpreter, line 533, in do_optTag_tal Module zope.tal.talinterpreter, line 518, in do_optTag Module zope.tal.talinterpreter, line 513, in no_tag Module zope.tal.talinterpreter, line 343, in interpret Module zope.tal.talinterpreter, line 954, in do_defineSlot event logs! Module zope.tal.talinterpreter, line 343, in interpret Module zope.tal.talinterpreter, line 533, in do_optTag_tal Module zope.tal.talinterpreter, line 518, in do_optTag Module zope.tal.talinterpreter, line 513, in no_tag Module zope.tal.talinterpreter, line 343, in interpret Module zope.tal.talinterpreter, line 858, in do_defineMacro Module zope.tal.talinterpreter, line 343, in interpret Module zope.tal.talinterpreter, line 954, in do_defineSlot Module zope.tal.talinterpreter, line 343, in interpret Module zope.tal.talinterpreter, line 533, in do_optTag_tal
  46. 46. Database PackingEarly ZODB Packing ToolLeonardo Da Vinci, ~1500
  47. 47. Better ZODB Packing bin/zeopack(plone.recipe.zeoserver)
  48. 48. Platform Setup & Plone Install
  49. 49. “These days, I use system packages as much as possible. You should, too.” E. Leddy, Cioppino 2012
  50. 50. Unified Installer:Least-Used Feature --with-python=/usr/bin/python2.7
  51. 51. Unified Installer:Least-Known Feature --clients=client-count
  52. 52. “Never run buildout as root.” S. McMahon, PloneConf, Today
  53. 53. Avoiding root sudo -u plone bin/buildout
  54. 54. Deployment Guide http://collective-docs.readthedocs.org/en/latest/deployment/
  55. 55. Questions?
  56. 56. Image Credits✤ cobol: CC by: http://www.flickr.com/photos/philmanker/3654636770/✤ complex: CC by: http://www.flickr.com/photos/medea_material/1692344189/✤ plant crusher: CC by NC ND: http://www.flickr.com/photos/duanemoore/4908036590/✤ diagram: CC by NC SA: http://www.flickr.com/photos/nataliedowne/6446884983/✤ blue: CC BY NC ND: http://www.flickr.com/photos/barthanlon/3670183050/✤ light timer: CC by NC SA: http://www.flickr.com/photos/dorkstyle/3783421698/✤ chain reaction: CC by NC ND: http://www.flickr.com/photos/acplinfo/2315988501/✤ Giant Crossbow courtesy of http://www.leonardoda-vinci.org✤ Centrifuge: CC by SA: http://www.flickr.com/photos/lrosa/515028911/✤ Mystery: CC by NC ND: http://www.flickr.com/photos/zeptonn/2631113046/✤ Decoder: CC by NC SA: http://www.flickr.com/photos/curiousexpeditions/962394310/✤ Screw Gear: CC by NC: http://www.flickr.com/photos/travelinlibrarian/4308521250/✤ Worm Gear: CC by NC: http://www.flickr.com/photos/travelinlibrarian/4307997887/✤ Pulleys: CC by NC: http://www.flickr.com/photos/travelinlibrarian/4305293959/✤ Ball Bearings: CC by: http://www.flickr.com/photos/cristic/312874252/✤ Multi-Barrel: CC by NC SA: http://www.flickr.com/photos/malcubed/2930190065/✤ Cannons: CC by: http://www.flickr.com/photos/jeanlouis_zimmermann/5554481148/✤ Fan: CC by: http://www.flickr.com/photos/jeanlouis_zimmermann/5554419770✤ Perpetual Motion: CC by NC SA: http://www.flickr.com/photos/grocel/274933518/

×