2017-02-24 51 views
2

我在/etc/mongod.conf中取消註釋「security:authorization:enabled」選項時無法啓動mongod?在mongodb上的 3.4.2 在centos6.5;在mongod.conf上打開認證時無法啓動mongodb

這是commond打印出來:

sudo service mongod restart 
Stopping mongod:           [ OK ] 
Starting mongod:           [FAILED] 

這是我的mongod.conf文件: 這裏是commond打印出來:

# 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: 58018 
    bindIp: 127.0.0.1 # Listen to local interface only, comment to listen on all interfaces. 

#security:    <---uncomment here will start failed 
# authorization:enabled <---uncomment here will start failed 
#operationProfiling: 

#replication: 

#sharding: 

## Enterprise-Only Options 

#auditLog: 

#snmp: 

回答

0

一切都還好你只是缺少空間之前啓用關鍵字。空間是非常重要的前啓用

```

security: 
    authorization: enabled 

```

與安全上面的代碼替換您的片段。 很難找到並希望能幫助某人。