이글에 잘 나와있음
http://dalinaum-kr.tumblr.com/post/2986196227/hello-homebrew#disqus_thread
homebrew로 mongodb설치 후
/data/db 폴더 없다고 에러나고 권한 없다고 해서 sudo mongod를 실행해줌
다시 메뉴얼 보니까
요래 하라고 나와있네; 그럼 sudo로 실행안해도 권한이 생기겠다.
진짜 데몬이 뜬다;
park-jinwooui-MacBook-Pro:~ jinwoo$ sudo mongod
mongod --help for help and startup options
Sat May 5 01:06:05 [initandlisten] MongoDB starting : pid=35702 port=27017 dbpath=/data/db/ 64-bit host=park-jinwooui-MacBook-Pro.local
Sat May 5 01:06:05 [initandlisten] db version v2.0.4, pdfile version 4.5
Sat May 5 01:06:05 [initandlisten] git version: 329f3c47fe8136c03392c8f0e548506cb21f8ebf
Sat May 5 01:06:05 [initandlisten] build info: Darwin erh2.10gen.cc 9.8.0 Darwin Kernel Version 9.8.0: Wed Jul 15 16:55:01 PDT 2009; root:xnu-1228.15.4~1/RELEASE_I386 i386 BOOST_LIB_VERSION=1_40
Sat May 5 01:06:05 [initandlisten] options: {}
Sat May 5 01:06:05 [initandlisten] journal dir=/data/db/journal
Sat May 5 01:06:05 [initandlisten] recover : no journal files present, no recovery needed
Sat May 5 01:06:05 [websvr] admin web console waiting for connections on port 28017
데몬 띄운 모습
아래는 local db 접속
park-jinwooui-MacBook-Pro:~ jinwoo$ mongo
MongoDB shell version: 2.0.4
connecting to: test
> db.test.save({a:1})
> db.test.find()
{ "_id" : ObjectId("4fa3fea752fcbf92079cea43"), "a" : 1 }
> db.test.save({a:1,b:2})
> db.test.find()
{ "_id" : ObjectId("4fa3fea752fcbf92079cea43"), "a" : 1 }
{ "_id" : ObjectId("4fa3febd52fcbf92079cea44"), "a" : 1, "b" : 2 }
mongo라는 명령어는 사실 javascript interface shell을 호출한다.
참고 http://docs.mongodb.org/master/reference/mongo/
nosql 관련해서 읽어볼 거리들
http://highlyscalable.wordpress.com/2012/03/01/nosql-data-modeling-techniques/
https://docs.google.com/document/d/10yun1BzZJZtm4H9H31V-v_FhY39pfjJjkoCafNniJ4U/edit?pli=1
mongo db aggregation 프레임워크 설명
http://docs.mongodb.org/master/applications/aggregation/
'Programing' 카테고리의 다른 글
redis cluster 구성하기 (0) | 2014.09.23 |
---|---|
redis transaction (0) | 2014.09.10 |
redis pipeline (0) | 2014.09.10 |
redis (0) | 2014.09.08 |
logback (0) | 2014.07.25 |