www.cnblogs.com/ruiyqinrui

开源、架构、Linux C/C++/python AI BI 运维开发自动化运维。 春风桃李花 秋雨梧桐叶。“力尽不知热 但惜夏日长”。夏不惜,秋不获。@ruiY--秦瑞

python爬虫,C编程,嵌入式开发.hadoop大数据,桉树,onenebula云计算架构.linux运维及驱动开发.

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

<一,linux平台MongoDB安装配置>在这我们使用的Centos6 yum部署的,你想搞编译,自个干!

无auth,启动mongodb

创建账户

重新开启认证登陆

再此用上次的dbpath启动报如下错误,附上错误解决方法

Ok,搞定

命令行关闭数据库

基于yum部署的mongoDB启动控制脚本保存在/etc/init.d/  只针对RHEL内核系统衍生版本,请自行定位,(其实编译和yum,维护工具孰好孰坏?尺度不同,结果各异)

编译的哥们请用如下控制脚本

<二,主要目标在这,搞定MongoDB C driver API>

1,following guide will step you through the process of downloading, building, and installing the current release of the MongoDB C Driver

 MongoDB C driver下载

wget https://github.com/mongodb/mongo-c-driver/releases/download/0.98.0/mongo-c-driver-0.98.0.tar.gz

Minimal dependencies are needed to build the MongoDB C driver. Optionally,
if you want Kerberos (GSSAPI) or SSL support, you need to install libsasl2 and OpenSSL libraries and development headers respectively



sudo make install or su -c "make install";

<三,MongoDB C API>

offical Doc借鉴瞻仰!

http://api.mongodb.org/c/current/?_ga=1.106192963.110691070.1411522327

http://docs.mongodb.org/manual/reference/connection-string/

Connection String URI Format,Standard Connection String Format,standard URI connection scheme:

mongodb://[username:password@]host1[:port1][,host2[:port2],...[,hostN[:portN]]][/[database][?options]]

Example:

MongoDB replic set

mongodb://Ruiy1.cc:27017,Ruiy2.cc:7788/?replicaSet=byRuiy
Connection String Options Crrrent pass

Start live Battle
为了保证大家能愉快的在这一块玩耍,请确保你的MongoDB C driver已经正确安装,Ruiy Tip("Action:Behavior",{"be a light sleeper!",,,,,}),见图吧,说多了就是废话了!

1,Example01
emoving a document from a collection

Total Cost Of Ownership

Exec Command

未完待续!

另一警醒篇

http://www.cnblogs.com/ruiy/p/mongoDbStatementBasic.html

posted on 2014-09-22 23:25  秦瑞It行程实录  阅读(750)  评论(0编辑  收藏  举报
www.cnblogs.com/ruiyqinrui