设为首页 收藏本站
查看: 703|回复: 0

[经验分享] WEBrick/Rack Puppet Master

[复制链接]
发表于 2015-9-16 10:36:27 | 显示全部楼层 |阅读模式
Puppet's Services: The WEBrick Puppet Master
  Puppet master is the application that compiles configurations for any number of puppet agent nodes, using Puppet code and various other data sources.
  Puppet has the built-in capability to run a complete puppet master server using Ruby’s WEBrick library.
  The WEBrick puppet master server is not capable of handling production-level numbers of agent nodes. Since it can’t handle concurrent connections, it will be quickly overwhelmed by as few as 10 agents. You should never run a WEBrick puppet master in production, and should always configure a Rack puppet master server instead.
Controlling the Service
  The WEBrick puppet master runs as a single Ruby process. You can manage it in one of two ways.
1.Use the puppetmaster Init Script
2.Run puppet master on the Command Line
The WEBrick Puppet Master’s Run Environment
  The WEBrick puppet master runs as a single Ruby process. This single process does everything related to handling puppet agent requests: It terminates SSL, routes HTTP requests, and executes the Ruby methods that recognize agent requests and build responses to them.
Configuring a WEBrick Puppet Master
  As described elsewhere, the puppet master application reads most of its settings from puppet.conf and can accept additional settings on the command line.
  When running from the command line, puppet master can directly accept command line options. When running via an init script, it sometimes gets command line options from an init script config file. The location and format of this file will vary depending on your platform.
  To change the puppet master’s settings, you should generally use puppet.conf. The only two options you may want to set on the command line or in the init script config file are --verbose or --debug, to change the amount of detail in the logs.
  
  -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Puppet's Services: The Rack Puppet Master
  Puppet includes a basic puppet master web server based on Ruby’s WEBrick library. (This is what Puppet uses if you run puppet master on the command line or use most puppetmaster init scripts.)
  You cannot use this default server for real-life loads, as it can’t handle concurrent connections; it is only suitable for small tests with ten nodes or fewer. You must configure a production quality web server before you start managing your nodes with Puppet.
  Any Rack-based application server stack will work with a puppet master, but if you don’t have any particular preference, you should use Passenger combined with Apache. This guide shows how to configure Puppet with this software.
Controlling the Service
  Under Rack, the puppet master processes are started and managed by your Rack web server. The way to start and stop the puppet master will depend on your specific web server stack.
  If your Rack stack isn’t running any other applications or sites, you can simply start and stop the whole server process; if it also provides other services, as a Passenger/Apache stack sometimes does, you may need to disable the puppet master’s virtual host and do a graceful restart.
The Rack Puppet Master’s Run Environment
  Rack and the puppet master application each have various expectations about their environment. To make them work together, you’ll need to make sure these expectations are met.
Configuring a Rack Puppet Master
  As described elsewhere, the puppet master application reads most of its settings from puppet.conf and can accept additional settings on the command line. When running under Rack, puppet master gets its command line options from the config.ru file. By default, it only sets the confdir and vardir settings and the special --rack option.
  To change the puppet master’s settings, you should use puppet.conf. The only two options you may want to set in config.ru are --verbose or --debug, to change the amount of detail in the logs.
  -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Aside: How a Rack Puppet Master Works
  A Rack web server loads and executes a special part of Puppet’s Ruby code, which creates a puppet master application object that can respond to specially formatted requests. To handle parallel requests, it can do this any number of times. (The number of workers depends on how the Rack server is configured.)
  When an HTTPS request comes in, the web server passes it to Rack. Rack reformats the request, turning it into a Ruby object that contains all of the relevant information (URL, method, POST data, headers, SSL info). It then passes the formatted request to the application object.
  The puppet master application reads information from the request, then builds a response, doing whatever is necessary to construct it. This may involve returning file contents, returning certificates or other credentials, or the full process of catalog compilation (request a node object from an ENC, evaluate the main manifest, load and evaluate classes from modules, evaluate templates, collect exported resources, etc.). The puppet master object then formats its response and passes it to Rack, which passes it on to the web server and the agent node that made the request.

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-114360-1-1.html 上篇帖子: puppet中anchor的作用 下篇帖子: puppet 安装
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表