- mongodb - 在 MongoDB mapreduce 中,如何展平值对象?
- javascript - 对象传播与 Object.assign
- html - 输入类型 ="submit"Vs 按钮标签它们可以互换吗?
- sql - 使用 MongoDB 而不是 MS SQL Server 的优缺点
今天早上我去部署我更新的 Meteor 项目到 Heroku。
我正在从 1.1.0.3
升级到 1.4.1.1
。
使用 Meteor Buildpack Horse一切都安装正确,但应用程序因错误而出错;
MongoError: seed list contains no mongos proxies, replicaset connections requires the parameter replicaSet to be supplied in the URI or options object, mongodb://server:port/db?replicaSet=name
我的 MONGO_URL
是 mongodb://u:p@url1:port,url2:port/db
所以我把它改成了;
mongodb://u:p@url1:port,url2:port/db?replicaSet=set-name
如果我使用replicaSet 参数出错,我会收到此错误;
MongoError: no primary found in replicaset
这似乎是明智的,因为副本集不存在,但是当我输入正确的值时,我再次收到原始错误,说种子列表不包含代理。
我的副本集名称中有一个破折号,我不知道这是否相关。
我尝试使用在 Mongo 客户端中引发此错误的 URL,它允许我很好地连接到实例,所以我知道所有详细信息都是正确的。
我也尝试过转义副本集,所以 ?replicaSet=set\-name
这给了我 MongoError: no primary found in replicaset
错误。
我的 MongoDB 提供商有一张未结的票,但我怀疑这是 Meteor/me 的问题!
最佳答案
Meteor v1.4 使用新版本的 MongoDB 驱动程序。
虽然 MONGO_URL
环境变量的格式正确,但错误是由 MONGO_OPLOG_URL
引起的,应将其修改为包含 replicaSet
论据。
见 this GitHub issue有关更多详细信息和以下说明(关于 Compose.io)。
来自oplog driver documentation :
Oplog tailing is automatically enabled in development mode with
meteor run
, and can be enabled in production with theMONGO_OPLOG_URL
environment variable.(...)
To use oplog tailing in your production Meteor app, your MongoDB servers must be configured as a replica set; a single-
mongod
database has no oplog. Your cluster may not use Mongo sharding.
还有 migration guide :
As of 1.4, you must ensure your
MONGO_OPLOG_URL
contains areplicaSet
argument (see the changelog and the oplog documentation).NOTE: Some MongoDB hosting providers may have a deployment setup that doesn't require you to use a
replicaSet
argument. For example, Compose.io has two types of deployments, MongoDB Classic and MongoDB+. The new MongoDB+ offering is a sharded setup and not a true replica set (despite the shard being implemented as a replica set) so it does not require thereplicaSet
parameter and Meteor will throw an error if you add it to your connection strings.
关于mongodb - Meteor 1.4.1.1 上副本集的正确 MONGO_URL 设置是什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39315149/
我已经在 kubernetes 中部署了一个 3 pod mongodb statefulset,并且我正在尝试使用新的 mongodb+srv 连接字符串 (mongodb 3.6) 连接到具有 S
我已经创建了 MongoDB Atlas 帐户,并尝试连接。但出现以下错误。 MongoDB 连接错误 MongoNetworkError: 首次连接时无法连接到服务器 [cluster0-shard
我正在使用 Node-WebKit 创建桌面应用程序。该应用程序基本上是创建文档(员工日常工作的详细信息),任何注册用户都可以对这些文档发表评论。我正在创建的文档将被分成几个部分。用户将对特定部分发表
我正在尝试使用官方网站上的安装程序在我的本地机器上安装 mongo DB。但是我不断收到这条消息,有人可以帮忙吗? 我试过提供的解决方案 here但没有帮助。 最佳答案 我建议执行以下操作: 按 Wi
我对 MongoDB 和 MongoDB Compass 非常陌生。 我的客户集合中有大约 1000 条记录。如何通过 MongoDB 指南针一次删除所有记录。 非常感谢, 最佳答案 您可以使用 Mo
当我尝试在我的 Ubuntu 机器中安装 mongodb 时,apt-get 会显示以下选项 mongodb mongodb-clients mongodb-dev mongodb-server 谁能
如何将 Robomongo(或任何其他 mongodb 客户端)连接到由本地 Meteor 应用程序创建的 mongodb 实例? 最佳答案 确保 Meteor 正在本地主机上运行。打开终端窗口并运行
我需要在 MongoDB 中生成一个简单的频率表。假设我在名为 books 的集合中有以下文档。 { "_id": 1, genre: [ "Fantasy", "Crime"
我如何在 mongos mapreduce 中指定一个条件,就像我们在 mongos group 函数中所做的那样。 我的数据是这样的 {lid:1000, age:23}, {lid:3000, a
我的 mongodb 数据库文档中有几个 ID。我需要通过脚本在这些 ID 上创建索引,这样我就不必一次又一次地运行 ensureIndex 命令。 db.getCollection("element
在我的数据库中,每个包含项目的文档中都有一个嵌套的元素数组,格式如下: elements:[ { "elem_id": 12, items: [ {"i_id": 1
我正在构建一个应用程序,其中用户可以位于不同的时区,并且我运行的查询对他们的时区很敏感。 我遇到的问题是 MongoDB 似乎在查询时忽略了时区! 这是日期字段“2019-09-29T23:52:13
我正在研究使用 mongodb 进行分片,我有以下结构: 1 个 Mongod 到我的 ConfigServer,在 ReplicaSet 中只有 1 个成员 2 个分片,每个分片在 ReplicaS
我正在尝试获取一个 mongoDB 对象,例如 Friend1 包含另一个 mongoDB 对象 Friend2,该对象又包含第一个对象 Friend1本质上使它成为一个循环对象引用。 要么这样,要么
关闭。这个问题是off-topic .它目前不接受答案。 想改进这个问题? Update the question所以它是on-topic对于堆栈溢出。 9年前关闭。 Improve this que
Mongo 版本 5.0.2。 Ubuntu 20.0 我在本地主机中启用了 MongoDB 连接的安全性。 我正在尝试通过以下命令使用身份验证详细信息连接我的本地主机 MongoDBmongo ad
我即将将分片的 MongoDB 环境从 2.0.7 升级到 2.2.9,最终我想升级到 2.4.9,但显然我需要通过 2.2 来完成。 2.2 的发行说明声明配置服务器应该首先升级其二进制文件,然后是
目前,我无法在我的虚拟 Ubuntu 机器上远程连接 mongodb 服务器。我无法使用在我的 Windows PC 上运行的 Robomongo 客户端连接,该 PC 也运行 vm。 这是两台电脑的
我创建了一个免费的 mongodb 集群。我创建了一个用户,设置了与 mongodb compass 的连接,复制了连接字符串,然后打开了我的 mongodb compass。将复制的字符串粘贴到那里
我使用 java 代码创建了 mongo 数据库集合索引 dbCollection.createIndex("accountNumber"); 当我看到索引使用 db.accounts.getInde
我是一名优秀的程序员,十分优秀!