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

安装mongodb

时间:2021-01-14 10:46:20      阅读:0      评论:0      收藏:0      [点我收藏+]

标签:printf   inux   print   安装   proc   cal   http   end   for   

cd /opt
wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-rhel70-4.4.3.tgz
tar -zxvf mongodb-linux-x86_64-rhel70-4.4.3.tgz
mkdir /opt/mongodb && mv /opt/mongodb/mongodb-linux-x86_64-rhel70-4.4.3/ /op/mongodb
vim /opt/mongodb/mongodb.conf

##注意对齐

systemLog:
  destination: file
     path: "/opt/mongodb/logs/mongodb.log"
     logAppend: true
storage:
  dbPath: "/opt/mongodb/data/db"
     journal:
    enabled: true
processManagement:
           fork: true
net:
  bindIp: 0.0.0.0
    port: 27017
setParameter:
     enableLocalhostAuthBypass: false




mkdir -p /opt/mongodb/data/db/
mkdir -p /opt/mongodb/logs/
echo "/opt/mongodb/bin/mongod --config=/opt/mongodb/mongodb.conf" > /opt/mongodb/start
chmod +x /opt/mongodb/start
sh /opt/mongodb/start                     //启动

echo "ps -ef|grep mongodb.conf|grep -v grep|awk ‘{printf $2}‘|xargs kill -9" > /opt/mongodb/stop       //关闭
chmod +x /opt/mongodb/stop

安装mongodb

标签:printf   inux   print   安装   proc   cal   http   end   for   

原文地址:https://www.cnblogs.com/luoqiangdong/p/14269721.html

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