我正在尝试使用循环 DNS 来扩展 puppetserver,以获得冗余。次要puppetserver
(版本7.4.0
)配置为使用来自主要的 CA 权限puppetserver
:
/etc/puppetlabs/puppet/puppet.conf
:
[main]
ca_name = Puppet CA: puppet-ca-master.company.com
ca_server = puppet-ca-master.company.com
[agent]
server = puppet-ca-master.company.com
runinterval=1800
在辅助服务器上,我禁用了 CA 服务,因为在以下位置可能只有一个证书颁发机构/etc/puppetlabs/puppetserver/services.d/ca.cfg
:
# To enable the CA service, leave the following line uncommented
# puppetlabs.services.ca.certificate-authority-service/certificate-authority-service
# To disable the CA service, comment out the above line and uncomment the line below
puppetlabs.services.ca.certificate-authority-disabled-service/certificate-authority-disabled-service
puppetlabs.trapperkeeper.services.watcher.filesystem-watch-service/filesystem-watch-service
我已经从辅助服务器中删除了证书,以便从 CA 主服务器获取证书签名证书:
rm -rf /etc/puppetlabs/puppet/ssl && mkdir -p /etc/puppetlabs/puppet/ssl/certs
chmod 0700 /etc/puppetlabs/puppet/ssl
chown -R puppet /etc/puppetlabs/puppet/ssl
但是,puppetserver
由于缺少证书,服务拒绝启动:
2021-09-30T09:06:18.220+02:00 ERROR [async-dispatch-2] [p.t.internal] Error during service start!!!
java.lang.IllegalArgumentException: Unable to open 'ssl-cert' file: /etc/puppetlabs/puppet/ssl/certs/secondary-puppetserver.company.com.pem
当我尝试puppet agent -t
在辅助 puppetserver 上运行时,它无法签署证书:
Couldn't fetch certificate from CA server; you might still need to sign this agent's certificate (secondary-puppetserver.company.com)
此外,会生成私钥,但不会生成公钥:
ll /etc/puppetlabs/puppet/ssl/public_keys/
total 0
使用轮询 DNS CA 主配置
/etc/puppetlabs/puppetserver/conf.d/ca.conf
需要包括:重新启动
puppetserver
并为 CA 主服务器上的辅助服务器生成证书:转让证书:
和 CA
在辅助确保 CA 服务在
/etc/puppetlabs/puppetserver/services.d/ca.cfg
.并确保将网络服务器配置为使用正确的证书
/etc/puppetlabspuppetserver/conf.d/webserver.conf
:在 CA 主 DNS 上,可以验证替代名称。所有 puppet 服务器都需要包含相同的域名和其他唯一名称。
寻找
alt names: ["DNS: ...
。使用 生成证书时puppet agent
,不包括替代名称。