SlideShare une entreprise Scribd logo
1  sur  28
Télécharger pour lire hors ligne
R.I.Pienaar
26 April 2017
How Choria Improves the
Operability of MCollective using
NATS
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
Who am I?
• Consultant for 20+ years
• Government, Finance, Health, Social Media,
Fortune 50, Startups
• DevOps, Automation, Architect,
Development
• Open Source @ github.com/ripienaar
• Architect and Author of many Puppet
related tools
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
MCollective - Overview
• Large scale Operations orientated RPC framework
• Provides ad-hoc orchestration within the Puppet eco
system
• Flexible discovery that integrates into many data sources
• Strong Authentication, Authorisation, Auditing
• Extendible using Ruby
• Communications over Middleware
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
$ mco rpc service restart service=httpd -W country=uk -W customer=acme
* [ ============================================================> ] 15 / 15
windev1.example.net Unknown Request Status
Cannot stop https, error was: Execution of 'C:/WINDOWS/system32/net.exe stop httpd'
returned 2: The service name is invalid.
Summary of Service Status:
running = 14
unknown = 1
Finished processing 15 / 15 hosts in 8352.48 ms
MCollective - CLI
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
$ mco rpc service restart service=httpd -W country=uk -W customer=acme
* [ ============================================================> ] 15 / 15
windev1.example.net Unknown Request Status
Cannot stop https, error was: Execution of 'C:/WINDOWS/system32/net.exe stop httpd'
returned 2: The service name is invalid.
Summary of Service Status:
running = 14
unknown = 1
Finished processing 15 / 15 hosts in 8352.48 ms
MCollective - CLI
Context aware summaries
“service” api
“restart” action discovery
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
$ irb -r mcollective
irb(main):001:0> include MCollective::RPC
=> Object
irb(main):002:0> client = rpcclient("service")
=> …
irb(main):003:0> client.fact_filter("cluster", "a")
=> nil
irb(main):004:0> client.discover
=> ["dev1-1.choria"]
irb(main):005:0> client.progress = false
=> false
irb(main):006:0> puts client.status(:service => "sshd").first.to_json
{"agent":"service","action":"status","sender":"dev1-1.choria","statuscode":
0,"statusmsg":"OK","data":{"status":"running"}}
MCollective - API
“service” api
discovery
“status” action
result from 1 node
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
MCollective - Web
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
MCollective - Installation
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
MCollective - Installation
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
MCollective - Installation
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
MCollective - Installation
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
MCollective - Installation
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
MCollective - Installation
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
MCollective - Installation
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
MCollective - Installation
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
Modernising MCollective
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
Playbooks
Ease of Installation
Modern PKISRV Records
AuditingPuppetDB Integration
Improved
Connectivity
Batteries Included
JSON
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
Choria - Middleware Needs
• Easy to deploy
• Easy to secure using standard TLS
• Easy to operate and monitor
• Must be scalable and highly available
• Good documentation
• Responsive community
• Good Ruby support - but others needed too
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
HTTP Monitoring
Single binary install
TLS
Good docs
and comm
Good trace logging
Full Mesh
Clustering
Many languages
supported
Scalable to
thousands
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
NATS - Configuration
$ gnatsd 
--tls
--tlscert ssl/nats1.example.net.pem 
--tlskey ssl/nats1.example.net.key 
--tlscacert ssl/ca.pem
--tlsverify 
-l logs/nats-0.log 
-p 4222 
-m 8222 
--cluster nats://nats2.example.net:4223 
--routes nats://nats2.example.net:4223 
-DV
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
NATS - Configuration
port: 4222
monitor_port: 8222
tls {
cert_file: “ssl/nats1.example.net.pem"
key_file: “ssl/nats1.example.net.key"
ca_file: "ssl/ca.pem"
verify: true
}
cluster {
port: 4223
tls {
cert_file: “ssl/nats1.example.net.pem”
key_file: “ssl/nats1.example.net.key”
ca_file: "ssl/ca.pem"
verify: true
timeout: 2
}
routes = [
nats-route://nats2.example.net:4223
]
}
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
NATS - Monitoring
% curl -s localhost:8222/varz| 
./jq '"port: (.port) uptime: (.uptime) connections: (.connections)”’
"port: 4222 uptime: 33d12h9m33s connections: 16"
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
Federating NATS Clusters
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
Choria - Federation
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
Links
https://choria.io/
https://nats.io/
https://docs.puppet.com/mcollective
https://www.devco.net/
R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
Questions?
twitter: @ripienaar
email: rip@devco.net
blog: www.devco.net
github: ripienaar
freenode: Volcane
slack.puppet.com: ripienaar
https://www.devco.net/

