openshift / puppet-openshift_origin

Puppet module to create OpenShift Brokers and Nodes. Can be used to create a full OpenShift Origin deployment.
http://forge.puppetlabs.com/openshift/openshift_origin
Other
45 stars 128 forks source link

Don't restart mongod when the marker exists #308

Closed sdodson closed 9 years ago

sdodson commented 9 years ago

This was causing mongod to restart on each puppet run.

sdodson commented 9 years ago

This was introduced in @9533a872b0901cea822d4583e1111233e5b824ad perhaps in error? @kraman do you know?

sdodson commented 9 years ago

[test]

openshift-bot commented 9 years ago

Origin Test Results: SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pull_requests/2982/)

detiber commented 9 years ago

@sdodson It does indeed look like the restart there was an omission. looking at the stop_mongo and start_mongo methods though, they look to be systemd specific, they will need to be updated to use service mongod {start,stop} if on rhel/centos, instead of just pkilling the process.

andrewklau commented 9 years ago

I did something slightly different here, https://github.com/ausnimbus/puppet-openshift_origin/commit/c695368dc3292e30b3a5bbd9efef658a71678e34

sdodson commented 9 years ago

@andrewklau Perhaps both a creates attribute and adjusting the script not to restart mongod when the lock file exists? The script says it's found the lock file and is going to exit but still restarts mongod.

andrewklau commented 9 years ago

@sdodson the script wont run because puppet sees the lock file, I haven't seen any of my mongodb services get restarted since adding that line. However, your point is still valid because I missed, the service openshift-mongo-setup which I guess runs on boot. Restarting it for no reason.

Both should be incorporated, unfortunately that repo I was working on is a horrible mess. So feel free to cherry pick the lines :)

openshift-bot commented 9 years ago

Evaluated for origin up to 3aa804f4868a345bcff879dece211416868524d7

sdodson commented 9 years ago

@andrewklau Thanks for the reference to your changes.

@detiber Yeah, oo-mongo-setup is pretty heavy handed with how it stops and restarts mongod when systemctl fails or doesn't exist, we should probably fix that script up for RHEL6 hosts. I'll file an issue on that but I think it's beyond the scope of this.

This bit me because it restarted mongod in between provisioning my first and third datastore host which moved the primary, ultimately resulting in the third host to fail replset-add.