M201: MongoDB Performance chapter 1 Introduction学习记录

原创 2018年04月16日 23:47:51

M201: MongoDB Performance chapter 1 Introduction学习记录

运行环境

操作系统:windows 10 家庭中文版
Mongodb :Mongodb 3.4

Mongodb安装路径:E:>MongoDB\Server\3.4\bin\
Mongodb存储路径:E:>MongoDB\data

课后问题

lab1.1

Welcome to your first lab in M201! In this lab you’re going to install MongoDB Enterprise 3.4 and import the people dataset.

You can download the people.json dataset here.

While MongoDB Enterprise is available as part of the MongoDB Enterprise Advanced subscription it’s permitted to be ran outside of production environments.

In order to install MongoDB you’re going to need to head over to our online documentation and follow the instructions on installing MongoDB.

After you’ve successfully installed MongoDB you should start a standalone server. Once your sever is up and running you should be able to download the people.json handout and import it with mongoimport. Make sure to import the documents into the m201 database and the people collection.

To confirm that you’ve successfully completed these steps run the following query on the m201 database from the mongo shell and paste it’s output into the submission area below:

> db.people.count({ "email" : {"$exists": 1} })

解答

启动mongod守护进程:

C:\Users\Shinelon>e:

E:\>MongoDB\Server\3.4\bin\mongod.exe --dbpath MongoDB\data
2018-04-16T08:43:34.604-0700 I CONTROL  [initandlisten] MongoDB starting : pid=7500 port=27017 dbpath=MongoDB\data 64-bit host=DESKTOP-MP9NVQ7
2018-04-16T08:43:34.605-0700 I CONTROL  [initandlisten] targetMinOS: Windows 7/Windows Server 2008 R2
2018-04-16T08:43:34.605-0700 I CONTROL  [initandlisten] db version v3.4.6
2018-04-16T08:43:34.606-0700 I CONTROL  [initandlisten] git version: c55eb86ef46ee7aede3b1e2a5d184a7df4bfb5b5
2018-04-16T08:43:34.606-0700 I CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.0.1u-fips  22 Sep 2016
2018-04-16T08:43:34.606-0700 I CONTROL  [initandlisten] allocator: tcmalloc
2018-04-16T08:43:34.606-0700 I CONTROL  [initandlisten] modules: none
2018-04-16T08:43:34.606-0700 I CONTROL  [initandlisten] build environment:
2018-04-16T08:43:34.606-0700 I CONTROL  [initandlisten]     distmod: 2008plus-ssl
2018-04-16T08:43:34.606-0700 I CONTROL  [initandlisten]     distarch: x86_64
2018-04-16T08:43:34.606-0700 I CONTROL  [initandlisten]     target_arch: x86_64
2018-04-16T08:43:34.606-0700 I CONTROL  [initandlisten] options: { storage: { dbPath: "MongoDB\data" } }
2018-04-16T08:43:34.634-0700 I -        [initandlisten] Detected data files in MongoDB\data created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
2018-04-16T08:43:34.635-0700 I STORAGE  [initandlisten] wiredtiger_open config: create,cache_size=7656M,session_max=20000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),checkpoint=(wait=60,log_size=2GB),statistics_log=(wait=0),
2018-04-16T08:43:35.494-0700 I CONTROL  [initandlisten]
2018-04-16T08:43:35.495-0700 I CONTROL  [initandlisten] ** WARNING: Access control is not enabled for the database.
2018-04-16T08:43:35.495-0700 I CONTROL  [initandlisten] **          Read and write access to data and configuration is unrestricted.
2018-04-16T08:43:35.495-0700 I CONTROL  [initandlisten]
2018-04-16T23:43:35.738+0800 I FTDC     [initandlisten] Initializing full-time diagnostic data capture with directory 'MongoDB/data/diagnostic.data'
2018-04-16T23:43:35.741+0800 I NETWORK  [thread1] waiting for connections on port 27017

按要求下载people.json文件至路径E:\MongoDB\m201\chapter_1_introduction,导入json文件:

C:\Users\Shinelon>e:

E:\>MongoDB\Server\3.4\bin\mongoimport.exe -d m201 -c people MongoDB\m201\chapter_1_introduction\people.json
2018-04-16T23:43:44.703+0800    connected to: localhost
2018-04-16T23:43:46.141+0800    imported 50474 documents

进入mongo:

E:\>MongoDB\Server\3.4\bin\mongo.exe
MongoDB shell version v3.4.6
connecting to: mongodb://127.0.0.1:27017
MongoDB server version: 3.4.6
Server has startup warnings:
2018-04-16T08:43:35.494-0700 I CONTROL  [initandlisten]
2018-04-16T08:43:35.495-0700 I CONTROL  [initandlisten] ** WARNING: Access control is not enabled for the database.
2018-04-16T08:43:35.495-0700 I CONTROL  [initandlisten] **          Read and write access to data and configuration is unrestricted.
2018-04-16T08:43:35.495-0700 I CONTROL  [initandlisten]

切换至m201库:

> use m201
switched to db m201

执行给出的函数:

> db.people.count({ "email" : {"$exists": 1} })
50474

M201: MongoDB Performance chapter 2 Mongodb Indexes学习记录

M201: MongoDB Performance chapter 2 Mongodb Indexes学习记录 运行环境 操作系统:windows 10 家庭中文版 Mongodb :Mongo...
  • sunbocong
  • sunbocong
  • 2018-04-17 10:30:24
  • 7

M201: MongoDB Performance chapter 3 Index Operations学习记录

M201: MongoDB Performance chapter 3 Index Operations学习记录 运行环境 操作系统:windows 10 家庭中文版 Mongodb :Mo...
  • sunbocong
  • sunbocong
  • 2018-04-22 23:47:08
  • 4

M201: MongoDB Performance chapter 4 CRUD Operations学习记录

M201: MongoDB Performance chapter 4 CRUD Operations学习记录 运行环境 操作系统:windows 10 家庭中文版 Mongodb :Mon...
  • sunbocong
  • sunbocong
  • 2018-04-23 11:45:07
  • 11

Introduction to Algorithms, Second Edition _ONE (Adding)

  Introduction to Algorithms(Second Edition)【原书名】 Introduction to Algorithms(Second Edition) 【原出版社】 ...
  • dfreng
  • dfreng
  • 2008-10-19 12:04:00
  • 5897

learn node.js in 1 day

  • 2018年01月29日 19:11
  • 6.19MB
  • 下载

CUDA for Engineers An Introduction to High-Performance Parallel Computing epub

  • 2017年09月28日 11:34
  • 17.35MB
  • 下载

M102: MongoDB for DBAs chapter 1 introduction学习记录

M102: MongoDB for DBAs chapter 1 introduction 运行环境 操作系统:windows 10 家庭中文版 Mongodb :Mongodb 3.4 Mo...
  • sunbocong
  • sunbocong
  • 2018-03-29 15:07:32
  • 14

M001: MongoDB Basics chapter 1 Introduction学习记录

M001: MongoDB Basics chapter 1 Introduction学习记录 运行环境 操作系统:windows 10 家庭中文版 Mongodb :Mongodb 3.4 ...
  • sunbocong
  • sunbocong
  • 2018-04-08 12:08:41
  • 31

MongoDB Performance Best Practices

  • 2017年11月08日 11:24
  • 982KB
  • 下载
收藏助手
不良信息举报
您举报文章:M201: MongoDB Performance chapter 1 Introduction学习记录
举报原因:
原因补充:

(最多只允许输入30个字)