Automação e DevOps
  tome o controle da sua infraestrutura


       fabio.kung@gmail.com
    fabio.kung@locaweb.com.br
   ...
Administração Remota
Gerenciador




                                ...
DHCP     Proxy       Firewall
Gerenciador




WS WS WS   WS WS WS      WS WS WS
                                     ...
 DHCP        Proxy        Firew...
Gerenciador

           WS   WS




WS WS WS   WS WS WS      WS WS WS
                                     ...
 DHCP      ...
Gerenciador

           WS   WS




WS WS WS   WS WS WS      WS WS WS
                                     ...
 DHCP      ...
Gerenciador

           WS   WS


            Autenticação?
            Monitoração?
            Criptografia?
            ...
Gerenciador

           WS   WS




           ESB
WS WS WS   WS WS WS      WS WS WS
                                     ...
Gerenciador

           WS   WS




           ESB
WS WS WS   WS WS WS      WS WS WS
                                     ...
Gerenciador

           WS   WS




           ESB
WS WS WS   WS WS WS      WS WS WS
                                     ...
KI
     SSH
Gerenciador
          Logica
                          sudoers,
                      pub/priv keypairs




 SSH       SSH...
SSHService
require "net/ssh"

Net::SSH.start("host", "user", options) do |ssh|
  ssh_result = ssh.open_channel do |channel|
    chann...
Controle de tarefas
     Mundo Assíncrono




      fuja de filas no DB!
Resque
Instant Messaging
XMPP JIDs


username@domain /resource
fabiokung@servidor
machine01@servidor




                     machine02@servidor

fabiokung@servidor




                     machine03@serv...
installer@servidor




                        cloner@servidor

fabiokung@servidor




                     uninstaller@se...
XMPP4R
http://home.gna.org/xmpp4r
múltiplos workers


                      installer@servidor




                             ...
frontend@servidor




  ...
frontend@servidor   installer@servidor/A




                           ...
                    installer@servidor/B
quem pode?
                    to: installer@servidor

frontend@servidor                            installer@servidor/A

...
quem pode?
                      to: installer@servidor

                                                 installer@servid...
quem pode?
                      to: installer@servidor

                                                 installer@servid...
quem pode?
                      to: installer@servidor

                                                 installer@servid...
presença,
pubsub...
Configuration
Management
•Puppet
•Chef
•CFEngine
Chef
recipes
                            chef-client


               recipes


chef-server       recipes   chef-client




   ...
file "/etc/myapp.conf" do
  owner www-data
  group www-data
  mode "0600"
  action :create
end

package "mysql-server" do
...
package "sudo" do
  action :upgrade
end

user "sshservice" do
  system true
  action :create
end

template "/etc/sudoers" ...
bundle common control
{
    bundlesequence => { "ssh" };
    inputs => { "cfengine_stdlib.cf" }
}

