centos mongodb puppet模块安装失败

bqjvbblv  于 2022-11-07  发布在  Go
关注(0)|答案(1)|浏览(155)

我正在尝试安装puppet模块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())

任何人遇到这个问题,并知道任何修复?
参考:https://github.com/voxpupuli/puppet-mongodb/issues/464

e37o9pze

e37o9pze1#

auth => true更改为auth => false可删除错误。

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接口将继续访问数据库,直到您创建第一个用户。默认值:假的

相关问题