我有一个单独的CA服务器和一个配置的主节点,并且我试图在主服务器上运行代理以提取其自己的目录。当我尝试执行puppet agent -t
时,出现以下错误:
# puppet agent -t
info: Retrieving plugin
info: Loading facts in /var/lib/puppet/lib/facter/katta.rb
info: Loading facts in /var/lib/puppet/lib/facter/centos_repos.rb
info: Loading facts in /var/lib/puppet/lib/facter/rabbitmq_erlang_cookie.rb
info: Loading facts in /var/lib/puppet/lib/facter/slang_site.rb
info: Loading facts in /var/lib/puppet/lib/facter/hpraid.rb
info: Loading facts in /var/lib/puppet/lib/facter/kernel_options.rb
info: Loading facts in /var/lib/puppet/lib/facter/is_vagrant.rb
info: Loading facts in /var/lib/puppet/lib/facter/hpsim.rb
info: Loading facts in /var/lib/puppet/lib/facter/roles.rb
info: Loading facts in /var/lib/puppet/lib/facter/purge_sudoers.rb
info: Loading facts in /var/lib/puppet/lib/facter/pe_version.rb
info: Loading facts in /var/lib/puppet/lib/facter/root_home.rb
info: Loading facts in /var/lib/puppet/lib/facter/hiera_site.rb
info: Loading facts in /var/lib/puppet/lib/facter/puppet_classes.rb
info: Loading facts in /var/lib/puppet/lib/facter/puppet_vardir.rb
info: Loading facts in /var/lib/puppet/lib/facter/concat_basedir.rb
info: Loading facts in /var/lib/puppet/lib/facter/hpilo.rb
info: Loading facts in /var/lib/puppet/lib/facter/facter_dot_d.rb
info: Loading facts in /var/lib/puppet/lib/facter/installed_packages.rb
info: Loading facts in /var/lib/puppet/lib/facter/local_users.rb
info: Loading facts in /var/lib/puppet/lib/facter/hpbios_upgrade.rb
info: Loading facts in /var/lib/puppet/lib/facter/mounts.rb
err: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not find node 'master.host.com'; cannot compile
warning: Not using cache on failed catalog
err: Could not retrieve catalog; skipping run
当我使用跟踪执行它时,我发现一个api返回400。我使用curl执行了同样的操作,也得到了400。
curl -X GET -H 'Accept: pson' --cert /var/lib/puppet/ssl/certs/$(hostname -f).pem --key /var/lib/puppet/ssl/private_keys/$(hostname -f).pem --cacert /var/lib/puppet/ssl/certs/ca.pem https://master.host.com:8140/production/node/master.host.com
Could not find node master.host.com
类似地,我在GET /production/node/master.host.com
上遇到了相同的错误
除了下面提到的400响应外,日志中没有错误,并且不知道这里出了什么问题。
==> puppet_ssl_request_log <==
[04/Oct/2019:12:26:11 +0000] 10.124.89.112 SUCCESS /CN=master.host.com "GET /production/file_metadatas/plugins?&links=manage&checksum_type=md5&ignore=---+%0A++-+%22.svn%22%0A++-+CVS%0A++-+%22.git%22&recurse=true HTTP/1.1" 200 85318
[04/Oct/2019:12:26:13 +0000] 10.124.89.112 SUCCESS /CN=master.host.com "POST /production/catalog/master.host.com HTTP/1.1" 400 71
[04/Oct/2019:12:26:14 +0000] 10.124.89.112 SUCCESS /CN=master.host.com "PUT /production/report/master.host.com HTTP/1.1" 200 13
这是master.host.com上puppet.conf的内容
# Managed by Puppet
[main]
logdir = /var/log/puppet
rundir = /var/run/puppet
ssldir = $vardir/ssl
localconfig = $vardir/localconfig
ssl_client_header = SSL_CLIENT_S_DN
ssl_client_verify_header = SSL_CLIENT_VERIFY
[agent]
server = master.host.com
ca_server = puppetca.host.com
environment = production
pluginsync = true
ignorecache = true
classfile = $vardir/classes.txt
report = true
[master]
ca = false
ca_server = puppetca.host.com
storeconfigs = false
environment = production
manifestdir = $confdir/environments/$environment/manifests
modulepath = $confdir/environments/$environment/modules
external_nodes = /opt/rubies/techops/bin/ruby /opt/rubies/techops/bin/j-enc
node_terminus = exec
reports = http
reporturl = http://puppet-dashboard.host.com/reports/upload
答案 0 :(得分:0)
问题出在ENC上,我在/var/log/enc/j_enc.log
中打开调试日志级别时发现了详细的问题,因此解决了连接问题对它有帮助。
希望这会帮助面临类似问题的人。