我正在使用Meteor Blaze,现在想通过Meteor Galaxy部署我的应用程序。一切都在本地主机上运作。
现在,我尝试将我的应用从Windows计算机部署到Galaxy。
不幸的是,我总是收到以下错误日志,容器崩溃了:
2017-08-14 11:50:38+02:00/app/bundle/programs/server/node_modules/fibers/future.js:313
2017-08-14 11:50:38+02:00 throw(ex);
2017-08-14 11:50:38+02:00 ^
2017-08-14 11:50:39+02:00MongoError: not authorized on admin to execute command { listIndexes: “users”, cursor: { } }
2017-08-14 11:50:39+02:00 at Object.Future.wait (/app/bundle/programs/server/node_modules/fibers/future.js:449:15)
2017-08-14 11:50:39+02:00 at [object Object].MongoConnection._ensureIndex (packages/mongo/mongo_driver.js:832:10)
2017-08-14 11:50:39+02:00 at [object Object].Mongo.Collection._ensureIndex (packages/mongo/collection.js:686:20)
2017-08-14 11:50:39+02:00 at setupUsersCollection (packages/accounts-base/accounts_server.js:1490:9)
2017-08-14 11:50:39+02:00 at new AccountsServer (packages/accounts-base/accounts_server.js:51:5)
2017-08-14 11:50:39+02:00 at meteorInstall.node_modules.meteor.accounts-base.server_main.js (packages/accounts-base/server_main.js:9:12)
2017-08-14 11:50:39+02:00 at fileEvaluate (packages/modules-runtime.js:333:9)
2017-08-14 11:50:39+02:00 at require (packages/modules-runtime.js:228:16)
2017-08-14 11:50:39+02:00 at /app/bundle/programs/server/packages/accounts-base.js:2038:15
2017-08-14 11:50:39+02:00 at /app/bundle/programs/server/packages/accounts-base.js:2049:3
2017-08-14 11:50:39+02:00 - - - - -
2017-08-14 11:50:39+02:00 at Function.MongoError.create (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-core/lib/error.js:31:11)
2017-08-14 11:50:39+02:00 at queryCallback (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-core/lib/cursor.js:212:36)
2017-08-14 11:50:39+02:00 at /app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-core/lib/connection/pool.js:469:18
2017-08-14 11:50:39+02:00 at nextTickCallbackWith0Args (node.js:489:9)
2017-08-14 11:50:39+02:00 at process._tickCallback (node.js:418:13)
2017-08-14 11:50:39+02:00 Application exited with code: 1
2017-08-14 11:50:44+02:00 The container has crashed. A new container will be started to replace it.
它可能与我在启动应用程序或部署应用程序时创建的“dev_bundle”文件夹有关吗?或者我是否必须在settings.json
文件中的环境变量中搜索错误?
我正在使用MongoDB Atlas,连接字符串的结构与mongoDB Atlas提供的结构相同。 settings.json
文件如下所示:
{
"galaxy.meteor.com": {
"env": {
"ROOT_URL": "http://myapp.eu.meteorapp.com",
"MONGO_URL": "mongodb://<myUsername>:<password>@<clusterName>-shard-00-00-<xxxxx>.mongodb.net:27017,<clusterName>-shard-00-01-<xxxxx>.mongodb.net:27017,<clusterName>-shard-00-02-<xxxxx>.mongodb.net:27017/admin?ssl=true&replicaSet=<clusterName>-shard-0&authSource=admin",
"MONGO_OPLOG_URL": "mongodb://<myUsernameForOplog>:<password>@<clusterName>-shard-00-00-<xxxxx>.mongodb.net:27017,<clusterName>-shard-00-01-<xxxxx>.mongodb.net:27017,<clusterName>-shard-00-02-<xxxxx>.mongodb.net:27017/local?ssl=true&replicaSet=<clusterName>-shard-0&authSource=admin"
}
}
}
答案 0 :(得分:1)
您的错误是:
MongoError:管理员未授权执行命令{listIndexes:“users”,cursor:{}}
好像你的MONGO_URL
错了,你能分享一下吗(不包括关键信息:凭证等)?
<强>加了:强>
您尝试读取/写入admin
数据库,但您应该创建自己的数据库,例如meteor
。
以下是MONGO_URL
的外观:
mongodb://.../meteor?ssl=true&replicaSet=...&authSource=admin
您的MONGO_OPLOG_URL
很好,您无需更改。