Guest User

Untitled

a guest
May 25th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. ### Install MongoDB with Homebrew
  2.  
  3. ```bash
  4. brew install mongodb
  5. mkdir -p /data/db
  6. ```
  7. ### Set permissions for the data directory
  8. Ensure that user account running mongod has correct permissions for the directory:
  9.  
  10. ```bash
  11. sudo chmod 0755 /data/db
  12. sudo chown $USER /data/db
  13. ```
  14.  
  15. ### Run MongoDB!
  16. iTerm buffer 1: `mongod`
  17. iTerm buffer 2: `mongo`
  18.  
  19. ---
  20.  
  21. **Note:** If you get something like this:
  22. ```bash
  23. exception in initAndListen: 10309 Unable to create/open lock file: /data/db/mongod.lock errno:13 Permission denied Is a mongod instance already running?, terminating
  24. ```
  25.  
  26. It means that `/data/db` lacks required permission and ownership.
  27.  
  28. Run `ls -ld /data/db/`
  29.  
  30. Output should look like this (`gibber` is directory owner and `wheel` is group to which gibber belongs):
  31. ```bash
  32. drwxr-xr-x 7 gibber wheel 238 Aug 5 11:07 /data/db/
  33. ```
Add Comment
Please, Sign In to add comment