我想第一次设置傀儡
我已经确保使用ufw打开端口8140和22 。
服务器和代理都在运行。 在启动代理程序之前,我通过添加以下内容来编辑/etc/puppet/puppet.conf :
[agent] server=174.89.xyz.abc
我也为/etc/puppetlabs/puppet/puppet.conf做了上面的,不知道我是否应该都有,当我运行puppet --version ,我回到4.10 。
代理服务器的IP被设置为主服务器的IP。
我运行puppet cert list希望看到代理的请求,我指出我的笔记本电脑,但我没有看到任何请求。
我不知道下一步该怎么做才能找出代理没有连接的原因。
编辑:
我跑puppet agent --test返回的testing:
Info: Creating a new SSL key for ip-172-00-00-00.us-west-2.compute.internal Error: Could not request certificate: Failed to open TCP connection to puppet:8140 (getaddrinfo: Name or service not known) Exiting; failed to retrieve certificate and waitforcert is disabled
我已经确保我的笔记本电脑在DMZ中,并且可以从代理服务器成功ping通。
更新:
@DylanKnoll指出,服务器的默认值是puppet,所以可能不接受ip地址。 我发现了更多关于木偶别名的文档。 然后,我删除了上面的configuration,并将此行添加到/etc/hosts :
174.89.000.000 puppet
在这个改变之后,我收到的错误改变了。 所以他们似乎在build立联系。 我还在使用一个IP地址,所以也许我需要一个域名来获得一个适当的SSL连接(?)
错误信息:
Error: Could not request certificate: The CSR retrieved from the master does not match the agent's public key. CSR fingerprint: BF:43:71:72:86:45:76:E9:34:20:24:71:B6:0C:88:25:3A:67:5E:C4:84:D5:E0:22:C9:1A:9E:FD:98:C1:0D:3C CSR public key: Public-Key: (4096 bit) Modulus: 00:b7:bd:de:db:24:50:01:95:ad:10:af:83:6e:c5: # lines removed 35:e9:17:40:46:09:31:96:d6:68:ca:15:9e:be:41: 85:6c:eb Exponent: 65537 (0x10001) Agent public key: Public-Key: (4096 bit) Modulus: 00:b0:21:80:23:d5:a5:26:37:ea:68:02:99:d5:85: # lines removed 3d:92:e1 Exponent: 65537 (0x10001) To fix this, remove the CSR from both the master and the agent and then start a puppet run, which will automatically regenerate a CSR. On the master: puppet cert clean ip-172-31-27-12.us-west-2.compute.internal On the agent: 1a. On most platforms: find /home/ubuntu/.puppetlabs/etc/puppet/ssl -name ip-172-31-27-12.us-west-2.compute.internal.pem -delete 1b. On Windows: del "\home\ubuntu\.puppetlabs\etc\puppet\ssl\certs\ip-172-31-27-12.us-west-2.compute.internal.pem" /f 2. puppet agent -t
你是否运行puppet agent --test代理生成(并发送)初始证书请求? 这应该将代理放在主站的证书请求列表中。
如果代理只是抱怨没有find一个证书,然后退出,它可能会认为它已经发送了一个请求 – 只要重新设置它的内存就可以通过备份和nukinconfiguration的puppet SSL目录(默认为/var/lib/puppet/ssl或/etc/puppetlabs/puppet/ssl ),然后运行puppet agent --test (如果你想真正确定的话用--debug和--verbose ) – 这个运行应该输出它生成新的证书请求,它应该被发送到configuration的主机。
错误消息告诉你到底该怎么做。 清除节点SSL文件夹:
rm -rf /etc/puppetlabs/puppet/ssl
注意:这会删除所有的puppet SSL证书,CSR等,所以只能在节点上,而不是在服务器上。
然后,从puppet删除CSR:
sudo /opt/puppetlabs/bin/puppet cert clean <hostname>
之后,在节点上运行另一个木偶:
sudo /opt/puppetlabs/bin/puppet agent -tv
这将产生一个新的CSR。