www.immobilienscout24.de



System management with
RPM and YADT
A Solution for Data Centers
Brussels | 2012-02-05 | Ralph Angenendt
Application Manager




                           License: http://creativecommons.org/licenses/by-nc-nd/3.0/
So what is it?

  RPM
    Well known packaging format
    Easy to use (and package)
    Built-in content verification
    Complete toolchain




Slide 2 | System management with RPM & YADT | Ralph Angenendt
So what is it?

  YADT
    An Augmented Deployment Tool
    Central management of dependencies between
       Services
       Systems
       Software Packages




Slide 3 | System management with RPM & YADT | Ralph Angenendt
RPM, huh?

  Sure. Everything is packaged as an RPM
    Our system software (RHEL – 100% RPM)
    Software from the outside (think EPEL)
    Our Applications
       We wish
       But we're getting there




Slide 4 | System management with RPM & YADT | Ralph Angenendt
But config?

  It comes in files
  RPM is good at handling files
  There are tools to get RPMs on a machine
  RPM can verify package contents
  Updates are easy




Slide 5 | System management with RPM & YADT | Ralph Angenendt
So you build RPMs for every machine?




                Um. No.

Slide 6 | System management with RPM & YADT | Ralph Angenendt
So you build RPMs for every machine?




             Well, sort
                of.
Slide 7 | System management with RPM & YADT | Ralph Angenendt
So you build RPMs for every machine?




             We let
            machines
             do it.
Slide 8 | System management with RPM & YADT | Ralph Angenendt
„Config Subversion“

  All Configuration is kept in an SVN repository
    Hierarchical
    Supports a „Data Center“ layout
    Is easy to understand
    Typical unixy filesystem layout




Slide 9 | System management with RPM & YADT | Ralph Angenendt
Config „subversion“

  Goes from general to special
  On-Commit
    RPM building
    YUM repository generation
  Also works with dpkg and apt
    If you write the code to support it




Slide 10 | System management with RPM & YADT | Ralph Angenendt
In general it looks like this


             all/
Overwrites




             loc/
             type/
             loctype/
             host/




Slide 11 | System management with RPM & YADT | Ralph Angenendt
In general it looks like this


             all/
                      etc/
Overwrites




                      data/
                      VARIABLES/
             loc/
             type/
             loctype/
             host/




Slide 12 | System management with RPM & YADT | Ralph Angenendt
In general it looks like this


             all/
             loc/
                      tuv/
Overwrites




                      ber/
                      ham/
                               etc/
                               data/
                               VARIABLES/
             type/
             loctype/
             host/


Slide 13 | System management with RPM & YADT | Ralph Angenendt
In general it looks like this


             all/
             loc/
             type/
Overwrites




                  web/
                  app/
                               etc/
                               data/
                               VARIABLES/
             loctype/
             host/



Slide 14 | System management with RPM & YADT | Ralph Angenendt
In general it looks like this


             all/
             loc/
             type/
Overwrites




             loctype/
                               berweb/
                               berapp/
                                     etc/
                                     data/
                                     VARIABLES/
             host/



Slide 15 | System management with RPM & YADT | Ralph Angenendt
In general it looks like this


             all/
             loc/
             type/
Overwrites




             loctype/
             host/
                  berweb01/
                  berweb02/
                          etc/
                          data/
                          VARIABLES/



Slide 16 | System management with RPM & YADT | Ralph Angenendt
VARIABLES?

  VARIABLES/ contains – well – variables
    Many hosts have a similar configuration
    Best to configure that in a general way
       All hosts use a proxy
       Proxies in tuv, ber and in ham are different




Slide 17 | System management with RPM & YADT | Ralph Angenendt
Variables



   all/etc/proxy.conf:
      [...]
      proxy_port=3128
      proxy_host=@@@PROXY_HOST@@@
   loc/tuv/VARIABLES/PROXY_HOST:
      tuvprx.example.com
   loc/ber/VARIABLES/PROXY_HOST:
      berprx.example.com
   loc/ham/VARIABLE/PROXY_HOST:
      hamprx.example.com


Slide 18 | System management with RPM & YADT | Ralph Angenendt
More specials

  There are two special Variables
   RPM_PROVIDES
     config-hostname (e.g. config-berweb01)
    RPM_REQUIRES
      tomcat,httpd,java-application
  RPM_PROVIDES is required during kickstart
  Content of RPM_REQUIRES pulls in all other needed
  RPMs for the host




