zoukankan      html  css  js  c++  java
  • MongoDB基本概念和安装配置

    基本概念

    MongoDB直接存储JSON。

    有了NoSQL数据库之后,可以直接在业务层将数据按照指定的结构进行存储。

    NO SQL NoSQL
    1 数据库 数据库
    2 集合
    3 文档
    4 成员
    5 主键 Object ID(自动维护)

    MongoDB跟Node.js捆绑在一起了(taobao用了Node.js)。

    面向集合存储,支持索引,支持短暂保留,基于BSON应用。支持python、.net、php等。

    MongoDB集合传统的mysql或者其他关系型数据库一起使用。

    安装配置

    安装Mongo到E盘,创建mongod.cfg配置文件,设置MongoDB服务,启动MongoDB,关闭MongoDB服务。

    systemLog:
     destination: file
     path: E:MongoDBdatalogmongod.log
    storage:
     dbPath: E:MongoDBdatadb
    
    sc.exe create MongoDB binPath= "E:MongoDBServerinmongod.exe --service --config="E:MongoDBmongod.cfg"" DisplayName= "MongoDB" start= "auto" 
    
    net start MongoDB 
    
    net stop MongoDB  
    

    更多的配置案例

    systemLog:  
        quiet: false  
        path: E:MongoDBdatalogmongod.log  
        logAppend: false  
        destination: file  
    processManagement:  
        fork: true  
        pidFilePath: E:MongoDBdatamongod.pid  
    net:  
        bindIp: 127.0.0.1  
        port: 27017  
        maxIncomingConnections: 65536  
        wireObjectCheck: true  
        ipv6: false   
    storage:  
        dbPath: E:MongoDBdatadb 
        indexBuildRetry: true  
        journal:  
            enabled: true  
        directoryPerDB: false  
        engine: mmapv1  
        syncPeriodSecs: 60   
        mmapv1:  
            quota:  
                enforced: false  
                maxFilesPerDB: 8  
            smallFiles: true      
            journal:  
                commitIntervalMs: 100  
        wiredTiger:  
            engineConfig:  
                cacheSizeGB: 8  
                journalCompressor: snappy  
                directoryForIndexes: false    
            collectionConfig:  
                blockCompressor: snappy  
            indexConfig:  
                prefixCompression: true  
    operationProfiling:  
        slowOpThresholdMs: 100  
        mode: off  
    

    当MongoDB服务启动之后,可以使用mongo命令来连接。

    mongo
    

    在浏览器中查看默认的端口是27017

    http://127.0.0.1:27017/
    

    通过可视化工具连接测试

    显示数据库

    show databases;
    

    通过端口号启动

    mongo --port=27017
    
  • 相关阅读:
    Oracle分析函数大全
    Docker容器与容器云之Docker单机集群部署案例
    hive中的几个参数:元数据配置、仓库位置、打印表字段相关参数
    启用hive hwi方法
    hive进行词频统计
    Docker在centos上的安装
    Hive日志(Hive Logging)--hive GettingStarted翻译
    【RMAN】RMAN-05001: auxiliary filename conflicts with the target database
    简单示例用例(Simple Example Use Cases)--hive GettingStarted用例翻译
    hive分析nginx日志之UDF清洗数据
  • 原文地址:https://www.cnblogs.com/jiqing9006/p/7852151.html
Copyright © 2011-2022 走看看