brewã§è¡ãã°ç°¡åããã§ãã、ã¾ã (2015/02/06æ¥ç¾å¨)3.0ã§ããªããããªã®ã§
æåã«ã¦ã¤ã³ã¹ãã¼ã«
ã¤ã³ã¹ãã¼ã«å
/Users/{ã¦ã¼ã¶å}/mongoldb
※以å¾ã®ã¦ã¼ã¶åã¯èªåã®ååã«æ¸ãæãã¦ä¸ãã.
$ cd ~/Downloads/ # DLã¨è§£åãã¤ã³ã¹ãã¼ã« $ curl -O http://downloads.mongodb.org/osx/mongodb-osx-x86_64-3.0.0-rc6.tgz $ tar -zxvf mongodb-osx-x86_64-3.0.0-rc6.tgz $ mkdir -p ~/mongodb $ cp -R -n mongodb-osx-x86_64-3.0.0-rc6/ ~/mongodb # DLãããã¡ã¤ã«ãåé¤ $ rm -rf mongodb-osx-x86_64-3.0.0-rc6/ $ rm mongodb-osx-x86_64-3.0.0-rc6.tgz # ãã¹ãéãã¾ã. $ echo "export PATH=/Users/{ã¦ã¼ã¶å}/mongodb/bin:\$PATH" >> ~/.bash_profile $ source ~/.bash_profile $ mkdir -p ./data/db $ mongod --dbpath ./data/db # ã¡ãªã¿ã«ä»¥ä¸ã®ããã«ããã¨ãã°ãæ¸ãè¾¼ã¿ã§ãã¾ã。 $ sudo mongod --dbpath ./data/db --logpath /var/log/mongodb.log
以ä¸ã§ã¢ã¯ã»ã¹ããã¨ã¨ããããåãã¾ãã。
$ mongo ================================== MongoDB shell version: 3.0.0-rc6 connecting to: test Welcome to the MongoDB shell. For interactive help, type "help". For more comprehensive documentation, see http://docs.mongodb.org/ Questions? Try the support group http://groups.google.com/group/mongodb-user Server has startup warnings: 2015-02-06T01:07:50.323+0900 I CONTROL [initandlisten] ** WARNING: You are running this process as the root user, which is not recommended. 2015-02-06T01:07:50.323+0900 I CONTROL [initandlisten] > ==================================
launchd/launchctlãå©ç¨ã、èµ·åæã«å®è¡ã§ããããã«ãã¾ã。
sudo vi /Library/LaunchDaemons/org.mongodb.mongod.plist ====以ä¸ãè²¼ãä»ã======================================================= # 権éãä»ä¸ $ sudo chown root:wheel /Library/LaunchDaemons/org.mongodb.mongod.plist $ sudo chmod 644 /Library/LaunchDaemons/org.mongodb.mongod.plist # ãµã¼ãã¹ã®å®è¡ $ sudo launchctl load /Library/LaunchDaemons/org.mongodb.mongod.plist # ãµã¼ãã¹ã®åæ¢ # sudo launchctl unload /Library/LaunchDaemons/org.mongodb.mongod.plist Label org.mongodb.mongod RunAtLoad ProgramArguments /Users/{ã¦ã¼ã¶å}/mongodb/bin/mongod --dbpath /Users/{ã¦ã¼ã¶å}/mongodb/data/db --logpath /var/log/mongodb.log
次åã«è§¦ã£ã¦ã¿ããã¨æãã¾ã。
ã¨ããããä»æ¥ã¯ããã¾ã§