Linux

mongodb 설치

서른마른다섯 2017. 8. 30. 16:00

0. 다운로드 : https://www.mongodb.com/download-center#community


1. mongodb 설치

  - tar -zxvf mongodb-linux-x86_64-3.4.7.tgz

  - mv mongodb-linux-x86_64-3.4.7 /install/mongodb  

  - mkdir /var/mongodb

  - cd /var/mongodb

  - mkdir data

  - mkdir config

  - mkdir log

 

2. mongodb 설정

  - vi /var/mongodb/config/mongodb.cnf

    dbpath=/install/mongodb

    logpath=/var/install/log/mongodb.log

    logappend=true

    port=5050

    verbose=true

    fork=true

    rest=true

    bind_ip=0.0.0.0

  - vi /etc/profile

    MONGODB_HOME=/install/mongodb

    export PATH=$PATH:$MONGODB_HOME/bin


3. mongodb 실행 및 접속

  - /install/mongodb/bin/mongod --config /var/mongodb/config/mongodb.cnf

  - mongo localhost:5050


4. 데몬 실행서비스 생성

  - vi /etc/init.d/mongodb 

mongo

  - chmod 755 /etc/init.d/mongodb

  - chkconfig mongodb on


X. 외부접속 시 방화벽설정 필요

firewall-cmd --zone=public --add-port=5050/tcp --permanent

firewall-cmd --zone=public --add-port=6050/tcp --permanent

firewall-cmd --reload

'Linux' 카테고리의 다른 글

mongodb replicaset 구성  (0) 2017.09.04
[3-3] Replication & Sentinel 구성  (0) 2016.10.26
[3-2] redis cluster  (0) 2016.10.26
[3-1] redis 설치  (0) 2016.10.26
리눅스 unixODBC FreeTDS 설치 (MSSQL)  (0) 2015.12.02