-
下载mongodb源码,并解压:
wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu1604-4.0.11.tgz tar -zxvf mongodb-linux-x86_64-ubuntu1604-4.0.11.tgz
-
创建mongo专属目录,拷贝bin下文件到mongodb目录下bin中:
mkdir /usr/local/mongodb cd /usr/local/mongodb mkdir bin cp .../mongodb-linux-x86_64-ubuntu1604-4.0.11/bin/* ./bin/
-
创建数据库文件目录、日志目录、配置文件:
mkdir data touch mongodb.log touch mongodb.conf
-
配置文件内容:
dbpath=/usr/local/mongodb/data logpath=/usr/local/mongodb/mongodb.log logappend=true journal=true fork=true bind_ip = 127.0.0.1 port = 27017 noauth = true #auth = true
-
将mongo添加path:
#打开profile vi /etc/profile #输入下面内容: MONGO_DB="/usr/local/mongodb" PATH=$MONGO_DB/bin:$PATH: export PATH #加载配置 source /etc/profile
-
启动mongodb:
/usr/local/mongodb/bin/mongod --config /usr/local/mongodb/mongodb.conf
#启动后会看到: about to fork child process, waiting until server is ready for connections. forked process: 1361 child process started successfully, parent exiting
相关文章
- 07-20Windows 8 下离线安装。net Framework 3.5
- 07-20mac 下安装securecrt
- 07-20Ceres Solver 在win8+vs2013环境下的安装
- 07-20MyEclipse8.6下的svn插件安装
- 07-20windows下安装ElasticSearch
- 07-20Android Studio 3.5报错,无法从‘https://services.gradle.org/distributions/gradle-5.4.1下载安装的解决方案
- 07-20BI数据可视化——Windows环境下Superset1.0版本安装配置方法
- 07-20Mac下go的安装
- 07-20windows环境下Robot Framework的安装步骤
- 07-20解决Esxi5下安装Windows 8的问题