1,下载:

http://www.mongodb.org/downloads

2.4.5版:http://www.mongodb.org/dr/fastdl.mongodb.org/linux/mongodb-linux-x86_64-2.4.5.tgz/download

2,解压:

hadoop@hadoopmaster:~/nosql$ tar zxvf mongodb-linux-x86_64-2.4.5\ \(1\).tgz
mongodb-linux-x86_64-2.4.5/README
mongodb-linux-x86_64-2.4.5/THIRD-PARTY-NOTICES
mongodb-linux-x86_64-2.4.5/GNU-AGPL-3.0
mongodb-linux-x86_64-2.4.5/bin/mongodump
mongodb-linux-x86_64-2.4.5/bin/mongorestore
mongodb-linux-x86_64-2.4.5/bin/mongoexport
mongodb-linux-x86_64-2.4.5/bin/mongoimport
mongodb-linux-x86_64-2.4.5/bin/mongostat
mongodb-linux-x86_64-2.4.5/bin/mongotop
mongodb-linux-x86_64-2.4.5/bin/mongooplog
mongodb-linux-x86_64-2.4.5/bin/mongofiles
mongodb-linux-x86_64-2.4.5/bin/bsondump
mongodb-linux-x86_64-2.4.5/bin/mongoperf
mongodb-linux-x86_64-2.4.5/bin/mongosniff
mongodb-linux-x86_64-2.4.5/bin/mongod
mongodb-linux-x86_64-2.4.5/bin/mongos
mongodb-linux-x86_64-2.4.5/bin/mongo
hadoop@hadoopmaster:~/nosql$ ls

3,创建目录用来存放数据和log日志

hadoop@hadoopmaster:~/nosql/mongodb-linux-x86_64-2.4.5$ ls
bin GNU-AGPL-3.0 README THIRD-PARTY-NOTICES
hadoop@hadoopmaster:~/nosql/mongodb-linux-x86_64-2.4.5$ mkdir data
hadoop@hadoopmaster:~/nosql/mongodb-linux-x86_64-2.4.5$ mkdir log
hadoop@hadoopmaster:~/nosql/mongodb-linux-x86_64-2.4.5$
hadoop@hadoopmaster:~/nosql/mongodb-linux-x86_64-2.4.5$ cd log/
hadoop@hadoopmaster:~/nosql/mongodb-linux-x86_64-2.4.5/log$ touch mongodb.log

4,启动

①:使用mongod命令建立一个mongodb数据库链接,

hadoop@hadoopmaster:~/nosql/mongodb-linux-x86_64-2.4.5/bin$ ./mongod -dbpath ../data/ --logpath ../log/mongodb.log
all output going to: /home/hadoop/nosql/mongodb-linux-x86_64-2.4.5/bin/../log/mongodb.log
log file [/home/hadoop/nosql/mongodb-linux-x86_64-2.4.5/bin/../log/mongodb.log] exists; copied to temporary file [/home/hadoop/nosql/mongodb-linux-x86_64-2.4.5/bin/../log/mongodb.log.2013-08-17T05-36-47]

数据库的路径为/mongodb/data,

日志路径为/mongodb/log/mongodb.log

也可以通过port指定端口号如:- -port=10000

通过接上fork参数在后台启动: --fork

5,连接:

hadoop@hadoopmaster:~/nosql/mongodb-linux-x86_64-2.4.5/bin$ ./mongo 127.0.0.1:10000
MongoDB shell version: 2.4.5
connecting to: 127.0.0.1:10000/test
> dbsdbs
Sat Aug 17 13:42:15.699 JavaScript execution failed: ReferenceError: dbs is not defined
> dbdb
test
> show collectionsshow collections
>

6,配置文件的方式启动:

配置:

hadoop@hadoopmaster:~/nosql/mongodb-linux-x86_64-2.4.5$ more mongodb.conf
port=10000
dbpath=data/
logpath=log/mongodb.log
logappend=true
fork=true
hadoop@hadoopmaster:~/nosql/mongodb-linux-x86_64-2.4.5$

启动:

hadoop@hadoopmaster:~/nosql/mongodb-linux-x86_64-2.4.5$ ./bin/mongod  -f ./mongodb.conf
about to fork child process, waiting until server is ready for connections.
forked process: 4120
all output going to: /home/hadoop/nosql/mongodb-linux-x86_64-2.4.5/log/mongodb.log
child process started successfully, parent exiting
hadoop@hadoopmaster:~/nosql/mongodb-linux-x86_64-2.4.5$

