Skip to content

Instantly share code, notes, and snippets.

@iiitmahesh
Forked from subfuzion/mongo-autostart-osx.md
Created January 26, 2018 11:45
Show Gist options
  • Save iiitmahesh/ac3bfcc22e9281e8d64bb5cdc8f5686f to your computer and use it in GitHub Desktop.
Save iiitmahesh/ac3bfcc22e9281e8d64bb5cdc8f5686f to your computer and use it in GitHub Desktop.

Revisions

  1. @subfuzion subfuzion revised this gist Mar 18, 2014. 1 changed file with 2 additions and 3 deletions.
    5 changes: 2 additions & 3 deletions mongo-autostart-osx.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,4 @@
    Homebrew
    --------
    ### Install with Homebrew

    brew install mongodb

    @@ -20,7 +19,7 @@ You can also more conveniently use `brew` to start, stop, and verify service sta
    $ brew services start mongodb
    $ brew services stop mongodb

    ## Notes
    #### Notes

    The default plist provided by homebrew stores the mongod configuration at `/usr/local/etc/mongod.conf`. This configuration specifies the `dbpath` to be `/usr/local/var/mongodb` instead of the default `/data/db`.

  2. @subfuzion subfuzion revised this gist Mar 18, 2014. 1 changed file with 9 additions and 2 deletions.
    11 changes: 9 additions & 2 deletions mongo-autostart-osx.md
    Original file line number Diff line number Diff line change
    @@ -11,8 +11,8 @@ Set up launchctl to auto start `mongod`

    You can use launchctl to start and stop `mongod`

    $ launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mongodb.plist
    $ launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mongodb.plist
    $ launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mongodb.plist
    $ launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.mongodb.plist

    You can also more conveniently use `brew` to start, stop, and verify service status

    @@ -23,3 +23,10 @@ You can also more conveniently use `brew` to start, stop, and verify service sta
    ## Notes

    The default plist provided by homebrew stores the mongod configuration at `/usr/local/etc/mongod.conf`. This configuration specifies the `dbpath` to be `/usr/local/var/mongodb` instead of the default `/data/db`.

    For more about `launchctl` see:

    https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/launchctl.1.html#//apple_ref/doc/man/1/launchctl

    http://launchd.info/

  3. @subfuzion subfuzion created this gist Mar 18, 2014.
    25 changes: 25 additions & 0 deletions mongo-autostart-osx.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,25 @@
    Homebrew
    --------

    brew install mongodb

    Set up launchctl to auto start `mongod`

    $ ln -sfv /usr/local/opt/mongodb/*.plist ~/Library/LaunchAgents

    `/usr/local/opt/mongodb/` is a symlink to `/usr/local/Cellar/mongodb/x.y.z` (e.g., `2.4.9`)

    You can use launchctl to start and stop `mongod`

    $ launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mongodb.plist
    $ launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mongodb.plist

    You can also more conveniently use `brew` to start, stop, and verify service status

    $ brew services list | grep mongodb
    $ brew services start mongodb
    $ brew services stop mongodb

    ## Notes

    The default plist provided by homebrew stores the mongod configuration at `/usr/local/etc/mongod.conf`. This configuration specifies the `dbpath` to be `/usr/local/var/mongodb` instead of the default `/data/db`.