해결 Error parsing YAML config file: yaml-cpp: error at line 32,column 1: end of map not found
1571 단어 MongoDB
mongod --config /etc/mongod.conf
닥친 여러 가지 실수
Error parsing YAML config file: yaml-cpp: error at line 32, column 1: end of map not found
Error parsing command line: the required argument for option '--config' is missing
Unrecognized option: auth
try 'mongod --help' for more information
위의 오류들은 모두 프로필 형식의 오류 때문에 어이가 없습니다
mongodb 3.0 이후 프로필은 YAML 형식을 사용합니다. 이 형식은 매우 간단합니다. 사용: 처음에는'공백'을 들여쓰기로 했습니다.주의해야 할 것은':'이후value가 있으면 빈칸을 따라야 하고, 키가 등급만 표시하면':'뒤에 빈칸을 추가할 필요가 없다. (예를 들어 시스템 로그: 뒤에 빈칸이 필요하지 않다.)레벨별로 줄당 4개의 스페이스 바, 두 번째 레벨은 8개의 스페이스 바, 순서대로 회전하며 맨 윗 레벨은 스페이스 바를 필요로 하지 않습니다.형식이 올바르지 않으면 위의 오류가 발생합니다
이 문장을 자세히 읽으면 해결 방법을 찾을 수 있다
내 프로필 첨부:
# mongod.conf
# for documentation of all options, see:
# http://docs.mongodb.org/manual/reference/configuration-options/
# where to write logging data.
systemLog:
destination: file
logAppend: true
path: /var/log/mongodb/mongod.log
# Where and how to store data.
storage:
dbPath: /var/lib/mongo
journal:
enabled: true
# engine:
# mmapv1:
# wiredTiger:
# how the process runs
processManagement:
fork: true # fork and run in background
pidFilePath: /var/run/mongodb/mongod.pid # location of pidfile
# network interfaces
net:
port: 26178
bindIp: 0.0.0.0 # Listen to local interface only, comment to listen on all interfaces.
security:
authorization: enabled
과거 복제 시 형식 문제가 발생할 수 있으니 주의하고 스스로 해결하시오