bundle agent ssh
{
    ...
http://cookbooks.opscode.com

 http://github.com/37signals/37s_cookbooks

http://github.com/engineyard/ey-cloud-recipes
continuous   Deployment
Capistrano
Chef?
deploy "/srv/my-cms" do
  repo "git://github.com/radiant/radiant.git"
  revision "HEAD"
  user "cms"
  migrate true
...
Pacotes!
 deb, rpm, ...
require'drb';F,D,C,P,M,U,*O=File,Class,Dir,*ARGV;def s(p)F.split(p[/[^|].*/])[-1
]end;def c(u);DRbObject.new((),u)end;def ...
Dúvidas?




   fabio.kung@gmail.com
fabio.kung@locaweb.com.br      Obrigado!
http://twitter.com/fabiokung
Automacao devops
Upcoming SlideShare
Loading in …5
×

Automacao devops

1,903 views

Published on

Algumas idéias e discussão sobre automação de infraestrutura. Como trazer as idéias e práticas do mundo dos desenvolvedores para o trabalho de sysadmins e vice-versa?

0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,903
On SlideShare
0
From Embeds
0
Number of Embeds
36
Actions
Shares
0
Downloads
3
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

  • assincrono











  • solido
    redis
    tonf of plugins




























  • Automacao devops

    1. 1. Automação e DevOps tome o controle da sua infraestrutura fabio.kung@gmail.com fabio.kung@locaweb.com.br @fabiokung
    2. 2. Administração Remota
    3. 3. Gerenciador ... DHCP Proxy Firewall
    4. 4. Gerenciador WS WS WS WS WS WS WS WS WS ... DHCP Proxy Firewall
    5. 5. Gerenciador WS WS WS WS WS WS WS WS WS WS WS ... DHCP Proxy Firewall
    6. 6. Gerenciador WS WS WS WS WS WS WS WS WS WS WS ... DHCP Proxy Firewall
    7. 7. Gerenciador WS WS Autenticação? Monitoração? Criptografia? ... WS WS WS WS WS WS WS WS WS ... DHCP Proxy Firewall
    8. 8. Gerenciador WS WS ESB WS WS WS WS WS WS WS WS WS ... DHCP Proxy Firewall
    9. 9. Gerenciador WS WS ESB WS WS WS WS WS WS WS WS WS ... DHCP Proxy Firewall
    10. 10. Gerenciador WS WS ESB WS WS WS WS WS WS WS WS WS ... DHCP Proxy Firewall
    11. 11. KI SSH
    12. 12. Gerenciador Logica sudoers, pub/priv keypairs SSH SSH SSH ... DHCP Proxy Firewall
    13. 13. SSHService
    14. 14. require "net/ssh" Net::SSH.start("host", "user", options) do |ssh|   ssh_result = ssh.open_channel do |channel|     channel.exec command     channel.on_data { |ch, data| ch[:out] << data }     channel.on_extended_data { |ch, type, data| ch[:out] << data }     channel.on_request("exit-status") do |ch, request| ch[:status] = request.read_long end   end   ssh.loop end
    15. 15. Controle de tarefas Mundo Assíncrono fuja de filas no DB!
    16. 16. Resque
    17. 17. Instant Messaging
    18. 18. XMPP JIDs username@domain /resource
    19. 19. fabiokung@servidor
    20. 20. machine01@servidor machine02@servidor fabiokung@servidor machine03@servidor
    21. 21. installer@servidor cloner@servidor fabiokung@servidor uninstaller@servidor
    22. 22. XMPP4R http://home.gna.org/xmpp4r
    23. 23. múltiplos workers installer@servidor ... frontend@servidor installer@servidor
    24. 24. frontend@servidor installer@servidor/A ... installer@servidor/B
    25. 25. quem pode? to: installer@servidor frontend@servidor installer@servidor/A ... installer@servidor/B
    26. 26. quem pode? to: installer@servidor installer@servidor/A frontend@servidor eu posso! from: installer@servidor/A ... eu posso! from: installer@servidor/B installer@servidor/B
    27. 27. quem pode? to: installer@servidor installer@servidor/A frontend@servidor eu posso! from: installer@servidor/A ... eu posso! from: installer@servidor/B ok, então instala! to: installer@servidor/B installer@servidor/B
    28. 28. quem pode? to: installer@servidor installer@servidor/A frontend@servidor eu posso! from: installer@servidor/A ... ... eu posso! from: installer@servidor/B ok, então instala! to: installer@servidor/B frontend@servidor installer@servidor/B
    29. 29. presença, pubsub...
    30. 30. Configuration Management
    31. 31. •Puppet •Chef •CFEngine
    32. 32. Chef
    33. 33. recipes chef-client recipes chef-server recipes chef-client chef-client
    34. 34. file "/etc/myapp.conf" do   owner www-data   group www-data   mode "0600"   action :create end package "mysql-server" do   action :install end execute "open http port" do   command "iptables -I INPUT -p tcp --dport 80 -j ACCEPT"   creates "/var/run/http_port_opened" end
    35. 35. package "sudo" do   action :upgrade end user "sshservice" do   system true   action :create end template "/etc/sudoers" do   source "sudoers.erb"   mode 0440   owner "root"   group "root"   variables(:user => "sshservice")   action :create end
    36. 36. bundle common control {     bundlesequence => { "ssh" };     inputs => { "cfengine_stdlib.cf" } } bundle agent ssh {     packages:         "sudo"             package_policy => "add"             package_method => "deb"     files:         "/etc/sudoers"             edit_defaults => empty,             edit_line => expand_template("sudoers.in"),             perms => mog("0440", root, root),             create => "true";     methods:         "sshservice" usebundle => create_user("sshservice") }
    37. 37. http://cookbooks.opscode.com http://github.com/37signals/37s_cookbooks http://github.com/engineyard/ey-cloud-recipes
    38. 38. continuous Deployment
    39. 39. Capistrano
    40. 40. Chef? deploy "/srv/my-cms" do   repo "git://github.com/radiant/radiant.git"   revision "HEAD"   user "cms"   migrate true   migration_command "rake db:migrate"   environment "production"   action :deploy   restart_command "touch tmp/restart.txt" end
    41. 41. Pacotes! deb, rpm, ...
    42. 42. require'drb';F,D,C,P,M,U,*O=File,Class,Dir,*ARGV;def s(p)F.split(p[/[^|].*/])[-1 ]end;def c(u);DRbObject.new((),u)end;def x(u)[P,u].hash;end;M=="client"&&c(U).f( x(U)).each{|n|p,c=x(n),c(n);(c.f(p,O[0],0).map{|f|s f}-D["*"]).each{|f|F.open(f, "w"){|o|o<<c.f(p,f,1)}}}||(DRb.start_service U,C.new{def f(c,a=[],t=2)c==x(U)&&( t==0&&D[s(a)]||t==1&&F.read(s(a))||p(a))end;def y()(p(U)+p).each{|u|c(u).f(x(u), p(U))rescue()};self;end;private;def p(x=[]);O.push(*x).uniq!;O;end}.new.y;sleep) http://ansuz.sooke.bc.ca/software/molester/2004121602.php P2P
    43. 43. Dúvidas? fabio.kung@gmail.com fabio.kung@locaweb.com.br Obrigado! http://twitter.com/fabiokung

    ×