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. firefox较慢

    Ctrl+Shift+Delete,清楚缓存.浏览历史.下载,效果不是很明显. 地址栏输入about:support,打开配置文件夹,删掉配置文件夹里的places.sqlite,urlclassif ...

  2. POJ 2065 SETI (高斯消元 取模)

    题目链接 题意: 输入一个素数p和一个字符串s(只包含小写字母和‘*’),字符串中每个字符对应一个数字,'*'对应0,‘a’对应1,‘b’对应2.... 例如str[] = "abc&quo ...

  3. Python3 学习第三弹:异常情况如何处理?

    python 的处理错误的方式: 1> 断言 assert condition 相当于 if not condition: crash program 断言设置的目的就是因为与其让程序晚点崩溃, ...

  4. Error Curves(2010成都现场赛题)

    F - Error Curves Time Limit:3000MS     Memory Limit:0KB     64bit IO Format:%lld & %llu Descript ...

  5. CodeForces 489D Unbearable Controversy of Being

    题意: 给出一个n个节点m条边的有向图,求如图所示的菱形的个数. 这四个节点必须直接相邻,菱形之间不区分节点b.d的个数. 分析: 我们枚举每个a和c,然后求出所有满足a邻接t且t邻接c的节点的个数记 ...

  6. mysql SQL_MODE设置

    1.1.   SQL_MODE设置 在生产环境中强烈建议将这个值设置为严格模式,这样有些问题可以在数据库的设计和开发阶段就能实现,而如果在生产环境下运行数据库后发现这类问题,那么修改的代价将变得十分巨 ...

  7. MySQL索引与优化策略

    1. MySQL索引实现 在MySQL中,索引属于存储引擎级别的概念,不同存储引擎对索引的实现方式是不同的,下面主要讨论MyISAM和InnoDB两个存储引擎的索引实现方式. MyISAM索引实现 M ...

  8. [Everyday Mathematics]20150118

    设 $X$ 是线性空间, $\phi_1,\cdots,\phi_n,\phi$ 是 $X$ 上的线性泛函, 试证: $$\bex \phi\in \span\sed{\phi_1,\cdots,\p ...

  9. storm入门教程 第一章 前言[转]

    1.1   实时流计算 互联网从诞生的第一时间起,对世界的最大的改变就是让信息能够实时交互,从而大大加速了各个环节的效率.正因为大家对信息实时响应.实时交互的需求,软件行业除了个人操作系统之外,数据库 ...

  10. Android欢迎界面的创建方法

    1.制作一张启动图片splash.png,放置在res->drawable-hdpi文件夹中.2.新建布局文件splash.xml <?xml version="1.0" ...