此文已由作者温正湖授权网易云社区发布。
欢迎访问网易云社区,了解更多网易技术产品运营经验。
要想精通一个数据库,除了知道该数据库的功能特性、使用方法等,还需要能够看懂数据库源码,能够使用gdb工具对其进行调试跟踪,如果能够修改源码,实现自己所需的功能,那是极好的。本文简单介绍如何在debian 7上编译MongoDB 3.4源码。官方的编译指南如链接所示:MongoDB编译指南。摘取如下:
To build the master branch, you will need: A modern and complete C++11 compiler. One of the following is required: VS2015 Update 2 or newer GCC 5.3.0Clang 3.4 (or Apple XCode 5.1.1 Clang) or newer Python 2.7SCons 2.3.5 or newer (for MSVC 2015 support)
Further requirements are system-dependent and for both SCons and running the tests: On Linux, you will need to install a compiler gcc or clang, as well as glibc headers which are usually included in a package named glibc-devel. On