下载安装mongoDBwget https://fastdl.monGodb.org/linux/mongodb-linux-x86_64-rhel70-3.4.4.tgztar zxv
下载安装mongoDB
wget https://fastdl.monGodb.org/linux/mongodb-linux-x86_64-rhel70-3.4.4.tgz
tar zxvf mongodb-linux-x86_64-rhel70-3.4.4.tgz
mv mongodb-linux-x86_64-rhel70-3.4.4 mongodb344
配置mongodb
cd mongodb344/
mkdir data
mkdir logs
vim /opt/mongodb344/mongodb.conf
port=27017
dbpath=/opt/mongodb344/data/
rest=true
logpath=/opt/mongodb344/logs/mongodb.log
pidfilepath=/opt/mongodb344/mongo.pid
fork=true
logappend=true
shardsvr=true
#directoryperdb=true
#auth=true
vim /etc/rc.d/init.d/mongod
limit -SHn 655350
#!/bin/bash
# chkconfig: - 64 36
# description:mongod
case $1 in
start)
mongod --maxConns 20000 --config /opt/mongodb344/mongodb.conf
;;
stop)
/opt/mongodb344/bin/mongo 127.0.0.1:27017/admin --eval "db.shutdownServer()"
;;
status)
/opt/mongodb344/bin/mongo 127.0.0.1:27017/admin --eval "db.stats()"
;;
esac
设置开机自启
chmod +x /etc/rc.d/init.d/mongod
chkconfig mongod on
echo never > /sys/kernel/mm/transparent_hugepage/enabled
echo never > /sys/kernel/mm/transparent_hugepage/defrag
/etc/init.d/mongod start
/etc/init.d/mongod stop
/etc/init.d/mongod status
--结束END--
本文标题: 基于centos7系统mongodb3.,4.4安装
本文链接: https://lsjlt.com/news/40304.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
2024-10-23
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0