Puppet:服务器主机名“puppetmaster”与服务器证书不匹配;预期为 puppetmaster.us-east-2.compute.internal、DNS:puppet 之一,

2024-01-19

I use puppet在 AWS 中,Puppet 运行时出现以下错误:

Puppet:Server hostname 'puppetmaster' did not match server certificate; expected one of puppetmaster.us-east-2.compute.internal, DNS:puppet,

请找到以下配置:

#master /etc/hosts
ubuntu@puppetmaster:~$ cat /etc/hosts
127.0.0.1 localhost
172.31.16.177  puppetmaster puppet 
172.31.19.211  ip-172-31-19-211 #client

#client
 ubuntu@ip-172-31-19-211:~$ cat /etc/hosts
 127.0.0.1 localhost
 172.31.16.177  puppetmaster puppet
 172.31.19.211  ip-172-31-19-211
 
ubuntu@ip-172-31-19-211:~$ cat /etc/puppetlabs/puppet/puppet.conf
# This file can be used to override the default puppet settings.
# See the following links for more details on what settings are available:
# - https://puppet.com/docs/puppet/latest/config_important_settings.html
# - https://puppet.com/docs/puppet/latest/config_about_settings.html
# - https://puppet.com/docs/puppet/latest/config_file_main.html
# - https://puppet.com/docs/puppet/latest/configuration.html
[main]
certname = ip-172-31-19-211
server = puppetmaster

以上是master和node机器的主机文件,我也在node机器中配置了puppet.conf文件,但客户端机器仍然无法连接到master。请有人帮我解决这个问题。


Puppet 在客户端和服务器端都使用加密证书来验证机器身份。该错误消息表明此身份验证失败,因为服务器向客户端提供的证书未将其识别为客户端期望的计算机。

具体来说,机器期望服务器被标识为“puppetmaster”,但这不是证书中列出的身份之一。 (“puppetmaster.us-east-2.compute.internal”是这些身份之一,但这并不等同于目的)。

所有这些的设置方式都有相当大的灵活性,但为了获得最流畅的体验,人们应该

  • 使用完全限定的、DNS 可解析的主机名配置 Puppet 服务器和所有 Puppet 客户端。在每台机器上执行此操作before在该计算机上安装任何 Puppet 软件,或者至少在首次启动任何 Puppet 组件之前。

  • 设置 Puppet 后,请勿更改 Puppet 客户端或服务器主机名。

  • 始终使用所选的完全限定名称连接到 Puppet 服务器。特别是,将其指定为客户端中的服务器名称puppet.conf配置文件。

该问题不清楚观察到错误的确切情况,但可能会发生在新客户端上,同时最初尝试将其连接到服务器。在这种情况下,最简单的解决方案可能是更新客户端的puppet.conf https://www.puppet.com/docs/puppet/7/config_important_settings.html#settings_agents_all_nodes通过其证书上的名称指定服务器:“puppetmaster.us-east-2.compute.internal”。假设确实可以通过该名称访问服务器;如果没有,则可能需要为服务器生成一个新的证书。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Puppet:服务器主机名“puppetmaster”与服务器证书不匹配;预期为 puppetmaster.us-east-2.compute.internal、DNS:puppet 之一, 的相关文章

随机推荐