Slide 19 | System management with RPM & YADT | Ralph Angenendt
Putting it all together

                            config-rpm-maker

                                substitutes
                                VARIABLES

                                  builds
                                  RPMs

                                 creates
                                YUM-Repo




Slide 20 | System management with RPM & YADT | Ralph Angenendt
Putting it all together

  yadt-config-rpm-maker
    Works as a post-commit hook in subversion
    Written in python
    Creates packages in parallel
    Automatically determines which packages have to
     be rebuilt
    Rebuilds the minimal set needed
    Is open source (GPL)
    Available from https://code.google.com/p/yadt/



Slide 21 | System management with RPM & YADT | Ralph Angenendt
Caveats

  RPM dislikes a few things
    Mainly two packages owning the same file
    Not every software has a config.d/
    „Generic“ config mostly not usable
    Installation tends to break, then




Slide 22 | System management with RPM & YADT | Ralph Angenendt
Caveats

  Solution
    Write wrapper packages
    Those overwrite config via %post
       Config now includes config.d/ (if possible)
    Write your own config.d/ structure
    Overwrite original config by piecing things from
     config.d/ together




Slide 23 | System management with RPM & YADT | Ralph Angenendt
Summary

  Complete config is in one package
  Config pulls in „complete machine“
  Tool chain allows easy verification
  Tool chain is well known
  Package format is
    Well known
    Rather easy (from an „RPM person“ view)
  Config is precalculated before copying




Slide 24 | System management with RPM & YADT | Ralph Angenendt
ADVERTISEMENT




                   Nexus Yum Plugin available from
            https://code.google.com/p/nexus-yum-plugin/


Slide 25 | System management with RPM & YADT | Ralph Angenendt
YADT

  Knows your Data Center
    Allows you to model your DC
    YAML-based description of
       Services
       Applications
       Hosts
  Knows about dependencies between
    Packages
    Services
    Systems

Slide 26 | System management with RPM & YADT | Ralph Angenendt
Configuration

  Target definition in file „target“:


   name: probau
   log-dir: logs

   hosts:
   - hambau*.example.com
   - berbau*.exampe.com




Slide 27 | System management with RPM & YADT | Ralph Angenendt
Configuration

  Service definition in file „yadt.services“:

        - service1:
            needs_services: [service2]

        - service2:
            needs_services: [service3]

        - service3:




Slide 28 | System management with RPM & YADT | Ralph Angenendt
Configuration

  Notations:
    service://hostname/servicename
    host://hostname/
    artefact://hostname/packagename/version
       yadt status service://hostname1/httpd
       yadt ignore host://{host2|host33}
       yadt lock -m host://hostname3
       yadt updateartefact artefact://
        [host1..host15]/yadt-client



Slide 29 | System management with RPM & YADT | Ralph Angenendt
YADT – the smallest unit


                                               yadt.services:

                                               - tomcat:
                  Restarts on
     tomcat         update                     Target:

                                               hosts:
                                                   - foo.example.com
                   tomcat
     Depends        config




Slide 30 | System management with RPM & YADT | Ralph Angenendt
YADT – simple dependencies


                                               yadt.services:
                          Stopped 1st
          httpd           Started 2nd          - httpd:
                                                    needs_services: [tomcat]
                       httpd                   - tomcat:
Depends                config


                          Stopped 2nd
        tomcat            Started 1st


                      tomcat
                       config
      Depends



Slide 31 | System management with RPM & YADT | Ralph Angenendt
YADT – adding external services


           LB                                  yadt.services:
                     Removed from              - loadbalancer:
Depends              config                        needs_services: [httpd]
                                                   class: LoadbalancerService
                                                   loadbalancer_clusters: [pro-fe]
                                                   pool: test
         httpd        Stopped 1st                  port: 80
                      Started 2nd                  status_max_tries: 2
                   httpd
 Depends           config                      - httpd:
                                                    needs_services: [tomcat]
                       Stopped 2nd             - tomcat:
        tomcat
                       Started 1st
                   tomcat
                    config
        Depends

Slide 32 | System management with RPM & YADT | Ralph Angenendt
External services

  YADT has a service layer
    Python module
    Can also execute scripts
    Loadbalancer:
       Uses the F5 Big IP python api
       Can disable/enable hosts
    We also use it for making Nagios go quiet
    Not yet open source
       Needs to be generalized



Slide 33 | System management with RPM & YADT | Ralph Angenendt
YADT – adding services on other systems
                                  yadt.services:
  LB
                                  - loadbalancer:
                                      needs_services: [httpd]
                                      class: LoadbalancerService
                                      loadbalancer_clusters: [pro-fe]
                                      pool: test
