zoukankan      html  css  js  c++  java
  • mongodb4.2.2 centos 单机安装

    下载 rpm包

    wget https://repo.mongodb.org/yum/redhat/7/mongodb-org/4.2/x86_64/RPMS/mongodb-org-server-4.2.2-1.el7.x86_64.rpm
    wget https://repo.mongodb.org/yum/redhat/7/mongodb-org/4.2/x86_64/RPMS/mongodb-org-mongos-4.2.2-1.el7.x86_64.rpm
    wget https://repo.mongodb.org/yum/redhat/7/mongodb-org/4.2/x86_64/RPMS/mongodb-org-tools-4.2.2-1.el7.x86_64.rpm
    wget https://repo.mongodb.org/yum/redhat/7/mongodb-org/4.2/x86_64/RPMS/mongodb-org-shell-4.2.2-1.el7.x86_64.rpm

    安装

    yum -y install mongodb-org-*

    修改mogod.service

    cd /usr/lib/systemd/system

    修改内容

    [root@localhost system]# cat mongod.service 
    [Unit]
    Description=MongoDB Database Server
    Documentation=https://docs.mongodb.org/manual
    After=network.target
    
    [Service]
    User=mongod
    Group=mongod
    Environment="OPTIONS=-f /etc/mongod.conf"
    EnvironmentFile=-/etc/sysconfig/mongod
    ExecStart=/usr/bin/mongod $OPTIONS
    ExecStartPre=/usr/bin/chown -R  mongod:mongod /var/lib/mongo
    ExecStartPre=/usr/bin/mkdir -p /var/run/mongodb
    ExecStartPre=/usr/bin/chown -R  mongod:mongod /var/run/mongodb
    ExecStartPre=/usr/bin/chmod 0755 /var/run/mongodb
    PermissionsStartOnly=true
    PIDFile=/var/run/mongodb/mongod.pid
    Type=forking
    # file size
    LimitFSIZE=infinity
    # cpu time
    LimitCPU=infinity
    # virtual memory size
    LimitAS=infinity
    # open files
    LimitNOFILE=64000
    # processes/threads
    LimitNPROC=64000
    # locked memory
    LimitMEMLOCK=infinity
    # total threads (user+kernel)
    TasksMax=infinity
    TasksAccounting=false
    # Recommended limits for for mongod as specified in
    # http://docs.mongodb.org/manual/reference/ulimit/#recommended-settings
    
    [Install]
    WantedBy=multi-user.target

    注意红色的地方是比默认文件多的地方, 否则可能会出现启动失败的问题

    如果启动失败,可以查看mongo的日志

    cd /var/log/mongodb
    [root@localhost mongodb]# ll
    total 68
    -rw-r-----. 1 mongod mongod 65917 Dec 17 05:20 mongod.log
    [root@localhost mongodb]# 
  • 相关阅读:
    JVM 体系结构介绍
    视频编解码学习之三:变换,量化与熵编码
    视频编解码学习之二:编解码框架
    视频编解码学习之一:理论基础
    openmax component类的继承关系
    OpenMax的接口与实现
    android中OpenMax的实现【3】OMX中主要成员
    android中OpenMax的实现【2】AwesomePlayer中openmax的入口
    Objective-C——消息、Category和Protocol
    vue axios 攻略
  • 原文地址:https://www.cnblogs.com/xiaojf/p/12051527.html
Copyright © 2011-2022 走看看