MongoDB 假定 64 位系统 - 这意味着硬件还是操作系统内核,还是两者兼而有之?

发布于 2024-09-19 15:19:34 字数 378 浏览 5 评论 0原文

这篇文章说如果您的数据大于 2GB,则需要 64 位系统来运行 MongoDB。

在我的本地机器(运行 32 位 Mac OS X Leopard 的 64 位 Intel C2D)中,MongoDB 64 位版本运行没有任何错误。

在服务器上,运行32位CentOS 5.0的64位机器,64位MongoDB将无法运行。 32位运行正常。

我的问题是,MongoDB 是否要求硬件和操作系统内核都是 64 位?如果是这样,为什么我在上述系统中的体验存在差异?

This post says that you need a 64 bit system for MongoDB if your data is bigger than 2GB.

In my local machine, a 64 bit Intel C2D running 32 bit Mac OS X Leopard, the MongoDB 64 bit version runs without any error.

On the server, a 64 bit machine running 32 bit CentOS 5.0, the 64 bit MongoDB won't run. 32 bit runs OK.

My question is, does MongoDB requires both Hardware AND the OS Kernel to be 64 bit? If so, why the discrepancy in my experience in the above systems?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

梦里梦着梦中梦 2024-09-26 15:19:35

MAC OS X 是一个特例,因为它非常努力地向用户隐藏整个 32/64 位内容。
据我所知,Leopard 已经通过一些技巧支持 64 位应用程序。

MAC OS X is a special case, since it tries VERY hard to hide the whole 32/64 bit stuff from the user.
Leopard, afaik, already supports 64 bit apps through some tricks.

待天淡蓝洁白时 2024-09-26 15:19:34

实际上,要求是如果您想要处理超过 2GB 的数据,则需要使用 64 位版本的 mongod 可执行文件。这需要 64 位操作系统,而 64 位操作系统又需要 64 位硬件。

该要求与物理内存无关,而是关于单个进程可以处理多少虚拟内存。由于 mongodb 使用 mmap 来映射数据文件的内容,因此您必须至少有足够的虚拟地址空间来容纳所有数据。请注意,PAE不会增加虚拟地址空间。 PAE 纯粹是一种物理地址扩展,允许您拥有超过 3.5GB 的 RAM。

编辑:看起来以 32 位模式运行的内核可以以支持 64 位用户空间的方式编写。不过,据我所知,在 64 位硬件上运行的 OSX 是唯一使用此功能的示例。在 Windows 和 Linux 上,您必须安装 64 位版本的操作系统才能运行 64 位软件。

Actually the requirement is that if you want to work with more than about 2GB of data you need to use a 64-bit version of the mongod executable. This requires a 64-bit OS which in turn requires 64-bit hardware.

The requirement has nothing to do with physical ram and is about how much virtual memory a single process can address. Since mongodb uses mmap to map the contents of data files, you must have at least enough virtual address space to fit all of your data. Note that virtual address space is not increased by PAE. PAE is purely a Physical Address Extension to allow you to have more than about 3.5GB of RAM.

Edit: It looks like it is possible for a kernel running in 32bit mode to be written in a way to support 64bit userspace. OSX running on 64bit hardware is the only example I know of that uses this though. On windows and linux you must install the 64bit version of the operating system to run 64bit software.

街道布景 2024-09-26 15:19:34

如果你的数据> 2GB,内核需要能够寻址>2GB 2GB内存。这需要 64 位内核,或者您可以尝试使用 PAE 内核扩展以允许32 位内核可寻址更多 RAM。

也许 MAC OS X 已经有类似 PAE 扩展的东西,因此存在差异。

If your data is > 2GB, the kernel needs to be able to address > 2GB memory. This requires either a 64-bit kernel, or you could try using the PAE kernel extension to allow a 32-bit kernel to address more RAM.

Perhaps MAC OS X already has something like the PAE extension, hence the discrepancy.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文