몽고DB 설치 ( 우분투 )

in krdevdbmongoinstall •  2 years ago 
  1. 설치
    (1) 패키지 관리 시스템에서 사용하는 public Key 가져 오기
    sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5
    (2) MongoDB에 대한 목록 파일 만들기
    [1]Ubuntu12.04 : echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu precise/mongodb-org/3.6 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.6.list
    [2] Ubuntu14.04 : echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.6 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.6.list
    [3] Ubuntu16.04 : echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.6 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.6.list
    (3) apt-get 업데이트
    sudo apt-get update
    (4) 패키지 설치
    sudo apt-get install -y mongodb-org
    [참고] 특정 패키지 설치
    sudo apt-get install -y mongodb-org=3.6.3 mongodb-org-server=3.6.3 mongodb-org-shell=3.6.3 mongodb-org-mongos=3.6.3 mongodb-org-tools=3.6.3
    (5) 마무리작업
    echo "mongodb-org hold" | sudo dpkg --set-selections
    echo "mongodb-org-server hold" | sudo dpkg --set-selections
    echo "mongodb-org-shell hold" | sudo dpkg --set-selections
    echo "mongodb-org-mongos hold" | sudo dpkg --set-selections
    echo "mongodb-org-tools hold" | sudo dpkg --set-selections

  2. 조작방법
    (1) 시작
    sudo service mongod start
    (2) 중지
    sudo service mongod stop
    (3) 재시작
    sudo service mongod restart

  3. 삭제
    (1) DB정지
    sudo service mongod stop
    (2) 패키지 삭제
    sudo apt-get purge mongodb-org*
    (3) 데이터 디렉토리 삭제
    sudo rm -r /var/log/mongodb
    sudo rm -r /var/lib/mongodb

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Congratulations @lku! You have received a personal award!

1 Year on Steemit
Click on the badge to view your Board of Honor.

Do not miss the last post from @steemitboard!


Participate in the SteemitBoard World Cup Contest!
Collect World Cup badges and win free SBD
Support the Gold Sponsors of the contest: @good-karma and @lukestokes


Do you like SteemitBoard's project? Then Vote for its witness and get one more award!

Congratulations @lku! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 2 years!

You can view your badges on your Steem Board and compare to others on the Steem Ranking

Vote for @Steemitboard as a witness to get one more award and increased upvotes!