Intro to Systems Orchestration with MCollective

38
Intro to Systems Orchestra0on With MCollec0ve

Transcript of Intro to Systems Orchestration with MCollective

Intro  to  Systems  Orchestra0on  With  MCollec0ve  

What  is  Orchestra0on?  

Hello!  

R.I.Pienaar  

(h>p://www.devco.net/)  

THANK  YOU!  

Middleware  

Agents  ==  sheet  music  

Collec0ves  

Filters  ==  find  a  sec0on  

Use  this  stuff  

Using  it  ==  direct  one  sec0on  

Yeah,  not  an  orchestra  yet  

What  to  do?  

#!/bin/bash  -­‐e  for  node  in  $(mco  find  -­‐-­‐np  -­‐C  roles::node)  do      echo  "restar0ng  ssh  on  $node"      mco  service  -­‐-­‐np  sshd  restart  -­‐I  $node  >/dev/null      sleep  2      mco  rpc  service  status  service=sshd  -­‐I  $node  -­‐j  |  \          jgrep  data.status=running  -­‐s  data.status  >/dev/null      echo  "ssh  is  up  on  $node"  done  

#!/usr/bin/ruby    require  'mcollec0ve'  require  'pp'    include  MCollec0ve::RPC    #  discover  u0l  =  rpcclient("rpcu0l")  u0l.progress  =  false  u0l.class_filter  /roles::node/  nodes  =  []  u0l.ping.each  do  |resp|      nodes  <<  resp[:sender]  end  u0l.disconnect    nodes.each  do  |node|      srv  =  rpcclient("service")      srv.progress  =  false      srv.iden0ty_filter  node      puts  "restar0ng  sshd  on  #{node}"      srv.restart(:service  =>  "sshd")      srv.reset    <snip>  

Ques0ons?  

Come  Work  for  Us!