https://tecadmin.net/install-mongodb-on-centos/

저장소 설정 추가#

vi /etc/yum.repos.d/mongodb.repo
[MongoDB]
name=MongoDB Repository
baseurl=http://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/4.0/x86_64/
gpgcheck=0
enabled=1

패키지 설치#

yum install mongodb-org

서비스 시작및 활성화#

systemctl start mongod.service    # For CentOS 7 
service mongod restart            # For CentOS 6/5 

systemctl enable mongod.service    # For CentOS 7 
chkconfig mongod on                # For CentOS 6/5 

버전 확인및 기본작업#

[root@tecadmin ~]#  mongod --version

db version v4.0.0
git version: 3b07af3d4f471ae89e8186d33bbb1d5259597d51
OpenSSL version: OpenSSL 1.0.0-fips 29 Mar 2010
allocator: tcmalloc
modules: none
build environment:
    distmod: amazon
    distarch: x86_64
    target_arch: x86_64
[root@tecadmin ~]#  mongo

> use mydb;

> db.test.save( { a: 1 } )

> db.test.find()

  { "_id" : ObjectId("54fc2a4c71b56443ced99ba2"), "a" : 1 }

Add new attachment

Only authorized users are allowed to upload new attachments.
« This page (revision-3) was last changed on 02-Aug-2019 15:17 by DongGukLee  
G’day (anonymous guest) My Prefs

Referenced by
NoSQL

JSPWiki v2.8.4