macOS Big Sur 또는 macOS Catalina 에서 추가 작업이 필요하다.

전체 설치 과정은 [DB]몽고DB 설치 - macOS Big Sur 참조

# 테스트 환경 #
- macOS Big Sur 버전 11.x.x
- mongodb community 버전 4.2.x
- Homebrew 버전 3.x.x

 

오류 원인 : 데이터를 저장하는 폴더를 다음과 같이 만들 경우, 현재 macOS Big Sur에서에서 mongo적용되지 않는다.

$ sudo mkdir -p /data/db
mkdir: /data/db: Read-only file system

위 메시지 무시하고 설치 진행하면 다음과 같은 오류 메시지를 만난다.

오류 메시지 : 

[initandlisten] exception in initAndListen: NonExistentPath: Data directory /data/db not found. Create the missing directory or specify another path using (1) the --dbpath command line option, or (2) by adding the 'storage.dbPath' option in the configuration file., terminating

 

해결 : dbpath 설정 - 일반적으로 /data/db 경로이지만, /data/db 경로는 macOS Catalina부터 현재 Big Sur 버전에서 적용되지 않으므로, 다음과 같은 다른 경로를 설정한다.

mongod --dbpath /usr/local/var/mongodb/

 

+ Recent posts