MongoDB的安装配置的更多相关文章

  1. MongoDB的安装配置、基本操作及Perl操作MongoDB

    MongoDB的安装配置.基本操作及Perl操作MongoDB http://www.myhack58.com/Article/60/63/2014/42353.htm

  2. Linux环境下NodeJS和MongoDB的安装配置

     一.NodeJS的安装配置 #进入安装目录cd /usr/local/ #删除原有安装rm -rf noderm -rf node-v0.10.29-linux-x64 #解压压缩包tar -zxv ...

  3. MongoDB下载+安装+配置+错误解决方法

    下载 官网下载: https://www.mongodb.com/download-center/community Server=>Download 安装 下载完成后安装 建议下载根目录(下过 ...

  4. MongoDB(二)——安装配置了解

    前边介绍了MongoDB的大概理论知识,这篇来对MongoDB进行一下安装使用,支持安装在windows和linux上,当然了很多其它情况下我们是安装在linux上,由于毕竟server用linux的 ...

  5. MongoDB Linux 安装配置 后台运行

    介绍安装的文档很多,可以参考这篇: http://www.mkyong.com/mongodb/how-to-install-mongodb-on-mac-os-x/ 安装完后你可能会碰到的2个问题. ...

  6. mongodb window安装配置

    下载mongodb安装包 1. https://www.mongodb.org/dl/win32/x86_64-2008plus-ssl?_ga=2.233271640.711265466.15193 ...

  7. PHP MongoDB 扩展安装配置

    近日对MongoDB比较感兴趣,在linux下部署了一套LAMP,想把MongoDB加进来,下面进入正题: 1.确保安装好LAMP环境,假设php安装目录:/usr/local/php5 2.下载ht ...

  8. mongodb的安装配置方法

    安装方法: https://docs.mongodb.com/manual/tutorial/install-mongodb-enterprise-on-red-hat/ 使用向导: https:// ...

  9. Linux下安装配置MongoDB 3.0.x 版本数据库

    说明: 操作系统:CentOS 5.X 64位 IP地址:192.168.21.128 实现目的: 安装配置MongoDB数据库 具体操作: 一.关闭SElinux.配置防火墙 1.vi /etc/s ...

随机推荐

  1. UVa 11754 (中国剩余定理 枚举) Code Feat

    如果直接枚举的话,枚举量为k1 * k2 *...* kc 根据枚举量的不同,有两种解法. 枚举量不是太大的话,比如不超过1e4,可以枚举每个集合中的余数Yi,然后用中国剩余定理求解.解的个数不够S个 ...

  2. Mysql分支

    MySQL是历史上最受欢迎的免费开源程序之一.它是成千上万个网站的数据库骨干,并且可以将它(和linux)作为过去10年里Internet呈指数级增长的一个有力证明. 那么,如果MySQL真的这么重要 ...

  3. SQL千万级数据设计和优化

    1. 数据太多.放在一个表肯定不行. 比如月周期表.一个月1000万,一年就1.2亿,如此累计下去肯定不行的.所以都是基于一个周期数据一个表.甚至一个周期数据就要分几个分表.主要是考虑实际的数据量而定 ...

  4. php yii多表查询

    一个Company记录可以对应多个CompanyUser纪录Company表: [['id', 'nature_id', 'scale_id', 'pro_id', 'created_at', 'up ...

  5. GBDT(Gradient Boosting Decision Tree)算法&协同过滤算法

    GBDT(Gradient Boosting Decision Tree)算法参考:http://blog.csdn.net/dark_scope/article/details/24863289 理 ...

  6. 【C#学习笔记】载入图片并居中

    using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; usin ...

  7. VS2010下编译安装DarwinStreamingServer5.5.5

    源码下载链接:http://dss.macosforge.org/源码版本: 5.5.5版本电脑环境:visual studio2010,window 7 x64系统.用VS2010打开WinNTSu ...

  8. 【ASP.NET MVC】"[A]System.Web.WebPages.Razor.Configuration.HostSection 无法强制转换为 ..."的解决办法

    1.错误页面: “/”应用程序中的服务器错误. [A]System.Web.WebPages.Razor.Configuration.HostSection 无法强制转换为 [B]System.Web ...

  9. jquery仿邮箱文本输入框自动加载邮箱后缀

    在像百度这样的网站注册时,你会看到输入邮箱会出现自动给用户输入补全主流邮箱.这种对于增加用户体验的小例子已司空见惯.正好看到人家写的这种js功能.还挺不错,使用起来很方便,几乎不用写神呢代码.&quo ...

  10. Eclipse小技巧<一>

    Eclipse是一款特别好用的开源开发工具,基于插件的特性使其能够进行各种语言的开发.非常喜欢eclipse里的编码风格,感觉这个开发工具十分灵活,又有很多开发的小技巧能够提高开发效率,每次学到一个t ...