Contenu connexe

Plus de Apcera

Plus de Apcera (20)

Implementing Microservices with NATS
Implementing Microservices with NATSImplementing Microservices with NATS
Implementing Microservices with NATS
 
NATS for Modern Messaging and Microservices
NATS for Modern Messaging and MicroservicesNATS for Modern Messaging and Microservices
NATS for Modern Messaging and Microservices
 
Actor Patterns and NATS - Boulder Meetup
Actor Patterns and NATS - Boulder MeetupActor Patterns and NATS - Boulder Meetup
Actor Patterns and NATS - Boulder Meetup
 
NATS Connector Framework - Boulder Meetup
NATS Connector Framework - Boulder MeetupNATS Connector Framework - Boulder Meetup
NATS Connector Framework - Boulder Meetup
 
Simple Solutions for Complex Problems - Boulder Meetup
Simple Solutions for Complex Problems - Boulder MeetupSimple Solutions for Complex Problems - Boulder Meetup
Simple Solutions for Complex Problems - Boulder Meetup
 
Patterns for Asynchronous Microservices with NATS
Patterns for Asynchronous Microservices with NATSPatterns for Asynchronous Microservices with NATS
Patterns for Asynchronous Microservices with NATS
 
NATS vs HTTP
NATS vs HTTPNATS vs HTTP
NATS vs HTTP
 
Micro on NATS - Microservices with Messaging
Micro on NATS - Microservices with MessagingMicro on NATS - Microservices with Messaging
Micro on NATS - Microservices with Messaging
 
NATS: A Central Nervous System for IoT Messaging - Larry McQueary
NATS: A Central Nervous System for IoT Messaging - Larry McQuearyNATS: A Central Nervous System for IoT Messaging - Larry McQueary
NATS: A Central Nervous System for IoT Messaging - Larry McQueary
 
Securing the Cloud Native Stack
Securing the Cloud Native StackSecuring the Cloud Native Stack
Securing the Cloud Native Stack
 
Simple Solutions for Complex Problems
Simple Solutions for Complex Problems Simple Solutions for Complex Problems
Simple Solutions for Complex Problems
 
How to Migrate to Cloud with Complete Confidence and Trust
How to Migrate to Cloud with Complete Confidence and TrustHow to Migrate to Cloud with Complete Confidence and Trust
How to Migrate to Cloud with Complete Confidence and Trust
 
KURMA - A Containerized Container Platform - KubeCon 2016
KURMA - A Containerized Container Platform - KubeCon 2016KURMA - A Containerized Container Platform - KubeCon 2016
KURMA - A Containerized Container Platform - KubeCon 2016
 
Integration Patterns and Anti-Patterns for Microservices Architectures
Integration Patterns and Anti-Patterns for Microservices ArchitecturesIntegration Patterns and Anti-Patterns for Microservices Architectures
Integration Patterns and Anti-Patterns for Microservices Architectures
 
NATS: Control Flow for Distributed Systems
NATS: Control Flow for Distributed SystemsNATS: Control Flow for Distributed Systems
NATS: Control Flow for Distributed Systems
 
Kubernetes, The Day After
Kubernetes, The Day AfterKubernetes, The Day After
Kubernetes, The Day After
 
Policy-based Cloud Storage: Persisting Data in a Multi-Site, Multi-Cloud World
Policy-based Cloud Storage: Persisting Data in a Multi-Site, Multi-Cloud WorldPolicy-based Cloud Storage: Persisting Data in a Multi-Site, Multi-Cloud World
Policy-based Cloud Storage: Persisting Data in a Multi-Site, Multi-Cloud World
 
Integration Patterns for Microservices Architectures
Integration Patterns for Microservices ArchitecturesIntegration Patterns for Microservices Architectures
Integration Patterns for Microservices Architectures
 
Nats meetup sf 20150826
Nats meetup sf   20150826Nats meetup sf   20150826
Nats meetup sf 20150826
 
Microservices: Notes From The Field
Microservices: Notes From The FieldMicroservices: Notes From The Field
Microservices: Notes From The Field
 

Dernier

Dernier (20)

The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 

