Fedora Unified Network Controllermmahut.fedorapeople.org/misc/func-redhat_devconf2011.pdf · What...
Transcript of Fedora Unified Network Controllermmahut.fedorapeople.org/misc/func-redhat_devconf2011.pdf · What...
![Page 2: Fedora Unified Network Controllermmahut.fedorapeople.org/misc/func-redhat_devconf2011.pdf · What is it? Fedora Unified Network Controler Runs commands on a large number of remote](https://reader034.fdocuments.in/reader034/viewer/2022042805/5f5d0a014744bc372b368857/html5/thumbnails/2.jpg)
The problem is simple
# rpm qV httpdRun this command ...
![Page 3: Fedora Unified Network Controllermmahut.fedorapeople.org/misc/func-redhat_devconf2011.pdf · What is it? Fedora Unified Network Controler Runs commands on a large number of remote](https://reader034.fdocuments.in/reader034/viewer/2022042805/5f5d0a014744bc372b368857/html5/thumbnails/3.jpg)
...On
this!
![Page 4: Fedora Unified Network Controllermmahut.fedorapeople.org/misc/func-redhat_devconf2011.pdf · What is it? Fedora Unified Network Controler Runs commands on a large number of remote](https://reader034.fdocuments.in/reader034/viewer/2022042805/5f5d0a014744bc372b368857/html5/thumbnails/4.jpg)
![Page 5: Fedora Unified Network Controllermmahut.fedorapeople.org/misc/func-redhat_devconf2011.pdf · What is it? Fedora Unified Network Controler Runs commands on a large number of remote](https://reader034.fdocuments.in/reader034/viewer/2022042805/5f5d0a014744bc372b368857/html5/thumbnails/5.jpg)
NC!
![Page 6: Fedora Unified Network Controllermmahut.fedorapeople.org/misc/func-redhat_devconf2011.pdf · What is it? Fedora Unified Network Controler Runs commands on a large number of remote](https://reader034.fdocuments.in/reader034/viewer/2022042805/5f5d0a014744bc372b368857/html5/thumbnails/6.jpg)
The solution is simple
https://fedorahosted.org/func/
![Page 7: Fedora Unified Network Controllermmahut.fedorapeople.org/misc/func-redhat_devconf2011.pdf · What is it? Fedora Unified Network Controler Runs commands on a large number of remote](https://reader034.fdocuments.in/reader034/viewer/2022042805/5f5d0a014744bc372b368857/html5/thumbnails/7.jpg)
What is it?
● Fedora Unified Network Controler● Runs commands on a large number of remote
machines ● Gather sane output● XMLRPC over SSL in Python
![Page 8: Fedora Unified Network Controllermmahut.fedorapeople.org/misc/func-redhat_devconf2011.pdf · What is it? Fedora Unified Network Controler Runs commands on a large number of remote](https://reader034.fdocuments.in/reader034/viewer/2022042805/5f5d0a014744bc372b368857/html5/thumbnails/8.jpg)
What is it?
● Command line or API● Supports Asynchronous mode● Supports bindings in YAML, JSON or Java● Modular
![Page 9: Fedora Unified Network Controllermmahut.fedorapeople.org/misc/func-redhat_devconf2011.pdf · What is it? Fedora Unified Network Controler Runs commands on a large number of remote](https://reader034.fdocuments.in/reader034/viewer/2022042805/5f5d0a014744bc372b368857/html5/thumbnails/9.jpg)
Func Overview
![Page 10: Fedora Unified Network Controllermmahut.fedorapeople.org/misc/func-redhat_devconf2011.pdf · What is it? Fedora Unified Network Controler Runs commands on a large number of remote](https://reader034.fdocuments.in/reader034/viewer/2022042805/5f5d0a014744bc372b368857/html5/thumbnails/10.jpg)
Func Overview
Overlord distributes command to Minions
yum -y install mencal
service jboss restart
![Page 11: Fedora Unified Network Controllermmahut.fedorapeople.org/misc/func-redhat_devconf2011.pdf · What is it? Fedora Unified Network Controler Runs commands on a large number of remote](https://reader034.fdocuments.in/reader034/viewer/2022042805/5f5d0a014744bc372b368857/html5/thumbnails/11.jpg)
Func Overview
Minions return output to the Overlord
service jboss restart
Package installed!
Command returned 0
![Page 12: Fedora Unified Network Controllermmahut.fedorapeople.org/misc/func-redhat_devconf2011.pdf · What is it? Fedora Unified Network Controler Runs commands on a large number of remote](https://reader034.fdocuments.in/reader034/viewer/2022042805/5f5d0a014744bc372b368857/html5/thumbnails/12.jpg)
Func examples
![Page 13: Fedora Unified Network Controllermmahut.fedorapeople.org/misc/func-redhat_devconf2011.pdf · What is it? Fedora Unified Network Controler Runs commands on a large number of remote](https://reader034.fdocuments.in/reader034/viewer/2022042805/5f5d0a014744bc372b368857/html5/thumbnails/13.jpg)
Func Command Line
func "*" call service restart httpd
func "*.example.org" call yumcmd update
func "db01*" call command run “du sh /var/db”}} } }
Minonhostname
ModuleMethod
Arguments
![Page 14: Fedora Unified Network Controllermmahut.fedorapeople.org/misc/func-redhat_devconf2011.pdf · What is it? Fedora Unified Network Controler Runs commands on a large number of remote](https://reader034.fdocuments.in/reader034/viewer/2022042805/5f5d0a014744bc372b368857/html5/thumbnails/14.jpg)
Func Python API
import func.overlord.client as fc
client = fc.Client("web*.example.org")
results = client.yumcmd.install(“httpd”)
results = client.service.start(“httpd”)
results = client.iptables.port.open(80)
![Page 15: Fedora Unified Network Controllermmahut.fedorapeople.org/misc/func-redhat_devconf2011.pdf · What is it? Fedora Unified Network Controler Runs commands on a large number of remote](https://reader034.fdocuments.in/reader034/viewer/2022042805/5f5d0a014744bc372b368857/html5/thumbnails/15.jpg)
Func Bindings
● YAML or JSON to func-transmit
client: server1.example.com
sync: False
nforks: 1
module: command
method: run
parameters: “uptime”
![Page 16: Fedora Unified Network Controllermmahut.fedorapeople.org/misc/func-redhat_devconf2011.pdf · What is it? Fedora Unified Network Controler Runs commands on a large number of remote](https://reader034.fdocuments.in/reader034/viewer/2022042805/5f5d0a014744bc372b368857/html5/thumbnails/16.jpg)
Func Bindings
# functransmit json < run.yaml["example1", [0, " 06:19:46 up 12 days...\n", ""]]
Or --yaml to get result back in YAML
![Page 17: Fedora Unified Network Controllermmahut.fedorapeople.org/misc/func-redhat_devconf2011.pdf · What is it? Fedora Unified Network Controler Runs commands on a large number of remote](https://reader034.fdocuments.in/reader034/viewer/2022042805/5f5d0a014744bc372b368857/html5/thumbnails/17.jpg)
MOAR!
Because MOAR!
![Page 18: Fedora Unified Network Controllermmahut.fedorapeople.org/misc/func-redhat_devconf2011.pdf · What is it? Fedora Unified Network Controler Runs commands on a large number of remote](https://reader034.fdocuments.in/reader034/viewer/2022042805/5f5d0a014744bc372b368857/html5/thumbnails/18.jpg)
Multiplexer
Execute batch of 1000 systems on 10 threads
# func –forks=10 "*" call service start puppetd
![Page 19: Fedora Unified Network Controllermmahut.fedorapeople.org/misc/func-redhat_devconf2011.pdf · What is it? Fedora Unified Network Controler Runs commands on a large number of remote](https://reader034.fdocuments.in/reader034/viewer/2022042805/5f5d0a014744bc372b368857/html5/thumbnails/19.jpg)
Asynchronous mode
Run (long-running) jobs in parallel without persistent network connection
![Page 20: Fedora Unified Network Controllermmahut.fedorapeople.org/misc/func-redhat_devconf2011.pdf · What is it? Fedora Unified Network Controler Runs commands on a large number of remote](https://reader034.fdocuments.in/reader034/viewer/2022042805/5f5d0a014744bc372b368857/html5/thumbnails/20.jpg)
Groups
Group your systems
# func “*” group –laGroup: zimbra Host: z01.example.com Host: z02.example.com Host: z03.example.comGroup: nagios Host: n01.example.com
![Page 21: Fedora Unified Network Controllermmahut.fedorapeople.org/misc/func-redhat_devconf2011.pdf · What is it? Fedora Unified Network Controler Runs commands on a large number of remote](https://reader034.fdocuments.in/reader034/viewer/2022042805/5f5d0a014744bc372b368857/html5/thumbnails/21.jpg)
Modules
Easy to write!
CommandCopyFile
DiskGetFileJboss
HardwareIptablesNagiosNetapp
RpmSmartSysctl
...
![Page 22: Fedora Unified Network Controllermmahut.fedorapeople.org/misc/func-redhat_devconf2011.pdf · What is it? Fedora Unified Network Controler Runs commands on a large number of remote](https://reader034.fdocuments.in/reader034/viewer/2022042805/5f5d0a014744bc372b368857/html5/thumbnails/22.jpg)
Modules (example)
import func_modulefrom func.minion import sub_process
class Reboot(func_module.FuncModule):
version = "0.0.1" api_version = "0.0.1" description = "Reboots a machine."
def reboot(self, when='now', message=''):
return sub_process.call(["/sbin/shutdown", 'r', ↵ when, message], close_fds=True)
![Page 23: Fedora Unified Network Controllermmahut.fedorapeople.org/misc/func-redhat_devconf2011.pdf · What is it? Fedora Unified Network Controler Runs commands on a large number of remote](https://reader034.fdocuments.in/reader034/viewer/2022042805/5f5d0a014744bc372b368857/html5/thumbnails/23.jpg)
Delegation
![Page 24: Fedora Unified Network Controllermmahut.fedorapeople.org/misc/func-redhat_devconf2011.pdf · What is it? Fedora Unified Network Controler Runs commands on a large number of remote](https://reader034.fdocuments.in/reader034/viewer/2022042805/5f5d0a014744bc372b368857/html5/thumbnails/24.jpg)
ACLs
X.509 PKI for ACLsIn certificate hashes
overlord.example.com = reboot, yum.update
![Page 25: Fedora Unified Network Controllermmahut.fedorapeople.org/misc/func-redhat_devconf2011.pdf · What is it? Fedora Unified Network Controler Runs commands on a large number of remote](https://reader034.fdocuments.in/reader034/viewer/2022042805/5f5d0a014744bc372b368857/html5/thumbnails/25.jpg)
OMG! Func rocks!
![Page 26: Fedora Unified Network Controllermmahut.fedorapeople.org/misc/func-redhat_devconf2011.pdf · What is it? Fedora Unified Network Controler Runs commands on a large number of remote](https://reader034.fdocuments.in/reader034/viewer/2022042805/5f5d0a014744bc372b368857/html5/thumbnails/26.jpg)
![Page 28: Fedora Unified Network Controllermmahut.fedorapeople.org/misc/func-redhat_devconf2011.pdf · What is it? Fedora Unified Network Controler Runs commands on a large number of remote](https://reader034.fdocuments.in/reader034/viewer/2022042805/5f5d0a014744bc372b368857/html5/thumbnails/28.jpg)
Similar projects
● Digmia Secure Shell (DSSH)● htttp://digmia.com/
● Marionetter Collective IP● Acquired by Puppet Labs
● Parallel SSH (PSSH)● http://code.google.com/p/parallel-ssh/
![Page 29: Fedora Unified Network Controllermmahut.fedorapeople.org/misc/func-redhat_devconf2011.pdf · What is it? Fedora Unified Network Controler Runs commands on a large number of remote](https://reader034.fdocuments.in/reader034/viewer/2022042805/5f5d0a014744bc372b368857/html5/thumbnails/29.jpg)
Questions?
![Page 30: Fedora Unified Network Controllermmahut.fedorapeople.org/misc/func-redhat_devconf2011.pdf · What is it? Fedora Unified Network Controler Runs commands on a large number of remote](https://reader034.fdocuments.in/reader034/viewer/2022042805/5f5d0a014744bc372b368857/html5/thumbnails/30.jpg)
Func you!
Func as in thank,don't be dirty-minded.
![Page 31: Fedora Unified Network Controllermmahut.fedorapeople.org/misc/func-redhat_devconf2011.pdf · What is it? Fedora Unified Network Controler Runs commands on a large number of remote](https://reader034.fdocuments.in/reader034/viewer/2022042805/5f5d0a014744bc372b368857/html5/thumbnails/31.jpg)
References and credits
http://www.flickr.com/photos/theplanetdotcom/4879421740/
http://www.flickr.com/photos/13106517@N02/4630118749/
http://www.flickr.com/photos/richardlowkes/10302456/
http://www.flickr.com/photos/amoates/5206175248/
http://www.flickr.com/photos/dokas/5289794748/
http://www.flickr.com/photos/a_aepli/4946005857/
http://www.flickr.com/photos/donaldmacleod/4572341460/
http://www.flickr.com/photos/shadowgate/4517058755/
http://www.flickr.com/photos/suswar/4244118452/
http://www.flickr.com/photos/ideacreamanuelapps/3541383441/
http://www.flickr.com/photos/quinnanya/5351196252/