zero_open 2024-04-15 11:36 采纳率: 77.8%
浏览 1
已结题

在进行 puppet 客户端服务端部署时证书签发时出现问题

 在进行 puppet 客户端服务端部署时证书签发时出现问题

环境
  主机    操作系统    IP地址    主要的软件
ligc_116    CentOS 7      192.168.10.116    puppet-server
ligc_117    CentOS 7     192.168.10.117    puppet-agent

版本是

puppetlabs-release-el-7.noarch.rpmd

时间已经同步,防火墙已关闭,hosts文件已配置,
服务端进行的操作,

在第一台server机安装
[root@ligc_116 ~]#wget -O /etc/yum.repos.d/epel.repo https://mirrors.aliyun.com/repo/epel-7.repo
[root@ligc_116 ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
[root@ligc_116 ~]#yum install epel-release -y

[root@ligc_116 ~]# rpm -ivh puppetlabs-release-el-7.noarch.rpm
[root@ligc_116 ~]# yum -y install puppet-server
[root@ligc_116 ~]# puppet master -v --no-daemonize

启动无问题
客户端进行的操作

[root@ligc_117 ~]# rpm -ivh puppetlabs-release-el-7.noarch.rpm
[root@ligc_117 ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
[root@ligc_117 ~]# wget -O /etc/yum.repos.d/epel.repo https://mirrors.aliyun.com/repo/epel-7.repo
[root@ligc_117 ~]# yum -y install puppet
[root@ligc_117 ~]# vim /etc/puppet/puppet.conf
    server = ligc_116        #在agent区域添加
##指定puppet server主机名,需要写hosts文件内的;
[root@ligc_117 ~]# puppet agent --test   
![img](https://img-mid.csdnimg.cn/release/static/image/mid/ask/287c8225f59b4ad3a22b541a5617852a.png "#left")

(7)服务端签发证书

[root@ligc_116 ~]# puppet cert sign ligc_117
Notice: Signed certificate request for ligc_117
Notice: Removing file Puppet::SSL::CertificateRequest  ligc_117 at     '/var/lib/puppet/ssl/ca/requests ligc_117.pem'

(8)客户端再次拉取生成

[root@ligc_117 ~]# puppet agent --test
Info: Caching certificate for ligc_117
Info: Caching certificate_revocation_list for ca
Info: Caching certificate for ligc_117
Warning: Unable to fetch my node definition, but the agent run will continue:
Warning: undefined method `include?' for nil:NilClass
Info: Retrieving pluginfacts
**Error: Could not retrieve pluginfacts: Parameter source failed on File[/var/lib/puppet/facts.d]: Could not understand source puppet://ligc_116/pluginfacts: the scheme puppet does not accept registry part: ligc_116 (or bad hostname?)**
Info: Retrieving plugin
**Error: Could not retrieve plugin: Parameter source failed on File[/var/lib/puppet/lib]: Could not understand source puppet://ligc_116/plugins: the scheme puppet does not accept registry part: ligc_116 (or bad hostname?)**
Info: Caching catalog for ligc_117
Info: Applying configuration version '1713150117'
Info: Creating state file /var/lib/puppet/state/state.yaml

系统日志显示

Apr 15 11:33:46 ligc_117 puppet-agent[22222]: Retrieving pluginfacts
Apr 15 11:33:46 ligc_117 puppet-agent[22222]: Could not retrieve pluginfacts: Parameter source failed on File[/var/lib/puppet/facts.d]: Could not understand source puppet://ligc_116/pluginfacts: the scheme puppet does not accept registry part: ligc_116 (or bad hostname?)
Apr 15 11:33:46 ligc_117 puppet-agent[22222]: Retrieving plugin
Apr 15 11:33:46 ligc_117 puppet-agent[22222]: Could not retrieve plugin: Parameter source failed on File[/var/lib/puppet/lib]: Could not understand source puppet://ligc_116/plugins: the scheme puppet does not accept registry part: ligc_116 (or bad hostname?)
Apr 15 11:33:47 ligc_117 puppet-agent[22222]: Caching catalog for ligc_117
Apr 15 11:33:47 ligc_117 puppet-agent[22222]: Applying configuration version '1713150117'
Apr 15 11:33:47 ligc_117 puppet-agent[22222]: Finished catalog run in 0.01 seconds

怎么解决?

  • 写回答

3条回答 默认 最新

  • GISer Liu 2024-04-15 11:41
    关注

    该回答引用自GPT-3.5,由博主GISer Liu编写:

    这个问题出现在 puppet 客户端在尝试从服务端获取插件信息时,无法正确解析服务端地址。根据错误信息显示,无法理解
    puppet://ligc_116/pluginfacts 这样的地址。
    解决方案如下:

    1. 确认 puppet 服务端配置 :首先,确保 puppet 服务端的配置中指定了正确的主机名。在 ligc_116 的 puppet 服务端配置文件 /etc/puppet/puppet.conf 中,确保已经正确配置了 dns_alt_names 或者 certname,并且该主机名在客户端能够解析到正确的 IP 地址。
    2. 检查客户端配置 :检查 ligc_117 客户端的配置文件 /etc/puppet/puppet.conf,确认其中的 server 参数指向了正确的 puppet 服务端主机名(这里应该是 ligc_116)。
    3. 验证主机名解析 :在 ligc_117 客户端上,运行 ping ligc_116 确保主机名能够被正确解析到服务端的 IP 地址。
    4. 检查防火墙和 SELinux :确保 ligc_116 和 ligc_117 之间的通信没有被防火墙或者 SELinux 阻止。可以先尝试临时关闭防火墙和 SELinux 来验证是否是这些安全设置导致的问题。
    5. 重新签发证书 :如果以上步骤都没有解决问题,尝试重新签发 ligc_117 的证书。在 puppet 服务端 ligc_116 上运行 puppet cert clean ligc_117 删除客户端的旧证书,然后再次运行 puppet cert sign ligc_117 签发新的证书给 ligc_117。
    6. 重新启动服务 :在 ligc_117 客户端上重新启动 puppet 服务,以确保新的配置和证书生效。
      如果以上步骤都无法解决问题,可能需要进一步检查 puppet 服务端和客户端的日志,以获取更多详细的错误信息来进一步排查。

    如果该回答解决了您的问题,请采纳!如果没有,请私信联系或评论您的疑惑

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

问题事件

  • 系统已结题 4月23日
  • 已采纳回答 4月15日
  • 已采纳回答 4月15日
  • 创建了问题 4月15日