mongodb v3.2无法在Mac中运行 [英] mongodb v3.2 can't run in mac

查看:228
本文介绍了mongodb v3.2无法在Mac中运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一台运行El Capitan 10.11并带有node.js v6.9.1的Mac. 我正在尝试使用自制软件安装mongodb 3.2.它似乎已安装,但是当我运行mongod时出现此错误:

I have a mac running El Capitan 10.11 with node.js v6.9.1. I am trying to install mongodb 3.2 with homebrew. It seems to install but when I run mongod I get this error:

Found an invalid index { v: 2, key: { version: 1 }, name:
"incompatible_with_version_32",ns: "admin.system.version" } on the
admin.system.version collection: this version of mongod cannot 
build new indexes of version number 2

我以为可能是因为我以前有另一个版本的mongodb,所以我卸载了以前下载并通过"brew list"验证的所有软件包.

I thought it might be because I had another version of mongodb before, so I uninstalled all packages previously downloaded and verified with 'brew list'.

推荐答案

此版本的mongod无法建立版本2的新索引

this version of mongod cannot build new indexes of version number 2

您以前安装过MongoDB 3.4并使用特定于语言的排序规则.

It looks like you previously installed MongoDB 3.4 and created some data files using new features which are not backward compatible with MongoDB 3.2. MongoDB 3.4 introduced v:2 indexes which support language-specific collation.

我以为可能是因为我以前有另一个版本的mongodb,所以我卸载了以前下载并通过"brew list"验证的所有软件包.

I thought it might be because I had another version of mongodb before, so I uninstalled all packages previously downloaded and verified with 'brew list'.

卸载Homebrew软件包通常不会删除软件包公式中未指定的文件(或已指定但现在具有其他文件的目录).这有意使您的MongoDB dbPath完好无损,因此程序包更新不会影响您的数据.

Uninstalling a Homebrew package generally does not remove files that weren't specified in the package formula (or directories that were specified but now have additional files). This intentionally leaves your MongoDB dbPath intact so package updates do not affect your data.

你知道我在这里做错什么吗?

Any idea what Im doing wrong here?

您可以采用几种方法来解决此问题:

There are several approaches you can take to resolve this issue:

  • 安装MongoDB 3.4服务器而不是3.2.
  • 按照记录的步骤将降级 .这将要求使用MongoDB 3.4从数据文件中删除不兼容的功能.
  • 如果dbPath中的先前数据不重要(例如可以重新创建的开发/测试数据),请将dbPath中的所有文件移动到新位置,以便3.2服务器以空数据目录开头. Homebrew的默认dbPath(假设您正在启动/停止MongoDB作为服务)将为/usr/local/var/mongodb.
  • Install a MongoDB 3.4 server instead of 3.2.
  • Follow the documented steps to downgrade MongoDB 3.4 to 3.2. This will require using MongoDB 3.4 to remove incompatible features from your data files.
  • If the previous data in your dbPath is not important (e.g. development/test data that can be recreated), move all files in your dbPath to a new location so your 3.2 server starts with an empty data directory. The default dbPath for Homebrew (assuming you are starting/stopping MongoDB as a service) will be /usr/local/var/mongodb.

这篇关于mongodb v3.2无法在Mac中运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