Puppet升级MySQL Community Common失败问题求助与排查建议
生产环境MySQL版本升级失败排查问题
仅生产环境触发该异常,低环境无此情况。尝试升级MySQL版本时失败,报错信息如下:
level: :err message: 'change from 1.1.1.el7 to 1.1.2.el7 failed: Could not update: Failed to update to version 1.1.2.el7, got version 1.1.1.el7 instead'
相关Puppet配置
manifests\init.pp 变量定义
$mysql_community_common=hiera('mysql_community_common')
manifests\init.pp 中package资源配置
package { "mysql-community-common": ensure => hiera('mysql_community_common') } ->
hieradata\default.yaml 配置
mysql_community_common: "1.1.2.el7"
问题解决思路及排查建议
- 验证生产环境yum源可用性:检查生产环境是否能正常访问MySQL源,确认
1.1.2.el7版本的包是否存在于源中。执行yum list mysql-community-common查看可安装版本,对比低环境源配置差异。 - 检查Puppet变量优先级:确认生产环境是否有层级更高的hiera配置(如环境级、节点级yaml)覆盖了
default.yaml的版本值,执行puppet lookup mysql_community_common查看实际生效的变量值。 - 排查包依赖冲突:生产环境可能存在依赖锁定或冲突,执行
yum update mysql-community-common -v查看详细升级日志,定位依赖阻碍问题。 - 检查Puppet agent权限:确认生产环境Puppet agent是否有足够权限执行包升级,排查sudo规则、selinux策略等安全限制是否阻止了更新操作。
- 清理yum缓存重试:执行
yum clean all && yum makecache清理缓存,再手动执行yum install mysql-community-common-1.1.2.el7验证是否能正常安装。 - 查看Puppet完整运行日志:检查生产环境Puppet agent的完整日志,确认是否有其他资源(如exec、file)干扰了包升级流程。
内容的提问来源于stack exchange,提问作者user2841861
相关产品推荐
相关产品推荐

