我得到错误
[anadi@bangda ~]# tail -f /var/log/nginx/error.log
[ pid=19741 thr=23597654217140 file=utils.rb:176 time=2012-09-17 12:52:43.307 ]: *** Exception LoadError in PhusionPassenger::Rack::ApplicationSpawner (no such file to load -- puppet/application/master) (process 19741, thread #<Thread:0x2aec83982368>):
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from config.ru:13
from /usr/local/lib/ruby/gems/1.8/gems/rack-1.4.1/lib/rack/builder.rb:51:in `instance_eval'
from /usr/local/lib/ruby/gems/1.8/gems/rack-1.4.1/lib/rack/builder.rb:51:in `initialize'
from config.ru:1:in `new'
from config.ru:1
当我启动配置了 passenger 模块的 nginx 服务器时,puppet master 配置为通过机架运行。
这里是 config.ru
[anadi@bangda ~]# cat /etc/puppet/rack/config.ru
# a config.ru, for use with every rack-compatible webserver.
# SSL needs to be handled outside this, though.
# if puppet is not in your RUBYLIB:
#$:.unshift('/usr/share/puppet/lib')
$0 = "master"
# if you want debugging:
# ARGV << "--debug"
ARGV << "--rack"
require 'puppet/application/master'
# we're usually running inside a Rack::Builder.new {} block,
# therefore we need to call run *here*.
run Puppet::Application[:master].run
puppet master 的 nginx 配置如下
[anadi@bangda ~]# cat /etc/nginx/conf.d/puppet-master.conf
server {
listen 8140 ssl;
server_name bangda.mycompany.com;
passenger_enabled on;
passenger_set_cgi_param HTTP_X_CLIENT_DN $ssl_client_s_dn;
passenger_set_cgi_param HTTP_X_CLIENT_VERIFY $ssl_client_verify;
access_log /var/log/nginx/puppet/master.access.log;
error_log /var/log/nginx/puppet/master.error.log;
root /etc/puppet/rack/public;
ssl_certificate /var/lib/puppet/ssl/certs/bangda.mycompany.com.pem;
ssl_certificate_key /var/lib/puppet/ssl/private_keys/bangda.mycompany.com.pem;
ssl_crl /var/lib/puppet/ssl/ca/ca_crl.pem;
ssl_client_certificate /var/lib/puppet/ssl/certs/ca.pem;
ssl_ciphers SSLv2:-LOW:-EXPORT:RC4+RSA;
ssl_prefer_server_ciphers on;
ssl_verify_client optional;
ssl_verify_depth 1;
ssl_session_cache shared:SSL:128m;
ssl_session_timeout 5m;
}
然而,当我通过常用的 puppetmasterd 守护进程运行 puppet 时,它可以完美无误地运行。
我能以某种方式看到 nginx+passenger+rack 设置无法初始化,而在运行 natvie puppetmaster 守护程序时同样有效。
我缺少任何配置吗?
更新: 由于@Shane Madden 的评论,解决了它的工作
傀儡位于
/usr/lib/ruby/site_ruby/1.8/puppet/application/master.rb
而 ruby 库期望它从
/usr/local/lib/ruby/site_ruby/1.8/
因此像这样改变了config.ru
# a config.ru, for use with every rack-compatible webserver.
# SSL needs to be handled outside this, though.
# if puppet is not in your RUBYLIB:
$:.unshift('/usr/lib/ruby/site_ruby/1.8/')
$0 = "master"
# if you want debugging:
# ARGV << "--debug"
ARGV << "--rack"
require 'puppet/application/master'
# we're usually running inside a Rack::Builder.new {} block,
# therefore we need to call run *here*.
run Puppet::Application[:master].run
现在工作。
由于@Shane Madden 的评论,解决了它的工作
傀儡位于
/usr/lib/ruby/site_ruby/1.8/puppet/application/master.rb
而 ruby 库期望它从
/usr/local/lib/ruby/site_ruby/1.8/
因此像这样改变了config.ru
现在工作。