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

Updated init script for multiple instances

    • Type: Icon: Improvement Improvement
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • 4.1 Desired
    • Affects Version/s: None
    • Component/s: Admin
    • Labels:
      None

      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.

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

            Assignee:
            alex.neben@mongodb.com Alex Neben
            Reporter:
            andre.spiegel@mongodb.com Andre Spiegel
            Votes:
            2 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: