-
우분투 18.04.6 LTS에서 몽고DB 설치 및 3T Studio 접속Read | Write/Tech 2022. 3. 17. 11:19
https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/
Install MongoDB Community Edition on Ubuntu — MongoDB Manual
Docs Home → MongoDB ManualMongoDB AtlasMongoDB Atlas is a hosted MongoDB service option in the cloud which requires no installation overhead and offers a free tier to get started.Use this tutorial to install MongoDB 5.0 Community Edition on LTS (long-ter
docs.mongodb.com
운영체제 버전에 따른 명령어 참고
wget -qO - https://www.mongodb.org/static/pgp/server-5.0.asc | sudo apt-key add -
sudo apt-get install gnupg
wget -qO - https://www.mongodb.org/static/pgp/server-5.0.asc | sudo apt-key add -
lsb_release -dc
운영체제 버전
파일 경로
/etc/apt/sources.list.d/mongodb-org-5.0.list
파일 내용deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/5.0 multiverse | sudo tee /etc/apt/sources.list.d/mongodb-org-5.0.list
sudo apt-get update
안정적인 버전 설치
sudo apt-get install -y mongodb-org
버전 확인
mongo -version
데이터와 로그 저장폴더
mkdir -p /mongoData/db
mkdir -p /mongoData/log
설정파일 위치
/etc/mongod.conf
더보기# /etc/mongod.conf
# for documentation of all options, see:
# http://docs.mongodb.org/manual/reference/configuration-options/
# Where and how to store data.
storage:
# dbPath: /var/lib/mongodb
dbPath: /mongoData/db
journal:
enabled: true
# engine:
# wiredTiger:
# where to write logging data.
systemLog:
destination: file
logAppend: true
path: /mongoData/log/mongod.log
# path: /var/log/mongodb/mongod.log
# network interfaces
net:
port: 27017
# bindIp: 127.0.0.1
bindIp: 0.0.0.0
# how the process runs
processManagement:
timeZoneInfo: /usr/share/zoneinfo
#security:
# authorization: enabled
#operationProfiling:
#replication:
#sharding:
## Enterprise-Only Options:
#auditLog:
#snmp:종료 방법
ps -ef | grep mongod
kill -9 [프로세스 번호]
firewall-cmd --permanent --zone=public --add-port=27017/tcpfirewall-cmd --reloadfirewall-cmd --list-all
유저생성과 권한 부여
Add Grant Roles readWrite 권한 부여 Add User Connetion Manager 에서 Edit save connect 몽고 종료 후
/etc/mongod.conf에서 보안 설정 수정
#주석 해제
security:
authorization: enabled재시작
'Read | Write > Tech' 카테고리의 다른 글
안드로이드 스튜디오 kotlinx import error (0) 2022.03.21 Kind에서 url로 단일회사 요약 정보 불러오리 (0) 2022.03.17 API 기반 시스템과 마이크로 서비스의 구별 (0) 2022.03.01 마이크로 서비스 모델 (0) 2022.03.01 #OPM1 (0) 2022.03.01