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. Hibernate4.2.2使用Annotation配置

    1.在hibernate官网下载hibernate-release-4.2.2.Final.zip并解压 2.新建一个java project工程(20130619_Hibernate4.2.2_An ...

  2. CentOS6.6安装mysql出现的问题

    mysql编译需要cmake,我的cmake-2.6.4-5.el6.i686,最新版的是3.1.0,我就先用2.6.4的试试 ​ [root@localhost src]# wget http:// ...

  3. HDU 2544 最短路 (最短路,spfa)

    题意:中文题目 思路:spfa+SLF优化.关于SPFA的详情请戳我 #include <bits/stdc++.h> using namespace std; , INF=0x7f7f7 ...

  4. version_info

    import sys def check_version(): v = sys.version_info if v.major == 3 and v.minor >= 4: return Tru ...

  5. h.264码流解析_一个SPS的nalu及获取视频的分辨率

    00 00 00 01 67 42 00 28 E9 00  A0 0B 77 FE 00 02 00 03 C4 80  00 00 03 00 80 00 00 1A 4D 88  10 94 0 ...

  6. poj 1236 Network of Schools

    题目描述:有一些学校连接到一个计算机网络.这些学校之间达成了一个协议:每个学校维护着一个学校列表,它向学校列表中的学校发布软件.注意,如果学校B在学校A的列表中,则A不一定在B的列表中.任务A:计算为 ...

  7. JazzyViewPager开源项目的简析及使用

    JazzyViewPager是一个重写的ViewPager,能是ViewPager滑动起来更加的炫酷. 开源地址:https://github.com/jfeinstein10/JazzyViewPa ...

  8. Android-根据ImageView的大小来压缩Bitmap,避免OOM

    本文转自:http://www.cnblogs.com/tianzhijiexian/p/4254110.html Bitmap是引起OOM的罪魁祸首之一,当我们从网络上下载图片的时候无法知道网络图片 ...

  9. wait函数返回值总结

    之前在学习wait和waitpid函数的时候,就对使用宏WIFEXITED来检查获取的进程终止状态产生过疑惑:一般我们在程序中是调用的exit或者_exit函数来退出的,那么wait和waitpid函 ...

  10. Android 嵌套GridView,ListView只显示一行的解决办法

    重写ListView.GridView即可: public class MyListView extends ListView { public MyListView(Context context) ...