我遵循此tutorial在树莓派上编译MongoDB。我最终得到了同一仓库中的tarball的内容。
解压后的存档具有以下结构:
mongo-embedded-sdk-4.0.4
include lib share
mongo-embedded-sdk-4.0.4/include:
libbson-1.0 libmongoc-1.0 mongo_embedded mongoc_embedded
mongo-embedded-sdk-4.0.4/include/libbson-1.0:
bson bson.h
mongo-embedded-sdk-4.0.4/include/libbson-1.0/bson:
bcon.h bson-context.h bson-json.h bson-oid.h bson-value.h
bson-atomic.h bson-decimal128.h bson-keys.h bson-reader.h bson-version-functions.h
bson-clock.h bson-endian.h bson-macros.h bson-string.h bson-version.h
bson-compat.h bson-error.h bson-md5.h bson-types.h bson-writer.h
bson-config.h bson-iter.h bson-memory.h bson-utf8.h bson.h
mongo-embedded-sdk-4.0.4/include/libmongoc-1.0:
mongoc mongoc.h
mongo-embedded-sdk-4.0.4/include/libmongoc-1.0/mongoc:
mongoc-apm.h mongoc-error.h mongoc-init.h mongoc-socket.h mongoc-topology-description.h
mongoc-bulk-operation.h mongoc-find-and-modify.h mongoc-iovec.h mongoc-ssl.h mongoc-uri.h
mongoc-change-stream.h mongoc-flags.h mongoc-log.h mongoc-stream-buffered.h mongoc-version-functions.h
mongoc-client-pool.h mongoc-gridfs-file-list.h mongoc-macros.h mongoc-stream-file.h mongoc-version.h
mongoc-client-session.h mongoc-gridfs-file-page.h mongoc-matcher.h mongoc-stream-gridfs.h mongoc-write-concern.h
mongoc-client.h mongoc-gridfs-file.h mongoc-opcode.h mongoc-stream-socket.h mongoc.h
mongoc-collection.h mongoc-gridfs.h mongoc-rand.h mongoc-stream-tls-libressl.h
mongoc-config.h mongoc-handshake.h mongoc-read-concern.h mongoc-stream-tls-openssl.h
mongoc-cursor.h mongoc-host-list.h mongoc-read-prefs.h mongoc-stream-tls.h
mongoc-database.h mongoc-index.h mongoc-server-description.h mongoc-stream.h
mongo-embedded-sdk-4.0.4/include/mongo_embedded:
v1
mongo-embedded-sdk-4.0.4/include/mongo_embedded/v1:
mongo_embedded
mongo-embedded-sdk-4.0.4/include/mongo_embedded/v1/mongo_embedded:
mongo_embedded.h
mongo-embedded-sdk-4.0.4/include/mongoc_embedded:
v1
mongo-embedded-sdk-4.0.4/include/mongoc_embedded/v1:
mongoc_embedded
mongo-embedded-sdk-4.0.4/include/mongoc_embedded/v1/mongoc_embedded:
mongoc_embedded.h
mongo-embedded-sdk-4.0.4/lib:
cmake libbson-1.0.so.0 libmongo_embedded.so libmongoc-1.0.so.0 libmongoc_embedded.so
libbson-1.0.so libbson-1.0.so.0.0.0 libmongoc-1.0.so libmongoc-1.0.so.0.0.0 pkgconfig
mongo-embedded-sdk-4.0.4/lib/cmake:
libbson-1.0 libmongoc-1.0
mongo-embedded-sdk-4.0.4/lib/cmake/libbson-1.0:
libbson-1.0-config-version.cmake libbson-1.0-config.cmake
mongo-embedded-sdk-4.0.4/lib/cmake/libmongoc-1.0:
libmongoc-1.0-config-version.cmake libmongoc-1.0-config.cmake
mongo-embedded-sdk-4.0.4/lib/pkgconfig:
libbson-1.0.pc libmongoc-1.0.pc
mongo-embedded-sdk-4.0.4/share:
doc mongo-c-driver
mongo-embedded-sdk-4.0.4/share/doc:
mongo_embedded mongoc_embedded
mongo-embedded-sdk-4.0.4/share/doc/mongo_embedded:
LICENSE-Community.txt LICENSE-Embedded.txt THIRD-PARTY-NOTICES
mongo-embedded-sdk-4.0.4/share/doc/mongoc_embedded:
LICENSE-Community.txt LICENSE-Embedded.txt
mongo-embedded-sdk-4.0.4/share/mongo-c-driver:
uninstall.sh
当我从软件包中安装它时,我只需要运行
dbPath="/home/pi/app/mongodb_data"
mongod --dbpath "$dbPath" &
问题:
如何启动MongoDB来监听端口?
答案 0 :(得分:1)
您所遵循的教程是将MongoDB构建为可嵌入应用程序(也称为MongoDB Mobile)的库。此嵌入式构建不提供独立的服务器守护程序(mongod
);您必须将此库直接链接到您的应用程序。嵌入式SDK构建的输出是所需的开发头文件(include/*.h
)和编译的库文件(lib/*.so
)。
有关更多信息,请参阅与您找到的回购相关的原始博客文章:Embedded MongoDB 4.0 on Raspberry Pi。
如何启动MongoDB来监听端口?
这需要构建普通的MongoDB社区服务器。您可以尝试按照Build MongoDB from source上的服务器构建说明进行操作,也可以为O / S发行版寻找预编译的二进制文件。
请注意,Raspberry Pi不是服务器普遍支持的目标,因此您可能会遇到一些挑战(尤其是在32位O / S上)。标准的MongoDB服务器设计为在64位硬件上运行,资源比Pi上的资源更多。