zoukankan      html  css  js  c++  java
  • 2.7 环境准备-MongoDB

    1. 下载安装包

      cd /usr/software/

      wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-amazon-3.6.2.tgz

      tar -zxvf mongodb-linux-x86_64-amazon-3.6.2.tgz

    2.  mv mongodb-linux-x86_64-amazon-3.6.2 /usr/local/mongodb

    3.  vi /etc/profile

      export MONGODB_HOME=/usr/local/mongodb
      export PATH=$PATH:$MONGODB_HOME/bin

     source /etc/profile

    4. vi /etc/mongodb.conf

      参考官方配置

      

    systemLog:
      destination: file
      logAppend: true
      path: /data/mongodb/log/mongod.log
    
    storage:
      dbPath: /data/mongodb/data/db
      journal:
        enabled: true
    #  engine:
    #  mmapv1:
    #  wiredTiger:
    
    # how the process runs
    processManagement:
      fork: true  # fork and run in background
     # pidFilePath: /var/run/mongodb/mongod.pid  # location of pidfile
     # timeZoneInfo: /usr/share/zoneinfo
    
    # network interfaces
    net:
      port: 27017 
      bindIpAll: true
     # bindIp: 127.0.0.1 #to bind to all IPv4 and IPv6 addresses or, alternatively, use the net.bindIpAll setting.
    
    security:
      authorization: disabled  #disabled enabled
    View Code

    5. 新建相关目录

      mkdir -p /data/mongodb/data/db

      mkdir -p /data/mongodb/log

    6. 测试

      mongod -f /etc/mongodb.conf

      top查看进程

      mongo 

        > use mydb;
        > db.test.save( { tecadmin: 100 } )
        > db.test.find()
        { "_id" : ObjectId("52b0dc8285f8a8071cbb5daf"), "tecadmin" : 100 }

        >exit

    每一步脚印都要扎得深一点!
  • 相关阅读:
    http请求头和响应头详细解释
    http协议POST请求头content-type主要的四种取值
    什么是精准测试
    测试管理(管事篇)
    有赞全链路压测方案设计与实施详解
    饿了么全链路压测平台的实现与原理
    京东全链路压测军演系统(ForceBot)架构解密
    java Apache common-io 讲解
    CentOS 7.0 安装go 1.3.1
    异常
  • 原文地址:https://www.cnblogs.com/bloodthirsty/p/11289308.html
Copyright © 2011-2022 走看看