我尝试通过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: { }
哦,现在我意识到,后盖,/p>也存在同样的问题
我的配置或win10怎么了?
谢谢。
我解决了它。由于文件夹的共享,这是一个麻烦。如果将var/log文件夹映射到主机机器 - 无法更改此文件夹的许可。因此,mongodb无法写入日志。