httpd
                                  [...]
         httpd
         config                   - tomcat:
                                       needs_services: [app]

tomcat
         tomcat
          config                                         yadt.services:
                               app
                                                         - app:
                                           app
                                          config


Slide 34 | System management with RPM & YADT | Ralph Angenendt
YADT – more complex modeling
                                     LB




httpd                                                   httpd
         httpd             target:                               httpd
         config            hosts:                                config
                               - host[01..02]
tomcat                                                 tomcat
         tomcat                                                  tomcat
          config               app                                config

                                       app
                                      config


Slide 35 | System management with RPM & YADT | Ralph Angenendt
YADT – chunks and wave deployment
                                       LB




httpd       httpd           httpd           httpd         httpd      httpd




          1.                            2.                          3.



   Slide 36 | System management with RPM & YADT | Ralph Angenendt
Interface




Slide 37 | System management with RPM & YADT | Ralph Angenendt
Conclusion

  RPM configuration works astonishingly well
    Though needs work around caveats
    Easy to maintain (for everyone, just change config)
    Distribution via yum repositories
    One RPM pulls up a complete machine
    Need to „resetup“?
       Remove config-rpm
       Reinstall config-rpm




Slide 38 | System management with RPM & YADT | Ralph Angenendt
Conclusion

  YADT is a work in progress – but it works reliably
    For many machines, it can get slow
       Especially when nagios / loadbalancer are
        included
    Services layer not yet open sourced
    Easy configuration
    Needs package based distribution system
    We use it on a daily basis




Slide 39 | System management with RPM & YADT | Ralph Angenendt
Outlook

  New yadt-shell (the interface) on the way
  Work has started to parallelize yadt
    Against slowness
    Let's you do „server, rack, datacenter“ scenario
    You can determine fault tolerance
  Would be nice to have a working Demo system =:)




Slide 40 | System management with RPM & YADT | Ralph Angenendt
The End (finally!)



                              YADT
                https://code.google.com/p/yadt/

                    Yadt-rpm-config-maker
                https://code.google.com/p/yadt/

                    Nexus YUM plugin
      https://code.google.com/p/nexus-yum-plugin/




Slide 41 | System management with RPM & YADT | Ralph Angenendt
Thank you very much!
Please contact me for further
questions and discussions.
Kontakt:
Immobilien Scout GmbH   Fon:   +49 30 243 01-1036
Andreasstraße 10        Email: ralph.angenendt@immobilienscout24.de
10243 Berlin            URL: www.immobilienscout24.de




Slide 42 | System management with RPM & YADT | Ralph Angenendt

