MongoDB C Driver Building on CentOS
Building on Unix
Prerequisites
OpenSSL is required for authentication or for SSL connections to MongoDB. Kerberos or LDAP support requires Cyrus SASL.
To install all optional dependencies on RedHat / Fedora: $ sudo yum install pkg-config openssl-devel cyrus-sasl-devel
On Debian / Ubuntu: $ sudo apt-get install pkg-config libssl-dev libsasl2-dev
On FreeBSD: $ su -c 'pkg install pkgconf openssl cyrus-sasl'
Building from a release tarball
Unless you intend on contributing to the mongo-c-driver, you will want to build from a release tarball.
The most recent release of libmongoc is 1.8.1 and can be downloaded here. The following snippet will download and extract the driver, and configure it:
$ wget https://github.com/mongodb/mongo-c-driver/releases/download/1.8.1/mongo-c-driver-1.8.1.tar.gz
$ tar xzf mongo-c-driver-1.8.1.tar.gz
$ cd mongo-c-driver-1.8.1
$ ./configure --disable-automatic-init-and-cleanup
亲测:
https://github.com/mongodb/mongo-c-driver/releases/download/1.8.1/mongo-c-driver-1.8.1.tar.gz 这个地址下载超慢
所以还是从 git 下载源码
Building from git
To build an unreleased version of the driver from git requires additional dependencies.
RedHat / Fedora: $ sudo yum install git gcc automake autoconf libtool
Debian / Ubuntu: $ sudo apt-get install git gcc automake autoconf libtool
FreeBSD: $ su -c 'pkg install git gcc automake autoconf libtool'
Once you have the dependencies installed, clone the repository and build the current master or a particular release tag:
$ git clone https://github.com/mongodb/mongo-c-driver.git
$ cd mongo-c-driver
$ git checkout x.y.z # To build a particular release
$ ./autogen.sh --with-libbson=bundled
$ make
$ sudo make install
1.
下载 mongo-c-driver-r1.6 源码:
https://github.com/mongodb/mongo-c-driver(GitHub驱动源码,这个 src/libbson 文件夹里面是空的,要单独下载)
下载 libbson-r1.6 源码:
https://github.com/mongodb/mongo-c-driver/tree/r1.6/src
2.
解压:
unzip mongo-c-driver-r1.6.zip
unzip libbson-r1.6.zip
3.
将 libbson 源码 拷贝 至 mongo-c-driver-r1.6/src/libbson 目录
4.
sudo yum install pkg-config openssl-devel cyrus-sasl-devel
./autogen.sh --with-libbson=bundled (得先安装 libtoll ,否则会报错。sudo yum install libtool*)
make
sudo make install
安装完成的库和头文件目录:
/usr/local/lib
/usr/local/include
API 用法详见:http://www.cnblogs.com/SZxiaochun/p/5848455.html
注意:
使用库的时候报错:
error while loading shared libraries: libevent-1.4.so.2: cannot open shared object file: No such file or directory
原因:
程序按照默认共享库路径找不到该共享库文件。
解决方法:
详见:http://www.cnblogs.com/SZxiaochun/p/7685499.html
MongoDB C Driver Building on CentOS的更多相关文章
- MongoDB C Driver Building on Windows
一.编译mongodb c driver: 需要先安装OpenSSL:(参见:http://bbs.aircheng.com/read-2222-1) 步骤:(MongoDB步) 1.下载Active ...
- MongoDB C Driver and APIinstances linux MongoDB安装配置
<一,linux平台MongoDB安装配置>在这我们使用的Centos6 yum部署的,你想搞编译,自个干!
- MongoDB Java Driver操作指南
MongoDB为Java提供了非常丰富的API操作,相比关系型数据库,这种NoSQL本身的数据也有点面向对象的意思,所以对于Java来说,Mongo的数据结构更加友好. MongoDB在今年做了一次重 ...
- MongoDB C Driver使用教程
MongoDB C Driver使用教程 转载请注明出处http://www.cnblogs.com/oloroso/ 本指南提供简介 MongoDB C 驱动程序. 在 C API 的详细信息,请参 ...
- windows平台下安装、编译、使用mongodb C++ driver
本博客将记录在Win8.1 ,VS2013环境下编译.配置mongodb C++ driver的流程. 1.下载预备 下载Boost:http://sourceforge.net/projects/b ...
- Ignoring Extra Elements in mongoDB C# Driver
MongoDB删除字段后会报错: Element ... does not match any field or property of class Customer. 需要在实体类增加 [BsonI ...
- Install MongoDB on Red Hat Enterprise, CentOS, Fedora, or Amazon Linux
Install MongoDB on Red Hat Enterprise, CentOS, Fedora, or Amazon Linux¶ Overview Use this tutorial t ...
- mongodb .net driver
1.介绍 The official MongoDB .NET Driver provides asynchronous interaction with MongoDB. Powering the d ...
- Mongodb Java Driver 参数配置解析
要正确使用Mongodb Java Driver,MongoClientOptions参数配置对数据库访问的并发性能影响极大. connectionsPerHost:与目标数据库能够建立的最大conn ...
随机推荐
- uWSGI listen queue 队列溢出的问题
如果没有设置uwsgi的--listen,如果sysctl -a | grep net.core.somaxconn发现net.core.somaxconn=128. 那你使用uwsgi启动的服务,单 ...
- HBase操作(Shell与Java API)
版权声明:本文为博主原创文章,未经博主允许不得转载. 转: http://blog.csdn.net/u013980127/article/details/52443155 下面代码在Hado ...
- frame自适应
<html> <head> <title>frame自适应</title> </head> <frameset rows=" ...
- 对JSON格式的城市按照拼音首字母排序
需求说明: App应用中最常见的一种操作就是对城市按照拼音首字母排序,以方便选择城市.而已有的json格式的城市数据是没有这种排序的. 已有的json格式的城市数据格式如下[简化之后]: 数据格式说明 ...
- js如何获取前后连续n天的时间
function GetDateStr(AddDayCount) { var dd = new Date(); dd.setDate(dd.getDate()+AddDayCount);//获取Add ...
- tcp/udp只发不接,会丢包还是send失败?
这篇文章源于我看libevent的源码时想到的问题,对于libevent的buffer机制,如果接受端一直不取数据的话,会怎样?如果丢包,不现实,因为会导致数据丢失,如果不丢包,就会导致占用内存一直扩 ...
- #define SIG_DFL ((void(*)(int))0)
在linux内的信号处理函数中,有#define SIG_DFL ((void(*)(int))0)和#define SIG_IGN ((void(*)(int))1)两个宏定义.要理解这两个宏定义, ...
- Zabbix之Python发送邮件
前言:继前篇zabbix邮件乱码问题解决,转码后,问题是解决了,但是又发现问题,有时候告警邮件没有邮件内容,只有标题,一直没找出原因,所以就换了Python脚本发送邮件,代码如下. 使用前当然是要先安 ...
- model number
// test.cpp : Defines the entry point for the console application. // #include "stdafx.h" ...
- sqlserver 目录名称无效解决办法
问题描述: 1.sqlserver 打开表提示:目录名称无效 2.在执行sql语句时提示:在执行批处理时出现错误.错误消息为: 目录名无效 3.所有的数据库都存在1跟2的问题 问题分析: 1.操作系统 ...