标签:rhel7 org amp class cal shu tar oca local
原文作者: xingguang
原文链接:https://www.tiance.club/post/2911353081.html
wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-rhel70-4.2.5.tgz
tar -zxvf mongodb-linux-x86_64-rhel70-4.2.5.tgz
mv mongodb-linux-x86_64-rhel70-4.2.5/ /usr/local/mongodb
mkdir -p /usr/local/mongodb/data
mkdir -p /usr/local/mongodb/logs
ln -s /usr/local/mongodb/bin/mongod mongod
ln -s /usr/local/mongodb/bin/mongo mongo
新增sh脚本放在根目录的shell下面mongod_start.sh
#!/bin/bash
# pkill -9 mongod;
/usr/local/mongodb/bin/mongod --shutdown --dbpath /usr/local/mongodb/data/;
nohup /usr/local/mongodb/bin/mongod --dbpath=/usr/local/mongodb/data --logpath=/usr/local/mongodb/logs/log.txt > /shell/mongod.log 2>&1 &
设置权限777
chmod 777 mongod_start.sh
vim /etc/rc.d/rc.local
文件后面追加
sh /shell/mongod_start.sh
chmod +x /etc/rc.d/rc.local
然后就搞定了
原文作者: xingguang
原文链接:https://www.tiance.club/post/2911353081.html
标签:rhel7 org amp class cal shu tar oca local
原文地址:https://www.cnblogs.com/yizhidaozuihou/p/12830149.html