몽고DB 설치 ( 우분투 )
설치
(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조작방법
(1) 시작
sudo service mongod start
(2) 중지
sudo service mongod stop
(3) 재시작
sudo service mongod restart삭제
(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
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
Congratulations @lku! You received a personal award!
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!