Mongodb-Security Configuration Optimization

1. Sample MongoDB configuration file

# mongod.conf, Percona Server for MongoDB
# for documentation of all options, see:
#   http://docs.mongo.org/manual/reference/configuration-options/

# Where and how to store data.
storage:
  dbPath: /opt/mongo/mongo_data/ #Data file location
  journal:
    enabled: true
  engine: wiredTiger #Use the wiredTiger storage engine

# Storage engine various options
#  More info for wiredTiger: https://docs.mongo.com/v3.4/reference/configuration-options/#storage-wiredtiger-options
#  wiredTiger:
#    engineConfig:
#      cacheSizeGB: 1
#      checkpointSizeMB: 1000
#      statisticsLogDelaySecs: 0
#      journalCompressor: snappy
#      directoryForIndexes: false
#    collectionConfig:
#      blockCompressor: snappy
# indexConfig:
#      prefixCompression: true


# Two options below can be used for wiredTiger and inMemory storage engines
#setParameter:
#    wiredTigerConcurrentReadTransactions: 128
#    wiredTigerConcurrentWriteTransactions: 128

# where to write logging data.
systemLog:
 destination: file 
 logAppend: true 
 path: /opt/mongo/mongo_log/ mongod.log #Define log file location

processManagement:
  fork: true 
  pidFilePath: /opt/mongo/mongo_log/ mongod.pid #Define pid location

# network interfaces
net:
  port: 27017 
  bindIp: 10.140 . 0.4 #Listening IP
  http:
    JSONPEnabled: false #Close jsonp call 
    RESTInterfaceEnabled: false #Close reset

security:
  authorization: enabled #Enable database authentication
  

#operationProfiling:

#replication:

#sharding:

## Enterprise-Only Options:

#auditLog:

#snmp:

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325873451&siteId=291194637