我正在尝试安装木偶模块https://forge.puppet.com/puppet/mongodb
使用以下代码
class {'mongodb::server':
port => 27018,
verbose => true,
auth => true,
}
class {'mongodb::client':}
mongodb::db { 'xxxxx2':
user => 'xxxx',
password_hash => 'a15fbfca5e3a758be80ceaf42458bcd8',
require => Class['mongodb::server', 'mongodb::client'],
}我得到了这个错误
err Puppet Could not prefetch mongodb_database provider 'mongodb': Could not evaluate MongoDB shell command: rs.slaveOk();printjson(db.getMongo().getDBs())
err Puppet Failed to apply catalog: Could not evaluate MongoDB shell command: rs.slaveOk();printjson(db.getMongo().getDBs())有没有人遇到这个问题并知道什么解决方法?
发布于 2020-02-03 06:41:22
将auth => true更改为auth => false remove错误。
class {'mongodb::server':
port => 27018,
verbose => true,
auth => false,
}
class {'mongodb::client':}
mongodb::db { 'xxxxx2':
user => 'xxxx',
password_hash => 'a15fbfca5e3a758be80ceaf42458bcd8',
require => Class['mongodb::server', 'mongodb::client'],
}身份验证
设置为true可为从远程主机连接的用户启用数据库身份验证。如果不存在用户,localhost接口将继续拥有对数据库的访问权限,直到您创建第一个用户。默认值: false
https://stackoverflow.com/questions/60030767
复制相似问题