System management with rpm and yadt

  • 1.
    www.immobilienscout24.de System management with RPMand YADT A Solution for Data Centers Brussels | 2012-02-05 | Ralph Angenendt Application Manager License: http://creativecommons.org/licenses/by-nc-nd/3.0/
  • 2.
    So what isit? RPM  Well known packaging format  Easy to use (and package)  Built-in content verification  Complete toolchain Slide 2 | System management with RPM & YADT | Ralph Angenendt
  • 3.
    So what isit? YADT  An Augmented Deployment Tool  Central management of dependencies between  Services  Systems  Software Packages Slide 3 | System management with RPM & YADT | Ralph Angenendt
  • 4.
    RPM, huh? Sure. Everything is packaged as an RPM  Our system software (RHEL – 100% RPM)  Software from the outside (think EPEL)  Our Applications  We wish  But we're getting there Slide 4 | System management with RPM & YADT | Ralph Angenendt
  • 5.
    But config? It comes in files RPM is good at handling files There are tools to get RPMs on a machine RPM can verify package contents Updates are easy Slide 5 | System management with RPM & YADT | Ralph Angenendt
  • 6.
    So you buildRPMs for every machine? Um. No. Slide 6 | System management with RPM & YADT | Ralph Angenendt
  • 7.
    So you buildRPMs for every machine? Well, sort of. Slide 7 | System management with RPM & YADT | Ralph Angenendt
  • 8.
    So you buildRPMs for every machine? We let machines do it. Slide 8 | System management with RPM & YADT | Ralph Angenendt
  • 9.
    „Config Subversion“ All Configuration is kept in an SVN repository  Hierarchical  Supports a „Data Center“ layout  Is easy to understand  Typical unixy filesystem layout Slide 9 | System management with RPM & YADT | Ralph Angenendt
  • 10.
    Config „subversion“ Goes from general to special On-Commit  RPM building  YUM repository generation Also works with dpkg and apt  If you write the code to support it Slide 10 | System management with RPM & YADT | Ralph Angenendt
  • 11.
    In general itlooks like this all/ Overwrites loc/ type/ loctype/ host/ Slide 11 | System management with RPM & YADT | Ralph Angenendt
  • 12.
    In general itlooks like this all/ etc/ Overwrites data/ VARIABLES/ loc/ type/ loctype/ host/ Slide 12 | System management with RPM & YADT | Ralph Angenendt
  • 13.
    In general itlooks like this all/ loc/ tuv/ Overwrites ber/ ham/ etc/ data/ VARIABLES/ type/ loctype/ host/ Slide 13 | System management with RPM & YADT | Ralph Angenendt
  • 14.
    In general itlooks like this all/ loc/ type/ Overwrites web/ app/ etc/ data/ VARIABLES/ loctype/ host/ Slide 14 | System management with RPM & YADT | Ralph Angenendt
  • 15.
    In general itlooks like this all/ loc/ type/ Overwrites loctype/ berweb/ berapp/ etc/ data/ VARIABLES/ host/ Slide 15 | System management with RPM & YADT | Ralph Angenendt
  • 16.
    In general itlooks like this all/ loc/ type/ Overwrites loctype/ host/ berweb01/ berweb02/ etc/ data/ VARIABLES/ Slide 16 | System management with RPM & YADT | Ralph Angenendt
  • 17.
    VARIABLES? VARIABLES/contains – well – variables  Many hosts have a similar configuration  Best to configure that in a general way  All hosts use a proxy  Proxies in tuv, ber and in ham are different Slide 17 | System management with RPM & YADT | Ralph Angenendt
  • 18.
    Variables all/etc/proxy.conf: [...] proxy_port=3128 proxy_host=@@@PROXY_HOST@@@ loc/tuv/VARIABLES/PROXY_HOST: tuvprx.example.com loc/ber/VARIABLES/PROXY_HOST: berprx.example.com loc/ham/VARIABLE/PROXY_HOST: hamprx.example.com Slide 18 | System management with RPM & YADT | Ralph Angenendt
  • 19.
    More specials There are two special Variables  RPM_PROVIDES config-hostname (e.g. config-berweb01)  RPM_REQUIRES tomcat,httpd,java-application RPM_PROVIDES is required during kickstart Content of RPM_REQUIRES pulls in all other needed RPMs for the host Slide 19 | System management with RPM & YADT | Ralph Angenendt
  • 20.
    Putting it alltogether config-rpm-maker substitutes VARIABLES builds RPMs creates YUM-Repo Slide 20 | System management with RPM & YADT | Ralph Angenendt
  • 21.
    Putting it alltogether yadt-config-rpm-maker  Works as a post-commit hook in subversion  Written in python  Creates packages in parallel  Automatically determines which packages have to be rebuilt  Rebuilds the minimal set needed  Is open source (GPL)  Available from https://code.google.com/p/yadt/ Slide 21 | System management with RPM & YADT | Ralph Angenendt
  • 22.
    Caveats RPMdislikes a few things  Mainly two packages owning the same file  Not every software has a config.d/  „Generic“ config mostly not usable  Installation tends to break, then Slide 22 | System management with RPM & YADT | Ralph Angenendt
  • 23.
    Caveats Solution  Write wrapper packages  Those overwrite config via %post  Config now includes config.d/ (if possible)  Write your own config.d/ structure  Overwrite original config by piecing things from config.d/ together Slide 23 | System management with RPM & YADT | Ralph Angenendt
  • 24.
    Summary Completeconfig is in one package Config pulls in „complete machine“ Tool chain allows easy verification Tool chain is well known Package format is  Well known  Rather easy (from an „RPM person“ view) Config is precalculated before copying Slide 24 | System management with RPM & YADT | Ralph Angenendt
  • 25.
    ADVERTISEMENT Nexus Yum Plugin available from https://code.google.com/p/nexus-yum-plugin/ Slide 25 | System management with RPM & YADT | Ralph Angenendt
  • 26.
    YADT Knowsyour Data Center  Allows you to model your DC  YAML-based description of  Services  Applications  Hosts Knows about dependencies between  Packages  Services  Systems Slide 26 | System management with RPM & YADT | Ralph Angenendt
  • 27.
    Configuration Targetdefinition in file „target“: name: probau log-dir: logs hosts: - hambau*.example.com - berbau*.exampe.com Slide 27 | System management with RPM & YADT | Ralph Angenendt
  • 28.
    Configuration Servicedefinition in file „yadt.services“: - service1: needs_services: [service2] - service2: needs_services: [service3] - service3: Slide 28 | System management with RPM & YADT | Ralph Angenendt
  • 29.
    Configuration Notations:  service://hostname/servicename  host://hostname/  artefact://hostname/packagename/version  yadt status service://hostname1/httpd  yadt ignore host://{host2|host33}  yadt lock -m host://hostname3  yadt updateartefact artefact:// [host1..host15]/yadt-client Slide 29 | System management with RPM & YADT | Ralph Angenendt
  • 30.
    YADT – thesmallest unit yadt.services: - tomcat: Restarts on tomcat update Target: hosts: - foo.example.com tomcat Depends config Slide 30 | System management with RPM & YADT | Ralph Angenendt
  • 31.
    YADT – simpledependencies yadt.services: Stopped 1st httpd Started 2nd - httpd: needs_services: [tomcat] httpd - tomcat: Depends config Stopped 2nd tomcat Started 1st tomcat config Depends Slide 31 | System management with RPM & YADT | Ralph Angenendt
  • 32.
    YADT – addingexternal services LB yadt.services: Removed from - loadbalancer: Depends config needs_services: [httpd] class: LoadbalancerService loadbalancer_clusters: [pro-fe] pool: test httpd Stopped 1st port: 80 Started 2nd status_max_tries: 2 httpd Depends config - httpd: needs_services: [tomcat] Stopped 2nd - tomcat: tomcat Started 1st tomcat config Depends Slide 32 | System management with RPM & YADT | Ralph Angenendt
  • 33.
    External services YADT has a service layer  Python module  Can also execute scripts  Loadbalancer:  Uses the F5 Big IP python api  Can disable/enable hosts  We also use it for making Nagios go quiet  Not yet open source  Needs to be generalized Slide 33 | System management with RPM & YADT | Ralph Angenendt
  • 34.
    YADT – addingservices on other systems yadt.services: LB - loadbalancer: needs_services: [httpd] class: LoadbalancerService loadbalancer_clusters: [pro-fe] pool: test httpd [...] httpd config - tomcat: needs_services: [app] tomcat tomcat config yadt.services: app - app: app config Slide 34 | System management with RPM & YADT | Ralph Angenendt
  • 35.
    YADT – morecomplex modeling LB httpd httpd httpd target: httpd config hosts: config - host[01..02] tomcat tomcat tomcat tomcat config app config app config Slide 35 | System management with RPM & YADT | Ralph Angenendt
  • 36.
    YADT – chunksand wave deployment LB httpd httpd httpd httpd httpd httpd 1. 2. 3. Slide 36 | System management with RPM & YADT | Ralph Angenendt
  • 37.
    Interface Slide 37 |System management with RPM & YADT | Ralph Angenendt
  • 38.
    Conclusion RPMconfiguration works astonishingly well  Though needs work around caveats  Easy to maintain (for everyone, just change config)  Distribution via yum repositories  One RPM pulls up a complete machine  Need to „resetup“?  Remove config-rpm  Reinstall config-rpm Slide 38 | System management with RPM & YADT | Ralph Angenendt
  • 39.
    Conclusion YADTis a work in progress – but it works reliably  For many machines, it can get slow  Especially when nagios / loadbalancer are included  Services layer not yet open sourced  Easy configuration  Needs package based distribution system  We use it on a daily basis Slide 39 | System management with RPM & YADT | Ralph Angenendt
  • 40.
    Outlook Newyadt-shell (the interface) on the way Work has started to parallelize yadt  Against slowness  Let's you do „server, rack, datacenter“ scenario  You can determine fault tolerance Would be nice to have a working Demo system =:) Slide 40 | System management with RPM & YADT | Ralph Angenendt
  • 41.
    The End (finally!) YADT https://code.google.com/p/yadt/ Yadt-rpm-config-maker https://code.google.com/p/yadt/ Nexus YUM plugin https://code.google.com/p/nexus-yum-plugin/ Slide 41 | System management with RPM & YADT | Ralph Angenendt
  • 42.
    Thank you verymuch! Please contact me for further questions and discussions. Kontakt: Immobilien Scout GmbH Fon: +49 30 243 01-1036 Andreasstraße 10 Email: [email protected] 10243 Berlin URL: www.immobilienscout24.de Slide 42 | System management with RPM & YADT | Ralph Angenendt