puPHPet + 傀儡 + puppetlabs/mongodb

puPHPet + puppet + puppetlabs/mongodb

我尝试通过 puPHPet 安装 ubuntu 16.04。但是在 mongodb 那里遇到了以下问题: 我已将 puppetlabs/mongodb 模块更新为实际版本 0.16,但未安装 mongo,因为默认情况下 apt-get 无法从未经授权的来源安装。我修改 mongodb/install.pp:

  if ! defined(Package['mongodb-org-tools']) {
    package {'mongodb-org-tools':
      require => Class['mongodb::client'],
      install_options => ['--allow-unauthenticated', '-f']
    }
  }

然后就在linux机器上完美安装了。 但是当主机 OS 是 win10 时它仍然不起作用。 这是一段日志:

Info: /Stage[main]/Mongodb::Server::Config/File[/etc/mongod.conf]: Filebucketed /etc/mongod.conf to puppet with sum 2f77cad9cf008f0d1cba3ab00e6f201b
Notice: /Stage[main]/Mongodb::Server::Config/File[/etc/mongod.conf]/content: content changed '{md5}2f77cad9cf008f0d1cba3ab00e6f201b' to '{md5}27a1615781754ebd40a4f2afee063b10'
Notice: /Stage[main]/Mongodb::Server::Config/File[/var/run/mongod.pid]/ensure: created
Info: Class[Mongodb::Server::Config]: Scheduling refresh of Class[Mongodb::Server::Service]
Info: Class[Mongodb::Server::Service]: Scheduling refresh of Service[mongodb]
Notice: /Stage[main]/Mongodb::Server::Service/Service[mongodb]/ensure: ensure changed 'stopped' to 'running'
Info: /Stage[main]/Mongodb::Server::Service/Service[mongodb]: Unscheduling refresh on Service[mongodb]
     Notice: Failed to connect to mongodb within timeout window of 240 seconds; giving up.
Info: Class[Mongodb::Server::Service]: Unscheduling all events on Class[Mongodb::Server::Service]
Notice: /Stage[main]/Mongodb::Server/Anchor[mongodb::server::end]: Dependency Mongodb_conn_validator[mongodb] has failures: true
Notice: /Stage[main]/Mongodb::Client/Anchor[::mongodb::client::start]: Dependency Mongodb_conn_validator[mongodb] has failures: true
Notice: /Stage[main]/Mongodb::Client::Install/Package[mongodb_client]: Dependency Mongodb_conn_validator[mongodb] has failures: true
Notice: /Stage[main]/Mongodb::Client/Anchor[::mongodb::client::end]: Dependency Mongodb_conn_validator[mongodb] has failures: true
Notice: /Stage[main]/Puphpet::Mongodb::Install/Package[mongodb-org-tools]: Dependency Mongodb_conn_validator[mongodb] has failures: true
Error: Unable to connect to mongodb server! (127.0.0.1:27017)
Error: /Stage[main]/Mongodb::Server::Service/Mongodb_conn_validator[mongodb]/ensure: change from absent to present failed: Unable to connect to mongodb server! (127.0.0.1:27017)
Warning: /Stage[main]/Mongodb::Server/Anchor[mongodb::server::end]: Skipping because of failed dependencies
Warning: /Stage[main]/Mongodb::Client/Anchor[::mongodb::client::start]: Skipping because of failed dependencies
Warning: /Stage[main]/Mongodb::Client::Install/Package[mongodb_client]: Skipping because of failed dependencies
Warning: /Stage[main]/Mongodb::Client/Anchor[::mongodb::client::end]: Skipping because of failed dependencies
Warning: /Stage[main]/Puphpet::Mongodb::Install/Package[mongodb-org-tools]: Skipping because of failed dependencies
...
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.

这是我的 config.yaml:

provider:
    local:
        box: puphpet/ubuntu1604-x64
        box_url: puphpet/ubuntu1604-x64
        box_version: '0'
        chosen_virtualizer: virtualbox

...

mongodb:
    install: '1'
    settings:
        bind_ip: ['127.0.0.1', '192.168.10.10']
        port: '27017'
    globals:
        version: '3.4.0'

databases: { }

哦,现在我意识到,postgress也有同样的问题

我的配置或 win10 有什么问题?

谢谢。

我解决了。 这很麻烦,因为文件夹共享。如果您将 var/log 文件夹映射到主机 - 则无法更改此文件夹的权限。 因为它 mongodb 无法写入日志。