zoukankan      html  css  js  c++  java
  • mongodb-安装配置

    Packages

    Package NameDescription
    mongodb-org metapackage that will automatically install the four component packages listed below.
    mongodb-org-server Contains 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-mongos Contains the mongos daemon.
    mongodb-org-shell Contains the mongo shell.
    mongodb-org-tools Contains 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
    

      

     

  • 相关阅读:
    五种Sublime text 3同时快速编辑多行内容
    update 更新某个字段自动加1
    oracle 一行记录被锁
    事件
    练习题1
    语法
    开始js
    js简述
    概述
    软连接
  • 原文地址:https://www.cnblogs.com/jabbok/p/10072477.html
Copyright © 2011-2022 走看看