mongodb-安装配置

Packages

Package NameDescription
mongodb-orgmetapackage that will automatically install the four component packages listed below.
mongodb-org-serverContains the mongod daemon, associated init script, and a configuration file(/etc/mongod.conf). You can use the initialization script to start mongod with the configuration file. For details, see Run MongoDB Community Edition.
mongodb-org-mongosContains the mongos daemon.
mongodb-org-shellContains the mongo shell.
mongodb-org-toolsContains the following MongoDB tools: mongoimport bsondumpmongodumpmongoexportmongofilesmongorestoremongostat, and mongotop.

 

rpm安装启动

yum localinstall mongodb-org-server-4.0.4-1.el7.x86_64.rpm
rpm -ivh mongodb-org-4.0.4-1.el7.x86_64.rpm mongodb-org-mongos-4.0.4-1.el7.x86_64.rpm  mongodb-org-shell-4.0.4-1.el7.x86_64.rpm mongodb-org-tools-4.0.4-1.el7.x86_64.rpm
systemctl start mongod

[root@VM_0_3_centos ~]# netstat -lntp|grep mongod
tcp        0      0 127.0.0.1:27017         0.0.0.0:*               LISTEN      5286/mongod  

  

源码包启动

[root@webmaster mongodb]# ./bin/mongod --config ./mongodb.conf 
about to fork child process, waiting until server is ready for connections.
forked process: 119286
child process started successfully, parent exiting

  

关闭服务

> use admin
switched to db admin
> db.shutdownServer()
server should be down...
#进入shell关闭服务,不要用kill -9,会导致数据混乱

  

配置优化

echo never > /sys/kernel/mm/transparent_hugepage/defrag
echo never > /sys/kernel/mm/transparent_hugepage/enabled

  

 

 

转载于:https://www.cnblogs.com/jabbok/p/10072477.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值