在过去的几天里,我尝试了很多方法来让 mongo shell 在 Linaro 集群的 Ubuntu 16.04 for ARM64 (aarch64) 上运行。我目前正在为 ARM 架构上的 meteorjs 开发下一个版本。
TL;DR
虽然 mongod (DB) 在构建后运行良好且没有出现任何问题,但在构建后无法获得运行的 mongo shell [即使没有 javascript (mozjs) 支持]。
最简单的构建:
mkdir -p /tmp/mongo-build cd /tmp/mongo-build git clone --branch "r3.2.6" --depth 1 https://github.com/mongodb/mongo.git cd mongo scons --disable-warnings-as-errors --prefix=/tmp/mongo-build/mongo --js-engine=mozjs mongo mongod
即使此构建将在所有经过测试的平台和体系结构(Linux on armv7l、aarch64、amd64)上运行而在编译期间没有问题,但运行程序的结果会有所不同。
在 amd64 上构建后运行 mongo 命令:
只需运行 mongo shell 并尝试连接到不存在的实例
./mongo mongodb://localhost:5002/sample
这将给出以下输出:
MongoDB shell version: 3.2.6 connecting to: mongodb://localhost:5002/sample 2016-07-05T14:10:23.772+0200 W NETWORK [thread1] Failed to connect to 127.0.0.1:5002, reason: errno:111 Connection refused 2016-07-05T14:10:23.772+0200 E QUERY [thread1] Error: couldn't connect to server localhost:5002, connection attempt failed : connect@src/mongo/shell/mongo.js:223:14 @(connect):1:6 exception: connect failed
在 aarch64/armv7l 上构建后运行 mongo 命令:
与此不同,ARM 上的输出只是:
MongoDB shell version: 3.2.6 Segmentation fault (core dumped)
在我看来,TCP 连接部分可能会出现“分段故障”,但我无法调试。
如果有任何帮助来完成这项工作,我会很高兴。
提前致谢 汤姆
最佳答案
经过多次尝试和编译后,我更改了 mongodb 版本的分支并使用 r3.3.9。
虽然使用相同的 scons 参数,但它似乎运行没有任何问题。我还没有深入研究版本的细节和变化,但是有一个正在运行的版本对我来说很好
mkdir -p /tmp/mongo-build cd /tmp/mongo-build git clone --branch "r3.3.9" --depth 1 https://github.com/mongodb/mongo.git cd mongo scons --disable-warnings-as-errors --prefix=/tmp/mongo-build/mongo --js-engine=mozjs mongo mongod
关于linux - 在 ARM (armv7l/arm64/aarch64) 上构建 mongo shell 3.2.x - 段错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38203407/