[SERVER-14895] Updated init script for multiple instances Created: 14/Aug/14  Updated: 01/Jun/22  Resolved: 01/Jun/22

Status: Closed
Project: Core Server
Component/s: Admin
Affects Version/s: None
Fix Version/s: 4.1 Desired

Type: Improvement Priority: Major - P3
Reporter: Andre Spiegel Assignee: Alex Neben
Resolution: Won't Fix Votes: 2
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File init.d-mongod.multi     Text File init.d-mongod.patch    
Issue Links:
Related
Participants:
Case:

 Description   

Here's an updated version of the init script in mongo/rpm/init.d-mongod that can start and stop multiple instances on the same machine. The idea is that you can have multiple /etc/mongod.conf files, with the name pattern /etc/mongod.*.conf. If there are several such files, the script will launch the corresponding instances one by one, and also shut them down.

As part of this, I removed the 1.8 compatibility code and rewrote the stop() routine so it uses mongod --shutdown. There's one caveat to this: The shutdown process is launched as root and would normally overwrite the log file with a file owned by root. To prevent this, I added the option --logpath /dev/null at the end of the command.


Generated at Thu Feb 08 03:36:18 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.