Open serebrov opened 9 years ago
I have installed it into the Ubuntu 14. The cookbook makes config file (among others) at /etc/mongodb.conf . However the problem is that service mongodb is already started with a config file at /etc/mongod.conf (without any custom settings). I presume this is from the default package installation.
So one of the possible solutions is to
service mongod stop
service mongodb start
and it will pick up the correct config file. This does still work after restart, but if you want to make sure, you could remove the mongod(.conf) files from /etc/init and /etc/init.d
I believe this is fixed with PR #373
on first install it will run mongod upstart instead of mongodb , but stop and start the instances and it will revert to mongodb with the correct config
I'm still having issues with this. Can anyone detail a step by step solution? Or a more permanent fix in code?
@geerzo I am trying your suggested fix but it doesn't seem to be working.
@crimsonronin You applied the PR I submitted to your local copy and you are still getting this error?
Hi @geerzo, I tried the PR but it still threw up the same error. I then commented out the whole section and it seemed to work fine https://github.com/evergram/chef-mongodb/commit/a9f76e5050268f203ccebd9b97ef11ffc2303f14.
I haven't had time to look into a more permanent solution yet.
:+1: I've also experienced this.
on first install it will run mongod upstart instead of mongodb , but stop and start the instances and it will revert to mongodb with the correct config
@nabulaer's suggestion worked, thanks!
Are there any updates on this topic?
Just tried it again: mongodb::default
works fine on Ubuntu LTS 14.04 but fails on Amazon Linux.
I haven't done anything here because it works for me. I'm using this fork https://github.com/geerzo/chef-mongodb/tree/amazon_linux_support which is where the PR came from. I'm curious why it won't work for others though. I'm running multiple Amazon Linux servers using it just fine.
Actually, one note is I'm running replica-sets, I don't think I've tried running mongoldb:default in a long time. Maybe that is broken?
Any update, I think mongodb:default is broken?
The problem is this platform check and the fact that amazon reports as rhel familly.
chef (12.4.3)> node[:platform_family]
=> "rhel"
chef (12.4.3)> node[:platform_version]
=> "2015.09"
chef (12.4.3)> node[:platform_version].to_i >= 7
=> true
chef (12.4.3)> node[:platform_version].to_i
=> 2015
chef (12.4.3)> node[:platform]
=> "amazon"
It should check platform and not only platform_family.
+1
I am learning AWS OpsWorks and trying to deploy a single mongodb instance via OpsWorks. On the way I had problems using the mongodb recipe with both Amazon Linux 2014.09 and Ubuntu 14.04.
Ubuntu 14.04
The default mongo config file is is
/etc/mongodb.conf
while ubuntu actually uses/etc/monod.conf
. So any custom mongo settings are not applied.The solution seems to be (I didn't actually verify this) to change [:mongodb][:dbconfig_file] setting from '/etc/mongodb.conf' to '/etc/mongod.conf'. And I think this should be fixed or mentioned in documentation.
Amazon Linux 2014.09
Here there is a problem with changing the default db settings using the approach described in the readme. The following code leads to the deployment error:
And the error is:
Here it seems like there is some OS-level incompatibility and Amazon Linux does not have systemctl. The solution was to avoid this restart - I had to set the bind_ip before including the recipe:
And one more issue with Amazon Linux is that it shows the following warning during the deploy:
Sorry for posting multiple problems as a single issue, I just not sure if these are actual problems or this is just me doing something wrong.