# Author:fairylly
1、puppetmaster启动失败
问题描述:
[root@mx puppet-3.3.1]# service puppetmaster start
Starting puppetmaster: /bin/bash: /usr/bin/puppet: /usr/bin/ruby: bad interpreter: No such file or directory
[FAILED]
解决方法:
[root@mx puppet-3.3.1]# whereis ruby
ruby: /usr/lib/ruby /usr/local/bin/ruby /usr/local/lib/ruby
vi /usr/bin/puppet
#!/usr/bin/ruby
修改为=》
#!/usr/local/bin/ruby
2、puppet agent --test提示Could not evaluate: Could not retrieve information from environment production source(s) puppet://puppetmaster.com/plugins
问题描述:
[root@mx ~]# puppet agent --test
Info: Retrieving plugin
Error: /File[/var/lib/puppet/lib]: Could not evaluate: Could not retrieve information from environment production source(s) puppet://puppetmaster.com/plugins
Info: Caching catalog for puppetclient1.com
Info: Applying configuration version '1382687178'
Notice: Finished catalog run in 0.03 seconds
解决方法:
服务端及客户端的/etc/puppet/puppet.conf配置文件中,指明:
pluginsync=false
重启puppetmaster/puppet服务,即可解决;
如果不设置pluginsync=false,那么就需要至少建个插件。
3、puppet agent --test提示SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
问题描述:
[root@mx puppet]# puppet agent --test
Warning: Unable to fetch my node definition, but the agent run will continue:
Warning: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed: [certificate signature failure for /CN=puppetmaster.com]
Info: Retrieving plugin
Error: /File[/var/lib/puppet/lib]: Failed to generate additional resources using 'eval_generate': SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed: [certificate signature failure for /CN=puppetmaster.com]
Error: /File[/var/lib/puppet/lib]: Could not evaluate: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed: [certificate signature failure for /CN=puppetmaster.com] Could not retrieve file metadata for puppet://puppetmaster.com/plugins: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed: [certificate signature failure for /CN=puppetmaster.com]
Error: Could not retrieve catalog from remote server: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed: [certificate signature failure for /CN=puppetmaster.com]
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
Error: Could not send report: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed: [certificate signature failure for /CN=puppetmaster.com]
解决方法:
客户端删除现有ssl证书:
find /var/lib/puppet -type f -print0 |xargs -0r rm
服务端进行客户端证书删除操作:
puppet cert clean puppetclient1.com
客户端重新注册:
rm -f /var/lib/puppet/ssl/certs/puppetclient1.com.pem
puppet agent -t
服务端同意注册:
puppet cert sign puppetclient1.com
确认注册成功:
puppet agent -t
4、puppet agent --test提示not qualified and no path was specified. Please qualify the command or specify a path
问题描述:
exec { 'update-131018':
command => './update-131018.sh',
}
[root@mx /]# puppet agent -t
Info: Retrieving plugin
Info: Caching catalog for puppetclient1.com
Error: Failed to apply catalog: Validation of Exec[update-131018] failed: './update-131018.sh' is not qualified and no path was specified. Please qualify the command or specify a path. at /etc/puppet/manifests/site.pp:19
Wrapped exception:
'./update-131018.sh' is not qualified and no path was specified. Please qualify the command or specify a path.
解决方法:
command => './update-131018.sh',
Exec要求command使用绝对路径,或指定path路径;这里修改为绝对路径:
command => '/root/update-131018.sh',
path:命令执行的搜索路径。如果path没有被定义,命令需要使用绝对路径。路径可以以数组或以冒号分隔的形式来定义。
5、配置dashboard,rake db:migrate提示No Rakefile found
问题描述:
配置dashboard过程中,执行下述命令出错:
[root@mx lib]# rake RAILS_ENV=production db:migrate
rake aborted!
No Rakefile found (looking for: rakefile, Rakefile, rakefile.rb, Rakefile.rb)
(See full trace by running task with --trace)
解决方法:
未进入对应的工程目录;
# cd /opt/puppet-dashboard/
6、配置dashboard,rake db:migrate提示undefined method `source_index' for Gem:Module
问题描述:
[root@mx puppet-dashboard]# rake RAILS_ENV=production db:migrate
(in /opt/puppet-dashboard)
rake aborted!
undefined method `source_index' for Gem:Module
/opt/puppet-dashboard/Rakefile:4
(See full trace by running task with --trace)
解决方法:
rubygem版本过高,不兼容,安装低版本1.8.25;
7、gem install ruby-mysql提示:SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B
问题描述:
[root@mx puppet-dashboard]# gem install ruby-mysql
ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError)
SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://rubygems.global.ssl.fastly.net/gems/ruby-mysql-2.9.11.gem)
解决方法:
更新证书
[root@mx tls]# /usr/bin/openssl version -d
OPENSSLDIR: "/etc/pki/tls"
# cd /etc/pki/tls
# wget http://curl.haxx.se/ca/cacert.pem
# mv cert.pem cert.pem.bak
# mv cacert.pem cert.pem
8、gem install rails提示:make: *** [atomic_reference.o] Error 1
问题描述:
[root@mx puppet-dashboard]# gem install rails
Fetching: i18n-0.6.5.gem (100%)
Successfully installed i18n-0.6.5
Fetching: multi_json-1.8.2.gem (100%)
Successfully installed multi_json-1.8.2
Fetching: tzinfo-0.3.38.gem (100%)
Successfully installed tzinfo-0.3.38
Fetching: minitest-4.7.5.gem (100%)
Successfully installed minitest-4.7.5
Fetching: atomic-1.1.14.gem (100%)
Building native extensions. This could take a while...
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.
/usr/local/bin/ruby extconf.rb
creating Makefile
make
gcc -I. -I. -I/usr/local/lib/ruby/1.8/i686-linux -I. -D_FILE_OFFSET_BITS=64 -fPIC -g -O2 -c atomic_reference.c
atomic_reference.c:75:2: error: #error No CAS operation available for this platform
make: *** [atomic_reference.o] Error 1
Gem files will remain installed in /usr/local/lib/ruby/gems/1.8/gems/atomic-1.1.14 for inspection.
Results logged to /usr/local/lib/ruby/gems/1.8/gems/atomic-1.1.14/ext/gem_make.out
解决方法:
# gem install atomic -- --with-cflags=-march=i686
9、启动puppet-dashboard提示:/usr/bin/env: ruby: No such file or directory
问题描述:
[root@mx puppet-dashboard]# sudo -u puppet-dashboard ./script/server -e production
/usr/bin/env: ruby: No such file or directory
解决方法:
# whereis ruby
ruby: /usr/lib/ruby /usr/local/bin/ruby /usr/local/lib/ruby
找不到ruby,在系统默认path下,增加ruby软链接,或者把/usr/local/bin增加到环境变更中;
# ln -s /usr/local/bin/ruby /usr/bin/ruby
10、启动puppet-dashboard提示:Rails Error: Unable to access log file
问题描述:
# sudo -u puppet-dashboard ./script/server -e production
Rails Error: Unable to access log file. Please ensure that /opt/puppet-dashboard/log/production.log exists and is chmod 0666. The log level has been raised to WARN and the output directed to STDERR until the problem is fixed.
解决方法:
确认/opt/puppet-dashboard/log/production.log文件是否存在,并且权限为666;
[root@mx puppet-dashboard]# ll /opt/puppet-dashboard/log/production.log
-rw-r--r-- 1 root root 51 Nov 1 17:10 /opt/puppet-dashboard/log/production.log
[root@mx puppet-dashboard]# chmod 666 /opt/puppet-dashboard/log/production.log
[root@mx puppet-dashboard]# ll /opt/puppet-dashboard/log/production.log
-rw-rw-rw- 1 root root 51 Nov 1 17:10 /opt/puppet-dashboard/log/production.log