在配置puppetmaster时,如果使用storeconfig=ture ,在client去连接的时候就会报错。

错误信息常常有:

err: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not autoload active_record: undefined method `belongs_to' for Puppet::Rails::FactValue:Class

以及等等与active_record有关的400错误。

这主要是由于Ubuntu当前提供的puppet 2.7.11与最新的active_reocrd不兼容,需要手动降级。

这里以matser配置mysql作为数据库为例:

在[master]区域填写以下数值:

storeconfigs=true
dbadapter=mysql2
dbuser= puppetuser
dbpassword= puppetpasswd
dbserver= localhost

 

安装适配器:

apt-get install libmysqlclient-dev
gem install activerecord-mysql2-adapter

 

给activerecord降级:

gem install activerecord --version 3.0.11

 

此时,重启master,client重新发出连接,终于不用看到粉红色的字了~~LOL

 

如果以上还没有修复,请确认你是否安装了多个版本的activerecord,我之前就有过安装了3.0和3.2的导致运行错误。

 

 

 

相关文章:

  • 2021-12-11
  • 2021-09-08
  • 2021-05-21
  • 2022-12-23
  • 2021-09-15
  • 2022-12-23
猜你喜欢
  • 2021-09-20
  • 2021-11-04
  • 2022-12-23
  • 2022-12-23
  • 2021-05-03
  • 2021-09-29
  • 2021-12-11
相关资源
相似解决方案