Home  >  Article  >  Database  >  source code compiled install mongodb

source code compiled install mongodb

WBOY
WBOYOriginal
2016-06-07 14:59:061019browse

source code compiled install mongodb 源码编译安装mongodb source code compiled install mongodb 1.下载安装包 cd /usr/local/src wget http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-2.2.4.tgz 2.解压缩 tar zxvf mongodb-linux-x86_64-2.2.4.t

source code compiled install mongodb

 

源码编译安装mongodb

 

source code compiled  install mongodb

 

1.下载安装包

cd /usr/local/src

 

wget http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-2.2.4.tgz 

 

2.解压缩

tar zxvf mongodb-linux-x86_64-2.2.4.tgz 

 

3.安装mongodb

mv mongodb-linux-x86_64-2.2.4 /usr/local/mongodb

 

4.配置mongodb

cd /usr/local/mongodb

 

创建用于存放数据文件的data文件夹

mkdir -p data

 

创建用于存放日志文件的dblogs文件夹

mkdir -p dblogs

 

5.启动mongodb

 

cd /usr/local/mongodb/bin

 

./mongod --dbpath=/usr/local/mongodb/data/ --logpath=/usr/local/mongodb/dblogs/mongo.log --fork

 

dbpath就是我们创建的data文件夹所在的位置

 

logpath就是我们创建dblogs文件夹所在位置

 

--fork就是在后台执行

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn