【发布时间】:2018-04-18 05:29:01
【问题描述】:
我在this method 之后开始了一个 KeystoneJS 项目。但是进入项目根目录并运行node keystone.js后我收到错误:
------------------------------------------------
An error occurred applying updates, bailing on Keystone init.
Error details:
MongoError: not authorized on <KeystoneJS project name> to execute command { find: "app_updates", filter: { key: "0.0.1-admins" }, limit: 1, batchSize: 1, singleBatch: true }
我研究了这个错误,但我无法解决它。我正在使用 OpenSUSE,并且正在使用 nodejs8 包。
当我通过运行在 systemd 上启动 mongodb 时:
$ sudo systemctl start mongodb.service
...我收到上述错误。
但是当我通过运行启动 mongodb 时:
$ sudo mongod
...我没有收到任何错误,keystonejs 工作正常,我不知道为什么!
当我通过运行$ sudo mongod -f /etc/mongodb.conf 启动 mongodb 时,我收到上述错误。但是当我通过运行$ sudo mongod 启动 mongodb 时,我没有收到任何错误。因此,看起来问题原因在/etc/mongodb.conf 文件中,如下所示:
# mongod.conf
# for documentation of all options, see:
# http://docs.mongodb.org/manual/reference/configuration-options/
# Where and how to store data.
storage:
dbPath: /var/lib/mongodb
#dbPath: /data/db/
journal:
enabled: true
# engine:
# mmapv1:
# wiredTiger:
# Where and how to log messages.
systemLog:
destination: file
logAppend: true
path: /var/log/mongodb/mongod.log
logRotate: reopen
# What type of connections to allow.
net:
port: 27017
bindIp: 127.0.0.1
ipv6: true
http:
enabled: false
JSONPEnabled: false
RESTInterfaceEnabled: false
# How to manage mongod.
processManagement:
fork: true
# Security settings.
security:
authorization: enabled
#operationProfiling:
#replication:
#sharding:
## Enterprise-Only Options:
#auditLog:
#snmp:
【问题讨论】:
标签: mongodb opensuse keystonejs