debian 7上源码编译MongoDB 3.4版本
此文已由作者温正湖授权网易云社区发布。
欢迎访问网易云社区,了解更多网易技术产品运营经验。
要想精通一个数据库,除了知道该数据库的功能特性、使用方法等,还需要能够看懂数据库源码,能够使用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 Debian and Ubuntu systems, you must install the libssl-dev package to compile with SSL support.
On Red Hat and CentOS systems, you must install the openssl-devel package to compile with SSL support.
之后,执行scons all 或scons mongod来根据自己的需要编译对应的可执行文件。
但官方的参考指南过于简单,真正在编译的时候,就没有那么轻松了。下面根据在debian 7.8上的实践把无法直接通过apt安装的步骤做下简要记录:
1、编译前,请确保所在的编译目录有不少于30G的磁盘空间;
2、安装gcc
wget http://ftp.gnu.org/gnu/gcc/gcc-5.3.0/gcc-5.3.0.tar.gztar -xvf gcc-5.3.0.tar.gz
cd gcc-5.3.0./contrib/download_prerequisites
./configure --disable-multilib
make
make install
3、安装scons,scons是使用python写的编译工具,相比makefile简单和强大很多
wget https://sourceforge.net/projects/scons/files/scons/2.3.0/scons-2.3.0.tar.gztar -xvf scons-2.3.0.tar.gz
cd scons-2.3.0python ./setup.py install
4、编译MongoDB
wget https://fastdl.mongodb.org/src/mongodb-src-r3.4.7.zipapt-get install zip
unzip mongodb-src-r3.4.7.zip
cd mongodb-src-r3.4.7scons all
网易云免费体验馆,0成本体验20+款云产品!
更多网易技术、产品、运营经验分享请点击。
相关文章:
【推荐】 4月第4周业务风控关注|网络犯罪经济每年1.5万亿美元GDP居全球第12位
【推荐】 年轻设计师如何做好商业设计
debian 7上源码编译MongoDB 3.4版本的更多相关文章
- CentOS 7上源码编译安装和配置LNMP Web+phpMyAdmin服务器环境
CentOS 7上源码编译安装和配置LNMP Web+phpMyAdmin服务器环境 什么是LNMP? LNMP(别名LEMP)是指由Linux, Nginx, MySQL/MariaDB, PHP/ ...
- 记一次在mac上源码编译curl,使其支持NSS的过程
一.背景 在一次学习https原理的过程中,希望客户端指定特定的cipher suites来抓包分析SSL/TLS的握手过程,就想到了使用curl工具,而不是使用浏览器. 接下来使用man curl找 ...
- ubuntu上源码编译安装mysql5.7.27
一.查看操作系统环境和目录结构,并创建mysql用户和组,以及规划安装mysql所需要的目录. #cat /etc/issue 查看发行版本信息: #cat /proc/version 查看正在运行 ...
- 源码编译安装python2/3版本
1- 源码编译安装python2.7版本 1.1- 下载源码包 wget https://www.python.org/ftp/python/2.7.14/Python-2.7.14.tgz 1.2- ...
- centos7 源码编译安装TensorFlow CPU 版本
一.前言 我们都知道,普通使用pip安装的TensorFlow是万金油版本,当你运行的时候,会提示你不是当前电脑中最优的版本,特别是CPU版本,没有使用指令集优化会让TensorFlow用起来更慢. ...
- hadoop源码编译——2.5.0版本
强迫症必治: WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using b ...
- Mac下使用源码编译安装TensorFlow CPU版本
1.安装必要的软件 1.1.安装JDK 8 (1)JDK 8 can be downloaded from Oracle's JDK Page: http://www.oracle.com/techn ...
- linux上源码编译安装mysql-5.6.28
在 linux 上编译安装 mysql-.tar.gz http://www.mysql.com/ mysql下载地址: http://www.mysql.com/downloads/mysql/#d ...
- ubuntu 14.04上源码编译安装php7
wget https://downloads.php.net/~ab/php-7.0.0alpha2.tar.bz2 //用winscp把下载好的文件上传到网站中 tar jxf php-7.0.0a ...
随机推荐
- Nested Classes
http://docs.oracle.com/javase/tutorial/java/javaOO/nested.html package priceton; /* * Copyright (c) ...
- 【题解】 CF734F 【Anton and School】
题解 CF734F [Anton and School] 传送门 这种将位运算和普通运算结合起来的题目要拆位来考虑,可以得到\(log_{2}(\)值域\()\)的算法,甚至将值域看成常数. 根据 \ ...
- OpenGLES 与 WebGL 中顶点属性的组织格式的误解 - 一个不好笑的笑话
版权声明:本文为博主原创文章,未经博主同意不得转载.转载联系 QQ 30952589.加好友请注明来意. https://blog.csdn.net/sleks/article/details/289 ...
- 在linux 中卸载Mysql
一.通用的mysql卸载方式 1.查看系统中是否已经安装了mysql 命令:rpm -qa|grep -i mysql如果有显示msql的安装列表,代表已经安装了. 2.停止mysql服务.删除之前安 ...
- Java for LeetCode 138 Copy List with Random Pointer
A linked list is given such that each node contains an additional random pointer which could point t ...
- 微信小程序开发:学习笔记[7]——理解小程序的宿主环境
微信小程序开发:学习笔记[7]——理解小程序的宿主环境 渲染层与逻辑层 小程序的运行环境分成渲染层和逻辑层. 程序构造器
- Understanding JDBC Internals & Timeout Configuration
原版:http://www.cubrid.org/blog/dev-platform/understanding-jdbc-internals-and-timeout-configuration 中文 ...
- Google IO 2019 Android 太长不看版
Google I/O 2019, 这里有个playlist是所有Android开发相关的session视频合集: Android & Play at Google I/O 2019 当然啦每个 ...
- 【转】数据存储——APP 缓存数据线程安全问题探讨
http://blog.cnbang.net/tech/3262/ 问题 一般一个 iOS APP 做的事就是:请求数据->保存数据->展示数据,一般用 Sqlite 作为持久存储层,保存 ...
- 51Nod 1486 大大走格子 —— 组合数学
题目链接:https://vjudge.net/problem/51Nod-1486 1486 大大走格子 题目来源: CodeForces 基准时间限制:1 秒 空间限制:131072 KB 分值: ...