How Choria Improves the Operability of MCollective using NATS

  • 1. R.I.Pienaar 26 April 2017 How Choria Improves the Operability of MCollective using NATS
  • 2. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar Who am I? • Consultant for 20+ years • Government, Finance, Health, Social Media, Fortune 50, Startups • DevOps, Automation, Architect, Development • Open Source @ github.com/ripienaar • Architect and Author of many Puppet related tools
  • 3. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar MCollective - Overview • Large scale Operations orientated RPC framework • Provides ad-hoc orchestration within the Puppet eco system • Flexible discovery that integrates into many data sources • Strong Authentication, Authorisation, Auditing • Extendible using Ruby • Communications over Middleware
  • 4. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar $ mco rpc service restart service=httpd -W country=uk -W customer=acme * [ ============================================================> ] 15 / 15 windev1.example.net Unknown Request Status Cannot stop https, error was: Execution of 'C:/WINDOWS/system32/net.exe stop httpd' returned 2: The service name is invalid. Summary of Service Status: running = 14 unknown = 1 Finished processing 15 / 15 hosts in 8352.48 ms MCollective - CLI
  • 5. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar $ mco rpc service restart service=httpd -W country=uk -W customer=acme * [ ============================================================> ] 15 / 15 windev1.example.net Unknown Request Status Cannot stop https, error was: Execution of 'C:/WINDOWS/system32/net.exe stop httpd' returned 2: The service name is invalid. Summary of Service Status: running = 14 unknown = 1 Finished processing 15 / 15 hosts in 8352.48 ms MCollective - CLI Context aware summaries “service” api “restart” action discovery
  • 6. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar $ irb -r mcollective irb(main):001:0> include MCollective::RPC => Object irb(main):002:0> client = rpcclient("service") => … irb(main):003:0> client.fact_filter("cluster", "a") => nil irb(main):004:0> client.discover => ["dev1-1.choria"] irb(main):005:0> client.progress = false => false irb(main):006:0> puts client.status(:service => "sshd").first.to_json {"agent":"service","action":"status","sender":"dev1-1.choria","statuscode": 0,"statusmsg":"OK","data":{"status":"running"}} MCollective - API “service” api discovery “status” action result from 1 node
  • 7. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar MCollective - Web
  • 8. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar MCollective - Installation
  • 9. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar MCollective - Installation
  • 10. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar MCollective - Installation
  • 11. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar MCollective - Installation
  • 12. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar MCollective - Installation
  • 13. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar MCollective - Installation
  • 14. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar MCollective - Installation
  • 15. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar MCollective - Installation
  • 16. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
  • 17. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar Modernising MCollective
  • 18. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar Playbooks Ease of Installation Modern PKISRV Records AuditingPuppetDB Integration Improved Connectivity Batteries Included JSON
  • 19. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar Choria - Middleware Needs • Easy to deploy • Easy to secure using standard TLS • Easy to operate and monitor • Must be scalable and highly available • Good documentation • Responsive community • Good Ruby support - but others needed too
  • 20. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar
  • 21. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar HTTP Monitoring Single binary install TLS Good docs and comm Good trace logging Full Mesh Clustering Many languages supported Scalable to thousands
  • 22. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar NATS - Configuration $ gnatsd --tls --tlscert ssl/nats1.example.net.pem --tlskey ssl/nats1.example.net.key --tlscacert ssl/ca.pem --tlsverify -l logs/nats-0.log -p 4222 -m 8222 --cluster nats://nats2.example.net:4223 --routes nats://nats2.example.net:4223 -DV
  • 23. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar NATS - Configuration port: 4222 monitor_port: 8222 tls { cert_file: “ssl/nats1.example.net.pem" key_file: “ssl/nats1.example.net.key" ca_file: "ssl/ca.pem" verify: true } cluster { port: 4223 tls { cert_file: “ssl/nats1.example.net.pem” key_file: “ssl/nats1.example.net.key” ca_file: "ssl/ca.pem" verify: true timeout: 2 } routes = [ nats-route://nats2.example.net:4223 ] }
  • 24. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar NATS - Monitoring % curl -s localhost:8222/varz| ./jq '"port: (.port) uptime: (.uptime) connections: (.connections)”’ "port: 4222 uptime: 33d12h9m33s connections: 16"
  • 25. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar Federating NATS Clusters
  • 26. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar Choria - Federation
  • 27. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar Links https://choria.io/ https://nats.io/ https://docs.puppet.com/mcollective https://www.devco.net/
  • 28. R.I.Pienaar | rip@devco.net | http://devco.net | @ripienaar Questions? twitter: @ripienaar email: rip@devco.net blog: www.devco.net github: ripienaar freenode: Volcane slack.puppet.com: ripienaar https://www.devco.net/