Installation on MacOS

To install MongoDB on , follow the instructions provided on the MongoDB installation site.

https://docs.mongodb.com/v3.2/installation/

To make sure MongoDB does not exceed software limits on , follow these steps:
  1. Create two plist files and place them in /Library/LaunchDaemons/:
    1. /Library/LaunchDaemons/limit.maxfiles.plist
    2. /Library/LaunchDaemons/limit.maxproc.plist
  2. Copy the following content in the files:
    For maxfiles:
    <?xml version="1.0" encoding="UTF-8"?>  
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"  
            "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">  
      <dict>
        <key>Label</key>
        <string>limit.maxfiles</string>
        <key>ProgramArguments</key>
        <array>
          <string>launchctl</string>
          <string>limit</string>
          <string>maxfiles</string>
          <string>524288</string>
          <string>524288</string>
        </array>
        <key>RunAtLoad</key>
        <true/>
        <key>ServiceIPC</key>
        <false/>
      </dict>
    </plist>  
    For maxproc:
    <?xml version="1.0" encoding="UTF-8"?>  
    <!DOCTYPE plist PUBLIC "-//Apple/DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">  
      <plist version="1.0">
        <dict>
          <key>Label</key>
            <string>limit.maxproc</string>
          <key>ProgramArguments</key>
            <array>
              <string>launchctl</string>
              <string>limit</string>
              <string>maxproc</string>
              <string>2048</string>
              <string>2048</string>
            </array>
          <key>RunAtLoad</key>
            <true />
          <key>ServiceIPC</key>
            <false />
        </dict>
      </plist>
  3. Change ownership of the files to root:wheel:
    1. sudo chown root:wheel /Library/LaunchDaemons/limit.maxfiles.plist
    2. sudo chown root:wheel /Library/LaunchDaemons/limit.maxproc.plist
  4. Reload the files:
    1. sudo launchctl load -w /Library/LaunchDaemons/limit.maxfiles.plist
    2. sudo launchctl load -w /Library/LaunchDaemons/limit.maxproc.plist
  5. Reboot your machine.