码迷,mamicode.com
首页 > 数据库 > 详细

MongoDB - Installing MongoDB on Linux

时间:2016-11-30 13:39:26      阅读:183      评论:0      收藏:0      [点我收藏+]

标签:服务   环境   data   nbsp   http   cat   最新   ini   下载   

1. 下载最新稳定版本的安装包。

[huey@huey mongodb]$ wget -c --no-check-certificate https://fossies.org/linux/misc/mongodb-linux-x86_64-3.2.11.tgz

2. 解压安装包。

[huey@huey mongodb]$ tar -zxvf mongodb-linux-x86_64-3.2.11.tgz 

3. 设置环境变量。

[huey@huey ~]$ export PATH=/home/huey/mongodb/mongodb-linux-x86_64-3.2.11/bin:$PATH

4. 创建数据目录。

[huey@huey ~]$ mkdir -p ~/data/db

5. 启动服务。

[huey@huey ~]$ mongod --dbpath ~/data/db &
[1] 16529
[huey@huey ~]$ 2016-11-30T11:01:24.214+0800 I CONTROL  [initandlisten] MongoDB starting : pid=16529 port=27017 dbpath=/home/huey/data/db 64-bit host=huey
2016-11-30T11:01:24.215+0800 I CONTROL  [initandlisten] db version v3.2.11
2016-11-30T11:01:24.215+0800 I CONTROL  [initandlisten] git version: 009580ad490190ba33d1c6253ebd8d91808923e4
2016-11-30T11:01:24.215+0800 I CONTROL  [initandlisten] allocator: tcmalloc
......

6. 运行 MongoDB Shell

[huey@huey ~]$ mongo
MongoDB shell version: 3.2.11
connecting to: test
...
> 1 + 1
2
> 

 

MongoDB - Installing MongoDB on Linux

标签:服务   环境   data   nbsp   http   cat   最新   ini   下载   

原文地址:http://www.cnblogs.com/huey/p/6116924.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!