如何在Debian 11上安装MongoDB

发布于 2025-01-25 15:09:50 字数 816 浏览 1 评论 0原文

我遵循了如何将MongoDB安装到Debian 11中的描述,该描述可以在Severall地方找到。由于所有人都描述了这一点,所以我选择了其中一个。 每个输入都按预期工作。甚至尝试使用

sudo systemctl启动mongod

不会造成任何错误。当我检查状态时

sudo systemctl状态mongod

Mongod.Service -MongoDB数据库服务器 已加载:已加载(/lib/systemd/system/mongod.service; enabled;启用;供应商预设:启用) 活跃:失败(结果:信号)自2022-04-30 19:31:40 CEST; 3s前 文档: https://docs.mongodb.org/manual 过程:506851 execstart =/usr/bin/mongod -config /etc/mongod.conf(code = nide,signal = ill) 主PID:506851(代码=杀死,信号= ill) CPU:12ms

,如果我尝试致电Mongo,我会收到德语的消息:

“ungültigerMaschinenbefehl”

我戴上了几次并重新定义了几次,但结果总是相同的。 有人有任何想法吗?

I followed the description of how to install MongoDB to Debian 11 that can be found in severall places. Since all describe the same, I selected one of them.
Every input works as expected. Even the attempt to start the service with

sudo systemctl start mongod

does not create any error. When I check the status with

sudo systemctl status mongod

I receive:

mongod.service - MongoDB Database Server
Loaded: loaded (/lib/systemd/system/mongod.service; enabled; vendor preset: enabled)
Active: failed (Result: signal) since Sat 2022-04-30 19:31:40 CEST; 3s ago
Docs: https://docs.mongodb.org/manual
Process: 506851 ExecStart=/usr/bin/mongod --config /etc/mongod.conf (code=killed, signal=ILL)
Main PID: 506851 (code=killed, signal=ILL)
CPU: 12ms

and if I try to call mongo, I receive the message in German:

"Ungültiger Maschinenbefehl"

I deinstalled and reistalled a few times, but the result is always the same.
Does anybody has any idea?

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

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

发布评论

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

评论(2

萌︼了一个春 2025-02-01 15:09:50

我问我的V-Server提供商NetCup。该系统确实支持DIE AVX指令集。因此,无法安装MongoDB 5.0,这就是指令错误的原因。
我必须安装MongoDB 4.4。那确实有用。

I asked NetCup, my Provider of the V-Server. The system does support die AVX instruction set. Therefore MongoDB 5.0 cannot be installed and that is the reason for the instruction error.
I had to install MongoDB 4.4. That did work.

南城追梦 2025-02-01 15:09:50

“ungültigerMaschinenbefehl”

看起来非常像“非法指令”(也由(code = night,signal = ill)暗示了Systemd的打印量:根据 man 7 Signal Sigill确实是非法指令

当二进制的机器代码包含您不理解的指令时,就会发生“非法指示”。

现在,有几个保障措施可以防止您运行完全不相容的二进制文件(例如,在RaspberryPi上尝试运行AMD64二进制文件),但即使对于给定的体系结构(例如,AMD64) )有许多 CPU变体,具有不同的(附加)指令集。

因此,就您而言,最有可能使用所有可用的加速度使用所有可用的加速度来为最新,最出色的CPU(或您的架构)编辑。不幸的是,您的您的 cpu似乎年龄较大(不支持这些漂亮的说明),并且一旦执行达到这样的说明,该程序就会终止。

现在官方 debian套餐竭尽全力支持最小的基线CPU ,该指令集几乎可以在给定体系结构的所有CPU上使用(带有缺点,带有缺点,它不是最优化的CPU)。
但是,您正在使用一些第三方的包裹,他们似乎不在乎与较旧的CPU(或者只是不知道问题)的兼容性。

如何解决该问题:

  • 专门针对CPU重新编译您的软件,
  • 要求二进制文件提供商为Legacy CPU(可能使用基线CPU(如Debian本身)提供二进制文件)
  • 升级您的CPU

"Ungültiger Maschinenbefehl"

that looks very much like an "illegal instruction" (which is also hinted at by the (code=killed, signal=ILL) printout of systemd: according to man 7 signal, the meaning of SIGILL is indeed illegal instruction
.

An "illegal instruction" happens, when the machine code of your binary contains instructions that your CPU does not understand.

Now, there are a couple of safeguards that prevent you to run binaries that are totally incompatible (e.g. trying to run an amd64 binary on a RaspberryPi), but even for a given architecture (e.g. amd64) there are many CPU variants, with different (additional) instruction sets.

So in your case most likely MongoDB was compiled for the latest and greatest CPU (or your architecture) using all the nifty SIMD and whatnot accelerations available. Unfortunately your CPU appears to be older (not supporting these nifty and whatnot instructions), and as soon as the execution reaches such an instruction, the program terminates.

Now official Debian packages go to great lengths to support a minimal baseline CPU, that has an instruction set that is available on virtually all CPUs of the given architecture (with the drawback, that it is not the most optimized CPU).
However, you are using packages by some 3rd party, who seem to not care for compatibility with older CPUs (or who are just not aware of the problem).

How to solve the issue:

  • recompile your software specifically for your CPU
  • ask the providers of the binaries to also provide a binary for legacy CPUs (probably using a baseline CPU like Debian itself)
  • upgrade your CPU
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文