傀儡:主人不连接到节点
puppet: master doesn't connect to node
我创建了两个新的 VM:一个用于 puppet-master (sbe-puppet),一个用于我的节点 (sbe1)。
在我的主机上,我有一个文件 testdefine.pp
,内容如下:
class testdefine {
define testdefine ($data) {
file {"$title":
ensure => file,
content => $data,
}
}
testdefine {'/var/tmp/puppetfile1':
data => "The name of the file is puppetfile1 and it is created by puppet$
}
testdefine {'/var/tmp/puppetfile2':
data => "The name of the file is puppetfile2 and it is created by puppet$
}
testdefine {'/var/tmp/puppetfile3':
data => "The name of the file is puppetfile3 and it is created by puppet$
}
}
和一个包含以下内容的文件 node.pp
:
import "testdefine"
node 'sbe-puppet.mydomain.net'{
include testdefine
}
node 'sbe1.mydomain.net' {
include testdefine
}
在 运行ning sudo puppet apply node.pp
之后(没有错误)这 3 个测试文件只存在于我的主机上,但没有出现在我的节点上。
sudo puppet cert list -all
列出我的节点 +
。
puppet agent --configprint server
(在我的节点上)显示了我的主人的正确 DNS 名称。
但是当我在我的节点上 运行 $ puppet agent --test
时,我得到:
Error: Could not request certificate: getaddrinfo: Name or service not known
Exiting; failed to retrieve certificate and waitforcert is disabled
我不知道这里出了什么问题,因为我的主人已经接受了节点证书请求?!
任何人都可以帮助实现这个简单的 "hello world"- 配置吗?
附加问题:
我在虚拟网络中有主节点和节点(使用 MS Azure),我只想为我的节点打开端口 80/443,为我的主节点打开端口 22 - 这适用于 puppet 吗?
这些错误信息...
Error: Could not request certificate: getaddrinfo: Name or service not known
Exiting; failed to retrieve certificate and waitforcert is disabled
...表示客户端无法解析master的名字。这可能是因为在其 puppet.conf
中配置了错误的服务器名称,或者是因为您的名称服务配置错误。主人如何可能已经接受了来自代理的证书请求尚不清楚,但其中的可能性是:
- 代理的配置文件在发出证书请求后已被修改,或者
- 自发出证书请求后名称服务发生了一些变化,或者
- 不同的客户端使用相同的名称发出了证书请求。
Additional question: I have master and node in a virtual network (using MS Azure) and I want to only open ports 80/443 for my node and only 22 for my master - will this work with puppet?
主节点不会尝试与标准 Puppet 服务一起建立与代理的连接,因此节点不需要为它们端的传入流量打开任何特定端口。他们只需要允许与他们发起的连接相关的入站流量,这是一个非常正常的防火墙配置。
另一方面,代理做需要与master建立连接,这需要master上有一个开放的端口; Puppet 默认使用端口 8140/tcp。尽管 Puppet 端口是可配置的,但如果您希望该端口用于其标准用途 (sshd
),则不能使用端口 22。然而,傀儡港口不需要向全世界开放;原则上,它可以仅限于那些被允许请求目录的机器。
我创建了两个新的 VM:一个用于 puppet-master (sbe-puppet),一个用于我的节点 (sbe1)。
在我的主机上,我有一个文件 testdefine.pp
,内容如下:
class testdefine {
define testdefine ($data) {
file {"$title":
ensure => file,
content => $data,
}
}
testdefine {'/var/tmp/puppetfile1':
data => "The name of the file is puppetfile1 and it is created by puppet$
}
testdefine {'/var/tmp/puppetfile2':
data => "The name of the file is puppetfile2 and it is created by puppet$
}
testdefine {'/var/tmp/puppetfile3':
data => "The name of the file is puppetfile3 and it is created by puppet$
}
}
和一个包含以下内容的文件 node.pp
:
import "testdefine"
node 'sbe-puppet.mydomain.net'{
include testdefine
}
node 'sbe1.mydomain.net' {
include testdefine
}
在 运行ning sudo puppet apply node.pp
之后(没有错误)这 3 个测试文件只存在于我的主机上,但没有出现在我的节点上。
sudo puppet cert list -all
列出我的节点 +
。
puppet agent --configprint server
(在我的节点上)显示了我的主人的正确 DNS 名称。
但是当我在我的节点上 运行 $ puppet agent --test
时,我得到:
Error: Could not request certificate: getaddrinfo: Name or service not known
Exiting; failed to retrieve certificate and waitforcert is disabled
我不知道这里出了什么问题,因为我的主人已经接受了节点证书请求?!
任何人都可以帮助实现这个简单的 "hello world"- 配置吗?
附加问题: 我在虚拟网络中有主节点和节点(使用 MS Azure),我只想为我的节点打开端口 80/443,为我的主节点打开端口 22 - 这适用于 puppet 吗?
这些错误信息...
Error: Could not request certificate: getaddrinfo: Name or service not known Exiting; failed to retrieve certificate and waitforcert is disabled
...表示客户端无法解析master的名字。这可能是因为在其 puppet.conf
中配置了错误的服务器名称,或者是因为您的名称服务配置错误。主人如何可能已经接受了来自代理的证书请求尚不清楚,但其中的可能性是:
- 代理的配置文件在发出证书请求后已被修改,或者
- 自发出证书请求后名称服务发生了一些变化,或者
- 不同的客户端使用相同的名称发出了证书请求。
Additional question: I have master and node in a virtual network (using MS Azure) and I want to only open ports 80/443 for my node and only 22 for my master - will this work with puppet?
主节点不会尝试与标准 Puppet 服务一起建立与代理的连接,因此节点不需要为它们端的传入流量打开任何特定端口。他们只需要允许与他们发起的连接相关的入站流量,这是一个非常正常的防火墙配置。
另一方面,代理做需要与master建立连接,这需要master上有一个开放的端口; Puppet 默认使用端口 8140/tcp。尽管 Puppet 端口是可配置的,但如果您希望该端口用于其标准用途 (sshd
),则不能使用端口 22。然而,傀儡港口不需要向全世界开放;原则上,它可以仅限于那些被允许请求目录的机器。