-
Conf Options GuideDatabase/MongoDB 2023. 2. 2. 23:05
Conf 파일은 yum , apt 를 이용한 설치시 /etc/mongod.conf 에 구성됩니다.
Conf 파일은 YAML 포멧을 사용합니다.
Command Line 이 길어지면 불편하기 때문에 mongod.conf 를 기준으로 하여 설정사항에 대하여 안내합니다.
Command Line 구성시 각 Option 의 Command 는 아래 참조를 확인하세요.
Option Command : https://docs.mongodb.com/manual/reference/configuration-file-settings-command-line-options-mapping/#std-label-conf-file-command-line-mapping
systemLog Options
systemLog: verbosity: <int> quiet: <boolean> traceAllExceptions: <boolean> syslogFacility: <string> path: <string> logAppend: <boolean> logRotate: <string> destination: <string> timeStampFormat: <string> component: accessControl: verbosity: <int> command: verbosity: <int> # COMMENT additional component verbosity settings omitted for brevity
verbosity
Type Default Description Integer 0 상세로그레벨 설정 ( 1 ~ 5 로 높을 수록 상세하게 로깅 ) quiet
Type Default Description boolean false 로그의 출력양을 제한합니다. 설정시 Tracking이 어려워 집니다. traceAllExceptions
Type Default Description boolean false 디버깅을 위한 상세 정보 출력 설정 syslogFacility
Type Default Description string user systemLog.destination 이 설정되어 있어야 사용가능합니다.
syslog 에 메시지를 기록할 때 사용되는 사용자입니다.path
Type Default Description string X syslog 가 아닌 mongos, mongod 의 로그 생성 경로 logAppend
Type Default Description boolean false 기존 로그파일에 붙임여부, false 시 기존 로그를 백업하고 로그파일을 추가합니다. logRotate
Type Default Description string rename linux logrotate 기능에 따른 동작지정
rename : 로그파일의 이름을 변경합니다.
repoen : 로그파일을 닫고 다시 엽니다. 해당 기능은 logAppend 가 활성화 되어 있어야합니다.destination
Type Default Description string X 로그 출력의 목적지를 정합니다. file or syslog timeStampFormat
Type Default Description string iso8601-local 로그에 시간 포멧을 지정합니다.
iso8601-utc : UTC 기준
iso8601-local : 현지시간 기준component
systemLog: component: accessControl: verbosity: <int> command: verbosity: <int> # COMMENT some component verbosity settings omitted for brevity replication: verbosity: <int> election: verbosity: <int> heartbeats: verbosity: <int> initialSync: verbosity: <int> rollback: verbosity: <int> storage: verbosity: <int> journal: verbosity: <int> recovery: verbosity: <int> write: verbosity: <int>
Option Type Default Description accessControl.verbosity integer 0 액세스 제어와 관련된 구성 요소에 대한 로그 메시지 상세 수준입니다. (0~5) command.verbosity integer 0 명령과 관련된 구성 요소에 대한 로그 메시지 상세 수준입니다. (0~5) control.verbosity integer 0 제어 작업과 관련된 구성 요소의 로그 메시지 상세 수준입니다. (0~5) ftdc.verbosity integer 0 통계 데이터 수집 작업과 관련된 구성 요소의 로그 메시지 상세 수준입니다. (0~5) geo.verbosity integer 0 지리 공간 구문 분석 작업과 관련된 구성 요소에 대한 로그 메시지 상세 수준입니다. (0~5) index.verbosity integer 0 인덱싱 작업과 관련된 구성 요소의 로그 메시지 상세 수준입니다. (0~5) network.verbosity integer 0 네트워킹 작업과 관련된 구성 요소에 대한 로그 메시지 상세 수준입니다. (0~5) query.verbosity integer 0 쿼리 작업과 관련된 구성 요소의 로그 메시지 상세 수준입니다. (0~5) replication.verbosity integer 0 ReplicaSet 관련 구성 요소의 로그 메시지 상세수준입니다. (0~5) replication.election.verbosity integer 0 ReplicaSet 선택과 관련된 구성 요소의 로그 메시지 상세수준입니다. (0~5) replication.heartbeats.verbosity integer 0 ReplicaSet 의 HB 관련된 요성 요소의 로그 메시지 상세수준입니다. (0~5) replication.initialSync.verbosity integer 0 ReplicaSet의 초기 동기화작업과 관련된 구성 요소의 로그 메시지 상세 수준입니다. (0~5) replication.rollback.verbosity integer 0 롤백과 관련된 구성 요소에 대한 로그 메시지 상세 수준입니다. (0~5) sharding.verbosity integer 0 Sharding 과 관련된 로그 메시지 상세 수준입니다. (0~5) storage.verbosity integer 0 스토리지와 관련된 구성 요소에 대한 로그 메시지 상세 수준입니다. storage.journal.verbosity integer 0 스토리지 저널링과 관련된 구성 요소에 대한 로그 메시지 상세 수준입니다. (0~5) storage.recovery.verbosity integer 0 스토리지 복구와 관련된 구성 요소에 대한 로그 메시지 상세 수준입니다. (0~5) transaction.verbosity integer 0 트랜잭션과 관련된 구성 요소의 로그 메시지 상세 수준입니다. (0~5) write.verbosity integer 0 쓰기 작업과 관련된 구성 요소의 로그 메시지 상세 수준입니다. (0~5) processManagement Options
processManagement: fork: <boolean> pidFilePath: <string> timeZoneInfo: <string>
fork
Type Default Description boolean false 데몬 모드로 실행할지에 대한 여부 입니다. pidFilePath
Type Default Description string PID File Not Make mongos또는 mongod 프로세스 의 PID (프로세스 ID)를 저장할 파일 위치를 지정합니다. timeZoneInfo
Type Default Description string MongoDB Default TimeZone 표준 시간대 데이터베이스 경로. 보편적으로 /usr/share/zoneinfo 를 사용합니다. cloud Options
cloud: monitoring: free: state: <string> tags: <string>
Option Type Default Description monitoring.free.state string MongoDB Community Edition 에서 사용가능합니다.
무료 클라우드 모니터링을 설정합니다.
runtime : 런타임중 무료 모니터링을 제어
on : 시작시 모니터링 활성화
off : 시작시 모니터링 비활성화monitoring.free.tags string MongoDB Community Edition 에서 사용가능합니다.
환경 컨텍스트를 설명하는 태그net Options
net: port: <int> bindIp: <string> bindIpAll: <boolean> maxIncomingConnections: <int> wireObjectCheck: <boolean> ipv6: <boolean> unixDomainSocket: enabled: <boolean> pathPrefix: <string> filePermissions: <int> tls: certificateSelector: <string> clusterCertificateSelector: <string> mode: <string> certificateKeyFile: <string> certificateKeyFilePassword: <string> clusterFile: <string> clusterPassword: <string> CAFile: <string> clusterCAFile: <string> CRLFile: <string> allowConnectionsWithoutCertificates: <boolean> allowInvalidCertificates: <boolean> allowInvalidHostnames: <boolean> disabledProtocols: <string> FIPSMode: <boolean> compression: compressors: <string> serviceExecutor: <string>
port
Type Default Description integer 27017 : mongos , Non Sharded mongod
27018 : sharded mongod
27019 : config serverMongoDB Instance 의 서비스 Port bindIp
Type Default Description string localhost Socket Binding IP bindIpAll
Type Default Description boolean false 모든 IP 주소로 바인딩할지에 대한 여부 maxIncomingConnections
Type Default Description integer 65536 최대 동시 연결 수 wireObjectCheck
Type Default Description boolean bool 클라이언트의 요청에 대한 유효성 검사 여부 ipv6
Type Default Description boolean false IPv6 지원 여부 unixDomainSocket
net: unixDomainSocket: enabled: <boolean> pathPrefix: <string> filePermissions: <int>
Option Type Default Description unixDomainSocket.enabled boolean true 유닉스 환경에서만 동작합니다.
유닉스 도메인 소켓에 대한 지원여부unixDomainSocket.pathPrefix string /tmp 유닉스 환경에서만 동작합니다.
유닉스 소켓 경로unixDomainSocket.filePermissions integer 0700 유닉스 도메인 소켓 파일에 Permission 설정 tls
net: tls: mode: <string> certificateKeyFile: <string> certificateKeyFilePassword: <string> certificateSelector: <string> clusterCertificateSelector: <string> clusterFile: <string> clusterPassword: <string> CAFile: <string> clusterCAFile: <string> CRLFile: <string> allowConnectionsWithoutCertificates: <boolean> allowInvalidCertificates: <boolean> allowInvalidHostnames: <boolean> disabledProtocols: <string> FIPSMode: <boolean>
Option Type Default Description tls.mode string disabled TLS 사용설정
disabled : 사용안함
allowTLS : 서버간에는 TLS 사용하지 않음
preferTLS : 서버간에는 TLS를 사용합니다.
requireTLS : TLS 만 허용합니다.tls.certificateKeyFile string TLS 인증시 사용될 키 파일 tls.certificateKeyFilePassword string 인증서의 암호 tls.certificateSelector string 인증시 인증서를 선택하기 위한 인증서 속성개체 설정
subject , thumbprinttls.clusterCertificateSelector string x509 인증에 사용할 인증서선택을 위한 인증서 속성개체 tls.clusterFile string x509 인증에 사용할 키 파일 tls.clusterPassword string x509 인증에 사용할 인증서 암호 tls.CAFile string 인증 기관의 루트 인증서 체인이 포함 된 .pem 파일 tls.clusterCAFile string 클라이언트가 제시 한 인증서의 유효성을 검사하는 데 사용되는 인증 기관의 루트 인증서 체인이 포함 된 .pem 파일입니다. tls.CRLFile string .pem 인증서 해지 목록 ( 더 이상 유효하지 않은 인증서의 목록 ) tls.allowConnectionsWithoutCertificates boolean TLS / Non TLS 에 대한 혼합 사용 여부 tls.allowInvalidCertificates boolean TLS 인증서에 대한 유효성 검사를 비활성화 하고 잘못된 인증서도 허용할지에 대한 여부 tls.allowInvalidHostnames boolean false 인증서의 호스트 이름이 지정된 호스트 이름과 일치하지 않는 경우 허용여부 tls.disabledProtocols string 사용하지 않을 특정 TLS 프로토콜 ( TLS1_0, TLS1_1, TLS1_2, TLS1_3 ) tls.FIPSMode boolean TLS 라이브러리의 FIPS 모드 사용여부 compression
net: compression: compressors: <string>
Option Type Default Description compression.compressors string snappy, zstd, zlib mongod, mongos 인스턴스간 통신에서 사용될 압축기를 지정합니다. serviceExecutor
Type Default Description string sync 쓰레드 동작에 대한 실행형태를 설정 security Options
security: keyFile: <string> clusterAuthMode: <string> authorization: <string> transitionToAuth: <boolean> javascriptEnabled: <boolean> redactClientLogData: <boolean> clusterIpSourceWhitelist: - <string> sasl: hostName: <string> serviceName: <string> saslauthdSocketPath: <string> enableEncryption: <boolean> encryptionCipherMode: <string> encryptionKeyFile: <string> kmip: keyIdentifier: <string> rotateMasterKey: <boolean> serverName: <string> port: <string> clientCertificateFile: <string> clientCertificatePassword: <string> clientCertificateSelector: <string> serverCAFile: <string> connectRetries: <int> connectTimeoutMS: <int> ldap: servers: <string> bind: method: <string> saslMechanisms: <string> queryUser: <string> queryPassword: <string> useOSDefaults: <boolean> transportSecurity: <string> timeoutMS: <int> userToDNMapping: <string> authz: queryTemplate: <string> validateLDAPServerConfig: <boolean>
keyFile
Type Default Description string MongoDB Instance 간 인증에 사용되는 Key 파일 clusterAuthMode
Type Default Description string keyFile 클러스터 인증 모드
keyFile : 비밀키 형식
sendKeyFile : 인증을 위해 키파일을 보내지만 키파일과 x509 인증을 모두 수락하는 형태
sendX509 : x509 인증서를 보내지만 키파일과 x509 인증서를 모두 수락하는 형태
x509 : x509 인증만 수락authorization
Type Default Description string disabled 데이터베이스 엑세스 제어. 활성화 시 사용자는 권한이 부여된 데이터베이스 리소스 및 작업에만 엑세스 가능 transitionToAuth
Type Default Description boolean false ReplicaSet 구성상태에서 인스턴스 다운으로 메인 인스턴스 전환시 새로 인증을 통해 재접속처리를 하지 않고 사용할 수 있도록 지정합니다. javascriptEnabled
Type Default Description boolean true Js 코드 실행에 대한 허용여부 redactClientLogData
Type Default Description boolean false MongoDB Enterprise에서만 사용할 수 있습니다.
개인식별정보와 같은 민감성 정보에 대한 부분을 Log 에서 삭제처리clusterIpSourceWhitelist
Type Default Description list ReplicaSet 구성원 및 Shard 의 접근에 대한 허용 IP를 목록화 하여 관리합니다. security: clusterIpSourceWhitelist: - 192.0.2.0/24 - 127.0.0.1 - ::1
enableEncryption
Type Default Description boolean false MongoDB Enterprise에서만 사용할 수 있습니다.
WiredTiger 스토리지 엔진에 대한 암호화 사용여부encryptionCipherMode
Type Default Description string AES256-CBC MongoDB Enterprise에서만 사용할 수 있습니다.
암호화 방식
AES256-CBC , AES256-GCMencryptionKeyFile
Type Default Description string MongoDB Enterprise에서만 사용할 수 있습니다.
KMIP 이외의 프로세스를 통해 키를 관리 할 때 로컬 키 파일에 대한 경로kmip
MongoDB Enterprise에서만 사용할 수 있습니다.
Option Type Default Description kmip.keyIdentifier string KMIP 서버 내의 기존 키에 대한 고유 KMIP 식별자 kmip.rotateMasterKey boolean false true이면 마스터 키를 회전하고 내부 키 저장소를 다시 암호화합니다. kmip.serverName string 연결할 KMIP 서버의 호스트 이름 또는 IP 주소 kmip.port string 5696 KMIP 서버와 통신하는 데 사용할 포트 번호 kmip.clientCertificateFile string 클라이언트 인증서 경로 kmip.clientCertificatePassword string 클라이언트 인증서 패스워드 kmip.clientCertificateSelector string 인증하기 위해 인증서 속성을 지정 kmip.serverCAFile string CA 파일의 경로 kmip.connectRetries integer 0 재 시도하는 횟수 kmip.connectTimeoutMS integer 5000 응답 대기 시간 sasl
Option Type Default Description sasl.hostName string SASL 및 Kerberos 인증을 구성하기위한 정규화 된 서버 도메인 이름 sasl.serviceName string mongodb SASL을 사용하여 등록 된 서비스 이름 sasl.saslauthdSocketPath string .NET, Unix 도메인 소켓 파일 경로 ldap
MongoDB Enterprise에서만 사용할 수 있습니다.
Option Type Default Description ldap.servers string LDAP Server IP ldap.bind.queryUser string LDAP 서버에 연결하거나 쿼리를 수행 할 때 mongod또는 mongos바인딩 하는 ID ldap.bind.queryPassword string LDAP 서버에 바인딩하는 데 사용되는 비밀번호 ldap.bind.useOSDefaults boolean false Windows 에서만 사용할 수 있습니다. ldap.bind.method string simple 바인딩 형식
simple : 단순인증
sasl : SASL 프로토콜 인증ldap.bind.saslMechanisms string DIGEST-MD5 SASL 메커니즘을 지정합니다. ldap.transportSecurity string tls LDAP 에 대한 보안연결형식 ldap.timeoutMS integer 10000 LDAP 에 응답 Timeout ldap.userToDNMapping string LDAP 식별 이름 (DN) 에 mongod또는 mongos인증을 위해 제공된 사용자 이름을 매핑 ldap.authz.queryTemplate string 인증 된 사용자가 속한 LDAP 그룹을 가져오기 위한 쿼리 URL ldap.validateLDAPServerConfig boolean true LDAP 가용성 확인 (사용여부 확인) setParameter Options
setParameter: <parameter1>: <value1> <parameter2>: <value2>
conf 파일에서 구동시 명령의 파라미터를 지정할 때 사용합니다.
storage Options
storage: dbPath: <string> journal: enabled: <boolean> commitIntervalMs: <num> directoryPerDB: <boolean> syncPeriodSecs: <int> engine: <string> wiredTiger: engineConfig: cacheSizeGB: <number> journalCompressor: <string> directoryForIndexes: <boolean> maxCacheOverflowFileSizeGB: <number> // deprecated in MongoDB 4.4 collectionConfig: blockCompressor: <string> indexConfig: prefixCompression: <boolean> inMemory: engineConfig: inMemorySizeGB: <number> oplogMinRetentionHours: <double>
dbPath
Type Default Description string /data/db 데이터를 저장 하는 디렉토리 journal.enabled
Type Default Description boolean x64 : true, x86 : false 데이터 파일이 유효하고 복구 가능한 상태로 유지되도록 지정 journal.commitIntervalMs
Type Default Description integer 100 저널 작업간에 허용 하는 최대 시간 (ms) (1~500) directoryPerDB
Type Default Description boolean false DB간 디렉토리 분리여부 syncPeriodSecs
Type Default Description integer 60 데이터를 파일로 갱신하기까지의 시간
되도록 수정하지 않을것을 권고합니다.engine
Type Default Description string wiredTiger 스토리지 엔진 지정
wiredTiger, inMemoryoplogMinRetentionHours
Type Default Description double 0 oplog 보존시간 ( 1.5 는 1시간 30분을 의미합니다. ) wiredTiger
engine 이 wiredTiger 일때 사용됩니다.
Option Type Default Description wiredTiger.engineConfig.cacheSizeGB float (RAM-1GB) / 2 , 최소값 256MB 내부 캐시 최대 크기를 지정 wiredTiger.engineConfig.journalCompressor string snappy 데이터를 압축할때 사용할 압축 유형
none, snappy, zlib, zstdwiredTiger.engineConfig.directoryForIndexes boolean false 스토리지의 디렉토리들을 인덱스 기준으로 생성하여 저장 wiredTiger.engineConfig.maxCacheOverflowFileSizeGB float 0 버전 4.4 이상부터 사용되지 않습니다. ( 캐시 오버 플로우 시 자동 종료 설정 ) wiredTiger.collectionConfig.blockCompressor string snappy 콜렉션 데이터의 기본 압축을 지정
none, snappy, zlib, zstdwiredTiger.indexConfig.prefixCompression boolean true 인덱스에 대한 압축 여부 inmemory
engine 이 inmemory 인 경우 사용됩니다.
Option Type Default Description inMemory.engineConfig.inMemorySizeGB float Ram / 2 - 1GB MongoDB Enterprise에서만 사용할 수 있습니다.
inmemory 엔진의 최대 메모리 사용량operationProfiling Options
operationProfiling: mode: <string> slowOpThresholdMs: <int> slowOpSampleRate: <double> filter: <string>
mode
Type Default Description string off 프로파일러 기능 동작 지정
off : 데이터를 수집하지 않음
slowOp : 오래 걸리는 작업에 대한 데이터 수집
all : 모든 데이터 수집slowOpThresholdMs
Type Default Description integer 100 설정보다 오래걸린 작업은 느린것으로 간주합니다. slowOpSampleRate
Type Default Description double 1.0 프로파일 링하거나 기록해야하는 느린 작업 의 비율 filter
Type Default Description string 프로파일 링되고 기록되는 작업을 제어하는 필터 표현식
2초 이상 걸리는 쿼리에 대해 기록
ex) filter: '{ op: "query", millis: { $gt: 2000 } }'replication Options
replication: oplogSizeMB: <int> replSetName: <string> enableMajorityReadConcern: <boolean>
oplogSizeMB
Type Default Description integer Disk 의 5% 복제작업에 대한 로그의 최대 크기(MB) replSetName
Type Default Description string 소속된 ReplicaSet 이름 enableMajorityReadConcern
Type Default Description boolean true 다중 구성에서 읽기 동작시 데이터의 내구성을 보장
비활성화 하지 말것을 권고합니다.sharding Options
sharding: clusterRole: <string> archiveMovedChunks: <boolean>
clusterRole
Type Default Description string 샤드 클러스터에서 인스턴스가 갖는 역할 ( configsvr, shardsvr ) archiveMovedChunks
Type Default Description boolean false 청크 마이그레이션 중 샤드는 샤드에서 마이그레이션 된 문서를 저장하지 않습니다. auditLog Options
MongoDB Enterprise 및 MongoDB Atlas 에서만 사용할 수 있습니다.
auditLog: destination: <string> format: <string> path: <string> filter: <string>
destination
Type Default Description string 모든 감사 이벤트를 보내 거나 보낼 위치 format
Type Default Description string 감사 이벤트에 대한 출력 형식 ( JSON, BSON ) path
Type Default Description string 출력 파일 경로 filter
Type Default Description string 특정 조건의 작업을 감사하기 위한 필터 snmp Options
snmp: disabled: <boolean> subagent: <boolean> master: <boolean>
disabled
Type Default Description boolean false SNMP Access 비활성화 여부 subagent
Type Default Description boolean SNMP 가 서브 에이전트로 실행 master
Type Default Description boolean SMNP Master 로 실행 mongos-전용 옵션
replication: localPingThresholdMs: <int> sharding: configDB: <string>
replication.localPingThresholdMs
Type Default Description integer 15 ReplicaSet 에 구성원간 ping 시간 sharding.configDB
Type Default Description string config server 에 대한 지정 참조 : https://docs.mongodb.com/manual/reference/configuration-options/
'Database > MongoDB' 카테고리의 다른 글
Import, Export, Dump (0) 2023.02.02 ReadConcern & WriteConcern (1) 2023.02.02 Transaction (0) 2023.02.02 ReplicaSet (0) 2023.02.02 2대의 서버로 구성하는 개발용 Shard Cluster (1) 2023.02.02