Loading

mongodb搭建

基础启停命令

# 配置文件如果没有fork=true,则需要--fork才能在后台启动
# 启动 .
/bin/mongod --fork --config ./conf/mongo.conf
./bin/mongod --config ./conf/mongodb.conf
./bin/mongod -f ./conf/mongodb.conf
# 关闭
./bin/mongod -shutdown -dbpath=./data

下载 mongodb 据库库

wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.0.6.tgz

 创建配置文件

cd {mondb安装目录}
mkdir log data conf
mongodb_dir=`pwd`
cat << EOF > conf/mongodb.conf
dbpath=$mongodb_dir/data
logpath=$mongodb_dir/log/mongodb.log
logappend=true
journal=true
quiet=true
port=27017
bind_ip=0.0.0.0
fork=true
EOF

 

posted @ 2019-11-27 13:41  Outsrkem  阅读(122)  评论(0)    收藏  举报