Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-14895

Updated init script for multiple instances

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major - P3
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: 4.1 Desired
    • Component/s: Admin
    • Labels:
    • 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.

        Attachments

        1. init.d-mongod.multi
          2 kB
        2. init.d-mongod.patch
          2 kB

          Activity

            People

            • Votes:
              2 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated: