반응형
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- mongo
- WIL
- 자바스크립트
- nest.js
- Java
- 트러블슈팅
- 생각일기
- mongoose
- 생각로그
- CS
- 회고
- js
- 기록
- 리눅스
- MongoDB
- til
- javascript
- 네트워크
- Grafana
- react
- 피드백
- Git
- array
- next.js
- 주간회고
- 생각정리
- 코테
- typescript
- mysql
- 알고리즘
Archives
- Today
- Total
코딩일상
[MongoDB] WiredTiger 캐시 크기 조정 본문
반응형
기본적으로 MongoDB는 전체 RAM의 50%까지 사용
wiredTigerCacheSizeGB 설정을 조정
< mongod.conf > 파일 내용 수정 아래 와 같이
storage:
wiredTiger:
engineConfig:
cacheSizeGB: 4 # 예: 4GB로 설정
수정후 아래 명령어를 통해 mongoDB 재시작
sudo systemctl restart mongod
몽고 상태 확인 명령어
sudo systemctl status mongodb
wiredTigerCacheSizeGB 설정 확인하는 방법
db.serverStatus().wiredTiger.cache["maximum bytes configured"]
결과값 변환 ==> 7740588032 / (1024 * 1024 * 1024) ≈ 7.21 GB
에러 케이스
sudo systemctl status mongodb
명령어 실행시 아래와 같은 에러 발생시
Process: 8724 ExecStart=/usr/bin/mongod --quiet --config /etc/mongod.conf (code=exited, status=14)
하기 명령어 3개 실행
sudo chown -R mongodb:mongodb /var/lib/mongodb
sudo chown mongodb:mongodb /tmp/mongodb-27017.sock
sudo service mongod restart
* 폴더의 소유자가 root나 다른 사용자로 변경되면, MongoDB가 해당 폴더에 접근할 수 없어서 실행이 안 됨.
이를 다시 mongo 쪽으로 소유를 돌리기위한 작업
참고
Mongodb (code=exited, status=14) failed but not any clear errors
I have VPS with Ubuntu 18.04 LTS with Mongodb and my script was working until 3 days ago fine, but suddenly my hosting server was rebooted (I purchased it from a hosting company) and when my server...
stackoverflow.com
반응형
Comments