Sharing

2012年1月12日 星期四

What is DevOps?



英文 wiki
http://en.wikipedia.org/wiki/DevOps

網友阿舍兄的中文註解
http://www.arthurtoday.com/2011/10/devops.html




另外我覺得這邊寫的滿簡單易懂的, 還有圖解!
http://dev2ops.org/blog/2010/2/22/what-is-devops.html




Dep2ops 網站
http://dev2ops.org/

Ubuntu Orchestra 筆記


Highlighted Components
Experience of provisioning
    1. Rack a server
    2. Turn on a server
    3. Server netboots and 'registers' itself with the Orchestra provisioning server (cobbler)
    4. Server shuts down
    5. (WAIT)
    6. When server is required, it is Wake'd on Lan via powerwake and installs a base Ubuntu server with cloud-init installed.
    7. Juju customizes the install to be as required.

    http://blog.dustinkirkland.com/2011/08/formal-introduction-to-ubuntu-orchestra.html

    What is SOAP?

    是一種 Protocol, 用在使用 Web Service 之間的溝通, 格式是 XML, 架構在 HTTP or SMTP 之上


    What is WSDL?



    • A WSDL description of a web service (also referred to as a WSDL file) provides a machine-readable description of how the service can be called, what parameters it expects and what data structures it returns.
    • It thus serves a roughly similar purpose as aMethod signature in a programming language
    意思就是傳統 programming language 的  header file,用來描述這個 web service 怎麼使用


    What is UDDI?

    意思就是當你在網路上想要找到特定的 web service 來使用,那你怎麼知道要去那裡找? UDDI 就是一個提供查找的 "機制"  或是一個 "組織",你可以透過它去拿到 WSDL 然後知道怎麼使用這個  web service




    What is REST?


    老實說,看完後還是無法抓到到底怎麼樣的架構才能符合 REST,但至少明白他是在定義了一種 client-server 的軟體架構。


    What is RESTful web service?



    • A RESTful web service (also called a RESTful web API) is a simple web service implemented using HTTP and the principles of REST
      • the base URI for the web service
      • The Internet media type of the data supported by the web service.  This is often JSONYAML
      • the set of operations supported by the web service using HTTP methods (e.g., GET, PUT, POST, or DELETE).
      • The API must be hypertext driven
    目前很多 web service 都宣稱他們是 RESTful,基本上只代表能簡易透過一個 URL 再加上  GET/PUT/POST/DELETE 來操作網路上的物件或是使用他提供的 service,而格式目前我常看到的是  JSON

    What is Service Choreography?
    http://en.wikipedia.org/wiki/Web_Service_Choreography
    http://en.wikipedia.org/wiki/Service_choreography


    • XML-based business process modeling language that describes collaboration protocols of cooperating Web Service participants
    • Dancers dance following a global scenario without a single point of control
    • Each participant in a service choreography executes its part of it (i.e. its role) according to the behavior of the other participants
    感覺就是各跳各的呀~ 


    What is Service Orchestration?

    有一個總帥.. 但仍各司其職


    Different between Choreography and Orchestration

    實在太難懂了.. 到底在寫什麼 @@


    Choreography
    Orchestration
    Point of View
    the logic of the message-based interactions among the participants are specified from a global perspective
    the logic is specified from the local point of view of one single participant, called the orchestrator.
    Message exchange
    a protocol for peer-to-peer interactions
    specifies an executable process that involves message exchanges with other systems, such that the message exchange sequences are controlled by the orchestration designer
    Control
    a distributed system which operates according to rules but without centralized control
    central control of the behavior of a distributed system


    2012年1月10日 星期二

    Cobbler 筆記



    http://cobbler.github.com/
    What is Cobbler?
    • Linux installation server
      • Setup of network installation environments
        • PXE, media-based net-installs, and virtualized installs ( supporting Xen, qemu, KVM, and some variants of VMware)
    • Automates many associated Linux tasks
      • Do not have to hop between lots of various commands and applications
      • DNS, DHCP, package updates, power management, configuration management orchestration
    • There is also a lightweight built-in configuration management system
      • Dupport for integrating with configuration management systems like Puppet
    • Command line interface or web interface

    What can we do via Cobbler?
    • Physical Machine Installation
      • Basic PXE setup
      • Manage Yum and Apt Repos
      • Re-installation with Koan when PXE is not possible
      • Build iso when PXE and DHCP not available
    • Virtualization Automation
    • Kickstart Templating
      • Kickstart templating
        • Uses Cheetah as the kickstart templating engine
      • Kickstart Snippets
        • common part, re-usable code
    • Package Update Mirroring Features
      • Handle yum and apt
    • Network Management Features
      • DHCP
        • not really understand
      • DNS
        • not really understand
      • Bonding and VLAN
        • not really understand
    • Configuration Management
      • Built-in Configuration Management
        • focused around packages and templated configuration files
      • Integrate with puppet or cfengine3 or chef
        • better support for Redhat-based OSes and for Puppet
        • Put initial configuration as part of the CMS, and keep the Cobbler set-up simple and uncluttered.
        • set up Cobbler to deploy tailored sets of packages to different types of machines, then use the CMS to do relatively small-scale fine-tuning of that.
    • Power Management
      • not really understand
    • Replication
      • replicate configurations to other cobbler servers


    How Cobbler works?
    • XMLRPC
      • XMLRPC API is used to interact with cobbler via the cobblerd daemon
        • You want to talk to Cobbler and you are not a Python application/script
        • You want to talk to Cobbler and are not running on the Cobbler server
        • You are a non-GPLd application that wants to talk to Cobbler that is to be distributed to the public or customers
    • Trigger
      • do X when cobbler does Y, Python module
      • Not really understand


    Basic Terms

    Cobbler uses a tiered concept of Distributions, Profiles, Systems, and (optionally) Images and Repositories
    • Distributions contain information about what kernel and initrd are used, plus metadata (required kernel parameters, etc).
    • Profiles associate a Distribution with a kickstart file and optionally customize the metadata further.
    • Systems associate a MAC, IP, and other networking details with a profile and optionally customize the metadata further.
    • Repositories contain yum mirror information. Using cobbler to mirror repositories is an optional feature, though provisioning and package management share a lot in common.
    • Images are a catch-all concept for things that do not play nicely in the "distribution" category. Most users will not need these records initially and these are described later in the document.


    Use Case 1
    • you have either a DVD or ISO file of your OS's distribution
    • the server has sufficient local disk space available at /var/www/cobbler to unpack that DVD/ISO
    • the server and clients share a common IP network
    • the server is the only instance of a DHCP server on this network
    • the client is capable of PXE network booting on this network

    On the cobbler server:
    # Review the procedure below.  The command arguments "--foo=bar" will need to vary locally.
    
    # Install cobbler. The command below assumes a Redhat-like OS.
    yum install cobbler
    
    # Show what aspects might need attention
    cobbler check
    
    # Act on the 'check' above, then re-check until satisfactory.
    # (Details beyond the scope of this particular example.)
    
    # Import a client OS from a DVD.  This automatically sets up a "distro" and names it.
    # (See below ISO file variant.)
    cobbler import --path=/mnt --name=rhel5 --arch=x86_64
    
    # Create a profile (e.g. "rhel5_workstation") and associate it with that distro
    cobbler profile add --name=rhel5_workstation --distro=rhel5
    
    # Set up a kickstart file.
    # (Details beyond the scope of this particular example.)
    
    # Associate a kickstart file with this profile
    cobbler profile edit --name=rhel5_workstation --kickstart=/path/to/kick.ks
    
    # Register a client machine (e.g. "workstation1") and its network details
    # and associate it with a profile
    cobbler system add --name=workstation1 \
      --mac=AA:BB:CC:DD:EE:FF --ip=III.JJJ.KKK.LLL \
      --profile=rhel5_workstation \
      --netboot-enabled=true 
    
    # Get a detailed report of everything in cobbler
    cobbler report
    
    # Get cobbler to act on all the above (set up DHCP, etc.)
    cobbler sync
    

    Try it. Go to "workstation1" and attempt to boot it over the network.



    Quick Notes

    看完後, 大致了解 cobbler 的運作流程是先在 cobbler server 登錄即將加入的機器, 讓 cobbler server 可以認得這台機器,接下來定義每一層的連結 (System -> Profile -> Distribution + Kickstart ), 其中可動態客制化的部份是靠 Kickstart,然後把機器打開後,透過 PXE Installation 把工作完成,這是最基本的流程。

    可是更棒的流程應該是我們可以在一個特定的環境內加入一台新的機器, cobbler server 就能自動抓到這台機器,然後我們透過選單指定他的 Profile, 然後一切的工作就完成了! 這樣的功能在


    https://github.com/cobbler/cobbler/wiki/Auto-registration


    有提到,不過我看的不是很懂,之後有空再研究,總之 cobbler 的功能定義的非常清楚,就是 "Installation",至於 Configuration 可以靠 Puppet / Chef



    Appendix

    Machine lifecyle
    • installation 
    • initial configuration 
    • ongoing configuration and maintenance 
    • decommissioning

    2012年1月6日 星期五

    Benchmark on Linux (Phoronix Test Suite)

    因為要測試硬碟的 performance,所以上網找了很多 Benchmark,但意外的找到一個很贊的網站

    http://openbenchmarking.org/

    裡面收集了各種的 benchmark, 而且可以讓大家把 report 上傳,

    他其實是利用了 phoronix test suite 來做 benchmark

    http://www.phoronix-test-suite.com/

    安裝還滿容易的, 有 .deb 檔可以下載, 所以在 Debian / Ubuntu 很方便

    不過我在測試時遇到了個問題, 就是我有多顆硬碟, 但他總是只測試其中一顆而已, 但他似乎又沒有可以設定的地方, 找了很久後, 終於知道要怎麼解決, PTS 的作法是把所有安裝的東西都放在 ~/.phoronix-test-suite/installed-tests 之下, 然後就在這個目錄下執行, 這代表每個人執行時都要各別安裝一次, 很浪費空間, 但這也讓我找到簡單的處理方法

    作法就是更改 ~/.phoronix-test-suite/user-config.xml 內的 EnvironmentDirectory , 比方說你把你要測試的硬碟 mount 在 /mnt, 那你就把 EnvironmentDirectory 改到 /mnt/installed-tests, 同時為了不必重新安裝, 你可以暫時把 ~/.phoronix-test-suite/installed-tests 移到 /mnt 下, 這樣子去執行就可以測到你要測的硬碟了!

    ==

    2012.01.09 補

    如果要安裝在  CentOS 底下, 可以直接下載 .tar.gz 檔,  不過使用之前會需要先安裝一些套件

    yum install php
    yum install php-cli
    yum install php-gd
    yum install php-xml
    yum update "*php*"
    yum install php-pear
    yum install gcc
    pecl install json
    cd /etc/php.d/
    echo "extension=json.so" >> json.ini
    service httpd restart
    

    2012年1月4日 星期三