메뉴 건너뛰기

Cloudera, BigData, Semantic IoT, Hadoop, NoSQL

Cloudera CDH/CDP 및 Hadoop EcoSystem, Semantic IoT등의 개발/운영 기술을 정리합니다. gooper@gooper.com로 문의 주세요.


mongodb mongodb 2.6.6 설치(64bit)

총관리자 2015.09.30 10:48 조회 수 : 323

1. 다운로드

[root@localhost ~]$ wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-2.6.6.tgz
--2015-09-30 10:42:03--  https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-2.6.6.tgz
Resolving fastdl.mongodb.org... 54.230.248.7, 54.230.248.97, 54.230.253.74, ...
Connecting to fastdl.mongodb.org|54.230.248.7|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 116039527 (111M) [application/x-gzip]
Saving to: `mongodb-linux-x86_64-2.6.6.tgz'

100%[=================================================================================================>] 116,039,527 11.7M/s   in 17s

2015-09-30 10:42:21 (6.57 MB/s) - `mongodb-linux-x86_64-2.6.6.tgz' saved [116039527/116039527]

2. 압축해제

[root@localhost ~]$ tar xvfz mongodb-linux-x86_64-2.6.6.tgz
mongodb-linux-x86_64-2.6.6/README
mongodb-linux-x86_64-2.6.6/THIRD-PARTY-NOTICES
mongodb-linux-x86_64-2.6.6/GNU-AGPL-3.0
mongodb-linux-x86_64-2.6.6/bin/mongodump
mongodb-linux-x86_64-2.6.6/bin/mongorestore
mongodb-linux-x86_64-2.6.6/bin/mongoexport
mongodb-linux-x86_64-2.6.6/bin/mongoimport
mongodb-linux-x86_64-2.6.6/bin/mongostat
mongodb-linux-x86_64-2.6.6/bin/mongotop
mongodb-linux-x86_64-2.6.6/bin/mongooplog
mongodb-linux-x86_64-2.6.6/bin/mongofiles
mongodb-linux-x86_64-2.6.6/bin/bsondump
mongodb-linux-x86_64-2.6.6/bin/mongoperf
mongodb-linux-x86_64-2.6.6/bin/mongod
mongodb-linux-x86_64-2.6.6/bin/mongos
mongodb-linux-x86_64-2.6.6/bin/mongo

3. 링크 생성

[root@localhost ~]$ ln -s mongodb-linux-x86_64-2.6.6 mongodb

4. 디렉토리생성

[root@localhost ~]$ cd mongodb

[root@localhost mongodb]$ mkdir data
[root@localhost mongodb]$ mkdir config
[root@localhost mongodb]$ mkdir log

5. mongodb.conf파일 생성

[root@localhost mongodb]$ cd config
[root@localhost config]$ vi mongodb.conf

dbpath=/home/root/mongodb/data
logpath=/home/root/mongodb/log/mongodb.log
logappend=true
port=5050
verbose=true
fork=true
reset=true
 

6. mongodb server데몬기동

[root@localhost mongodb]$ /home/root/mongodb/bin/mongod --config /home/root/mongodb/config/mongodb.conf
2015-09-30T11:04:56.407+0900 ** WARNING: --rest is specified without --httpinterface,
2015-09-30T11:04:56.407+0900 **          enabling http interface
about to fork child process, waiting until server is ready for connections.
forked process: 48592
child process started successfully, parent exiting

*data폴더에 아래와 같은 파일과 경로가 생성된다.

drwxrwxr-x 2 root root     4096 2015-09-30 11:25 _tmp
drwxrwxr-x 2 root root     4096 2015-09-30 11:25 journal
-rw------- 1 root root 67108864 2015-09-30 11:25 local.0
-rw------- 1 root root 16777216 2015-09-30 11:25 local.ns
-rwxrwxr-x 1 root root        6 2015-09-30 11:25 mongod.lock

7. mongodb client기동

[root@localhost mongodb]$ /home/root/mongodb/bin/mongo localhost:5050

> db
test
> use db
switched to db db
> use test
switched to db test

Insert
SQL              : insert into users ("name","city") values("terry","seoul")
Mongo DB     : db.users.insert({_id:"terry",city:"seoul"})
 
Select
SQL              : select * from users where id="terry"
Mongo DB     : db.users.find({_id:"terry"})
 
Update
SQL              : update users set city="busan" where _id="terry"
Mongo DB     : db.users.update( {_id:"terry"}, {$set :{ city:"Busan" } } )
 
Delete
SQL              : delete from users where _id="terry"
Mongo DB     : db.users.remove({_id:"terry"})

 

 

 

 

번호 제목 날짜 조회 수
161 동일서버에서 LA와 LC동시에 기동하여 테스트 2014.04.01 1047
160 hadoop 기반 문서 검색 2014.09.25 1049
159 Using The ZooKeeper CLI에서 zkCli의 위치 2014.11.02 1057
158 mybatis와 spring을 org.apache.commons.dbcp2.BasicDataSource의 DataSource로 연동할때 DB설정(참고) 2016.10.31 1074
157 특정파일이 생성되어야 action이 실행되는 oozie job만들기(coordinator.xml) 2014.05.20 1080
156 oozie 에서 sqoop action실행 에러 - 컬럼개수 차이 2014.07.17 1081
155 postgresql-9.4에서 FATAL: remaining connection slots are reserved for non-replication superuser connections가 나올때 조치 2018.08.16 1085
154 [Magento]php7에 Composer를 이용하여 Magento 2.1.3 설치 file 2017.01.30 1097
153 dual table만들기 2014.05.16 1104
152 [백업] 리눅스 시스템 백업하기 (Linux System Backup) - TAR 사용 시스템 전체 백업 2022.01.19 1111
151 Impala의 Queries탭에서 여러조건으로 쿼리 찾기 2018.05.09 1114
150 unique한 값 생성 2014.04.25 1124
149 hive에서 insert overwrite directory.. 로 하면 default column구분자는 'SOH'혹은 't'가 됨 2014.05.20 1124
148 Flume과 Kafka를 사용한 초당 100만개 로그 수집 테스트 file 2016.10.31 1126
147 cloudera(python 2.7.5)에서 anaconda3로 설치한 외부 python(3.6.6)을 이용하여 pyspark를 사용하는 설정 2018.09.14 1126
146 Building a Cluster docs 2014.04.22 1129
145 "Initial job has not accepted any resources; check your cluster UI to ensure that workers are registered and have sufficient resources"오류 발생시 조치사항 2016.05.25 1133
144 DataNode를 기동할때 "Block pool ID needed, but service not yet registered with NN" 오류 발생에 따른 조치사항 2018.05.28 1147
143 Current heap configuration for MemStore and BlockCache exceeds the threshold required for successful cluster operation 2017.07.18 1151
142 impala 설치/설정 2016.06.03 1161
위로