100% found this document useful (1 vote)
18 views

02 - Mongodb - Install

Uploaded by

emajere
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
18 views

02 - Mongodb - Install

Uploaded by

emajere
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 64

Introduction to MongoDB

Install MongoDB
Community Edition
Install MongoDB Community Edition

MongoDB Download Center

https://www.mongodb.com/download-center
3
Install MongoDB Community Edition

Supported Platforms

https://www.mongodb.com/download-center
4
Install MongoDB Community Edition

Supported Platforms

https://www.mongodb.com/download-center
5
Install MongoDB Community Edition

Deprecation of 32-bit Versions


Starting in MongoDB 3.2, 32-bit binaries are deprecated and will be unavailable in future
releases.

Since MongoDB 3.0, commercial support is no longer provided for MongoDB on 32-bit
platforms (Linux and Windows).

In addition, the 32-bit versions of MongoDB have the following limitations:


• 32-bit versions of MongoDB do not support the WiredTiger storage engine.

• 32-bit builds disable journaling by default because journaling further limits the maximum amount of
data that the database can store.

• When running a 32-bit build of MongoDB, the total storage size for the server, including data and
indexes, is 2 gigabytes. For this reason, do not deploy MongoDB to production on 32-bit machines.

If you’re running a 64-bit build of MongoDB, there’s virtually no limit to storage size. For
production deployments, 64-bit builds and operating systems are strongly recommended.

6
Install MongoDB Community Edition

Install on Windows

https://support.microsoft.com/en-us/kb/2731284

MongoDB Community Edition requires Windows Server 2008 R2, Windows Vista, or later.

The .msi installer includes all other software dependencies and will automatically upgrade any
older version of MongoDB installed using an .msi file.

7
Install MongoDB Community Edition

Install on Windows
Determine which MongoDB build you need
To find which version of Windows you are running, enter the following commands in
the Command Prompt or Powershell:
> wmic os get caption
Caption
Microsoft Windows 10 Home

> wmic os get osarchitecture


OSArchitecture
64 bits

8
Install MongoDB Community Edition

Install on Windows
Download MongoDB for Windows
Download the latest production release of MongoDB from the MongoDB downloads page.
Ensure you download the correct version of MongoDB for your Windows system.
The 64-bit versions of MongoDB do not work with 32-bit Windows.

9
https://www.mongodb.com/download-center
Install MongoDB Community Edition

Install on Windows
Interactive Installation
In Windows Explorer, locate the downloaded MongoDB .msi file and double-click the .msi file.
A set of screens will appear to guide you through the installation process.

You may specify an installation directory if you choose the “Custom” installation option.

MongoDB is self-contained and does not have any other system dependencies. You can run
MongoDB from any folder you choose. You may install MongoDB in any folder
10
Install MongoDB Community Edition

Install on Windows
MongoDB archives
The defaults installation folder for MongoDB is
C:\Program Files\MongoDB\Server\3.2

11
Install MongoDB Community Edition

Install on Windows
MongoDB Tools
Component Set Binaries
Server
Router
Client
MonitoringTools

ImportExportTools

MiscellaneousTools

12
Install MongoDB Community Edition

Install on Windows
Unattended Installation
You may install MongoDB Community unattended on Windows from the command line as
Administrator using msiexec.exe.

> msiexec.exe /q /i mongodb-win32-x86_64-2008plus-ssl-3.2.7-signed.msi ^


INSTALLLOCATION="C:\mongodb" ^
ADDLOCAL="all"

You can specify the installation location for the executable by modifying the value of parameter
INSTALLLOCATION.

By default, this method installs all MongoDB binaries. To install specific MongoDB component
sets, you can specify them in the ADDLOCAL argument using a comma-separated list
including one or more of the following component sets.

13
Install MongoDB Community Edition

Install on Windows
MongoDB Tools
Component Set Binaries
Server
Router
Client
MonitoringTools

ImportExportTools

MiscellaneousTools

14
Install MongoDB Community Edition

Install on Windows
Unattended Installation
For instance, to install only the MongoDB utilities, invoke:
> msiexec.exe /q /i mongodb-win32-x86_64-2008plus-ssl-3.2.7-signed.msi ^
INSTALLLOCATION="C:\mongodb" ^
ADDLOCAL="MonitoringTools,ImportExportTools,MiscellaneousTools"

15
Run MongoDB
Community Edition
Run MongoDB Community Edition

Start MongoDB
To start MongoDB, run mongod.exe. For example, from the Command Prompt:
> mongod

This starts the main MongoDB database process.

The waiting for connections message in the console output indicates that the mongod.exe
process is running successfully.

Depending on the security level of your system, Windows may pop up a Security Alert dialog
box about blocking “some features” of mongod.exe from communicating on networks.

All users should select Private Networks, such as my home or work network and click Allow
access.

17
Run MongoDB Community Edition

Start MongoDB
> mongod

2016-06-25T12:32:24.546+0200 I CONTROL [initandlisten] MongoDB starting : pid=10084 port=27017


dbpath=C:\data\db\ 64-bit host=DESKTOP-TGCRHCH
2016-06-25T12:32:24.551+0200 I CONTROL [initandlisten] targetMinOS: Windows 7/Windows Server 2008 R2
2016-06-25T12:32:24.553+0200 I CONTROL [initandlisten] db version v3.2.7
2016-06-25T12:32:24.554+0200 I CONTROL [initandlisten] git version: 4249c1d2b5999ebbf1fdf3bc0e0e3b3ff…
2016-06-25T12:32:24.557+0200 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.1p-fips 9 Jul 2015
2016-06-25T12:32:24.559+0200 I CONTROL [initandlisten] allocator: tcmalloc
2016-06-25T12:32:24.560+0200 I CONTROL [initandlisten] modules: none
2016-06-25T12:32:24.562+0200 I CONTROL [initandlisten] build environment:
2016-06-25T12:32:24.563+0200 I CONTROL [initandlisten] distmod: 2008plus-ssl
2016-06-25T12:32:24.565+0200 I CONTROL [initandlisten] distarch: x86_64
2016-06-25T12:32:24.566+0200 I CONTROL [initandlisten] target_arch: x86_64
2016-06-25T12:32:24.568+0200 I CONTROL [initandlisten] options: {}
2016-06-25T12:32:24.571+0200 I STORAGE [initandlisten] exception in initAndListen: 29
Data directory C:\data\db\ not found., terminating
2016-06-25T12:32:24.574+0200 I CONTROL [initandlisten] dbexit: rc: 100

18
Run MongoDB Community Edition

Start MongoDB
You can see a listing of all mongod options by running the command:
> mongod --help

or by reading the reference documentation

http://docs.mongodb.org/manual/reference/mongod/

By default mongod listens on port 27017. To have the process listen on another port run:
> mongod --port <portnum>

19
Run MongoDB Community Edition

Set up the MongoDB environment


MongoDB requires a data directory to store all data.

MongoDB’s default data directory path is \data\db.

Create this folder using the following commands from a Command Prompt:
> mkdir \data\db

You can specify an alternate path for data files using the --dbpath option to mongod.exe:
> mongod.exe --dbpath d:\test\mongodb\data

If your path includes spaces, enclose the entire path in double quotes, for example:

> mongod.exe --dbpath d:\test\mongodb\”d:\test\mongo db data”

20
Run MongoDB Community Edition

Set up the MongoDB environment


MongoDB servers log informational messages as a normal operation. By default, a server
process’s log is written to standad output.

It’s recommended, to create a logs directory to store MongoDB logs.


> mkdir \logs

You can have the server write the log to a file with the options:
> mongod --dbpath “…” --logpath “..\logs\mongod.log” --logappend

It’s strongly advisable to retain log files for some reasonable period of time, for forensics,
debugging, etc, …

21
Run MongoDB Community Edition

Configuring MongoDB
You can configure mongod instances at startup using a configuration file. The configuration
file contains settings that are equivalent to the mongod command-line options.

Using a configuration file makes managing mongod options easier, especially for large-scale
deployments. You can also add comments to the configuration file to explain the server’s
settings.

To start mongod using a config file, specify the config file with the --config option or the -f
option, as in the following examples:
> mongod --config /etc/mongod.conf
> mongod -f /etc/mongod.conf

http://docs.mongodb.org/manual/reference/configuration-options/

22
Run MongoDB Community Edition

Configuring MongoDB
MongoDB configuration files use the YAML format

http://yaml.org/

23
Run MongoDB Community Edition

Configuring MongoDB
The configuration file in version 2.6 is in YAML format. The following is an example of several
settings in a configuration file:

24
Run MongoDB Community Edition

Configuring MongoDB
Before version 2.6, you must declare all settings in this file using the following format:

Note: The 2.4 configuration file format remains for backward compatibility.

25
The mongo Shell
Install MongoDB Community Edition

The mongo Shell

The mongo Shell is a component of the MongoDB distributions.


The mongo Shell is an interactive JavaScript interface to MongoDB, which provides
a powerful interface for systems administrators as well as a way for developers to
test queries and operations directly with the database.
The mongo Shell also provides a fully functional JavaScript environment for use
with a MongoDB
You can use the mongo Shell to query and update data as well as perform
administrative operations.

27
Install MongoDB Community Edition

The mongo Shell

Component Set Binaries


Server
Router
Client/Shell
MonitoringTools

ImportExportTools

MiscellaneousTools

28
Install MongoDB Community Edition

The mongo Shell


> mongo --help
MongoDB shell version: 3.2.7
usage: mongo [options] [db address] [file names (ending in .js)]
db address can be:
foo foo database on local machine
192.169.0.5/foo foo database on 192.168.0.5 machine
192.169.0.5:9999/foo foo database on 192.168.0.5 machine on port 9999

When you run mongo without any arguments, the mongo Shell will attempt to connect to the
MongoDB instance running on the localhost interface on port 27017.

To specify a different host or port number, as well as other options, see examples of starting up
mongo and mongo reference which provides details on the available options.

29
Install MongoDB Community Edition

The mongo Shell


Connect to a mongod
> mongo
MongoDB shell version: 3.2.7
connecting to: test

To quit the mongo shell use the following command:

> exit
bye

> quit()

30
Install MongoDB Community Edition

The mongo Shell


Connect to a mongod
To connect to a server on a different port or interface, use the --port and --host options.
> mongo --host 127.0.0.1 --port 27017
MongoDB shell version: 3.2.7
connecting to: 127.0.0.1:27017/test

> mongo 127.0.0.1:27017


MongoDB shell version: 3.2.7
connecting to: 127.0.0.1:27017/test

> mongo 127.0.0.1


MongoDB shell version: 3.2.7
connecting to: 127.0.0.1:27017/test

31
Install MongoDB Community Edition

The mongo Shell


Connect to a mongod
You can select the database to use on the mongo command line. If a database name is not
provided, 'test' will be used.
> mongo --host 127.0.0.1 --port 27017 foursquare
MongoDB shell version: 3.2.7
connecting to: 127.0.0.1:27017/foursquare

> mongo foursquare


MongoDB shell version: 3.2.7
connecting to: foursquare

> mongo 127.0.0.1/foursquare


> mongo 127.0.0.1:27017/foursquare

32
Install MongoDB Community Edition

The mongo Shell


Available Databases
After starting the mongo Shell your session will use the test database by default (if not connect
to a specific database).

At any time, issue the following operation at the mongo Shell to report the name of the current
database:
> db
test

From the mongo Shell, display the list of databases, with the following operation:
> show dbs
local 0.000GB

> show databases


local 0.000GB

33
Install MongoDB Community Edition

The mongo Shell


Available Databases
Another option is the following:
> db.runCommand({“listDatabases”: 1})
{
"ok" : 0,
"errmsg" : "listDatabases may only be run against the admin database.",
"code" : 13
}

> db.adminCommand({“listDatabases”: 1})


{
"databases" : [
{
"name" : "local",
"sizeOnDisk" : 65536,
"empty" : false
}
],
"totalSize" : 65536,
"ok" : 1
}

34
Install MongoDB Community Edition

The mongo Shell


Select a Database
Switch to a new database named p.ex. mydb, with the following operation:
> use mydb
switched to db mydb

Remember, to report the name of the current database use:


> db
mydb

At this point, if you issue the show dbs operation again, it will not include the mydb database.
MongoDB will not permanently create a database until you insert data into that database.

> show dbs


local 0.000GB

35
Install MongoDB Community Edition

The mongo Shell


Create a collection in a Database
When you first store data in a database, such as by creating a collection, MongoDB creates the
database. To create a collection for current database:
> use test
> db.createCollection(“myCollection”)
{“ok”: 1}

The following creates both the database myNewDatabase and the collection myCollection:
> use myNewDatabase
> db.myCollection.insert({name: “jordi”})
WriteResult({ "nInserted" : 1 })

> show dbs


local 0.078GB
myDatabase 0.078GB
test 0.078GB

36
Install MongoDB Community Edition

The mongo Shell


Show collections in a Database
To view a list of all collections for current database:
> use myDatabase
switched to db myDatabase

> show collections


myCollection
system.indexes

> show tables


myCollection
system.indexes

> db.getCollectionNames()
[ "myCollection", "system.indexes" ]
> db.getCollectionNames().forEach(function(e){print(e)})

37
Install MongoDB Community Edition

The mongo Shell


Drop a collection
To drop a collection in current database:
> use myDatabase
switched to db myDatabase

> show collections


myCollection
system.indexes

> db.myCollection.drop()
true

> db.runCommand({drop: “myCollection”})


{ "ns" : "myDatabase.myCollection", "nIndexesWas" : 1, "ok" : 1 }

38
Install MongoDB Community Edition

The mongo Shell


Drop a database
The dropDatabase command drops a database, deleting the associated data files.
dropDatabase operates on the current database.

> use myDatabase


switched to db myDatabase

> db.runCommand({ dropDatabase: 1 })


{ "dropped" : "myDatabase", "ok" : 1 }

The mongo shell also provides the dropDatabase() helper method


> use test
switched to db test

> db.dropDatabase()
{ "dropped" : "test", "ok" : 1 }

39
Install MongoDB Community Edition

The mongo Shell


Rename a collection
> use test
> db.createCollection(“miColection”)
{“ok”: 1}

Call the db.collection.renameCollection() method on a collection object. For example:


> db.miColection.renameCollection(“myCollection")
{“ok”: 1}

This operation will rename the miColection collection to myCollection. If the target name
(i.e. myCollection) is the name of an existing collection, then the operation will fail.

The method has the following limitations:

- db.collection.renameCollection() cannot move a collection between databases.


- db.collection.renameCollection() cannot operation on sharded collections.

40
Install MongoDB Community Edition

The mongo Shell


db.collection.renameCollection()
Renames a collection. Provides a wrapper for the renameCollection database command.
> db.collection.renameCollection(target, dropTarget)

41
Install MongoDB Community Edition

The mongo Shell


db.runCommand({ renameCollection: …})
Changes the name of an existing collection.
> db.runCommand({ renameCollection: "<source_namespace>",
to: "<target_namespace>", dropTarget: <true|false> })

Specify collections to renameCollection in the form of a complete namespace, which includes


the database name.

Issue the renameCollection command against the admin database.

> db.adminCommand({renameCollection: "test.myCollection",


to: "prova.coleccion", drop: true})
{“ok”: 1}

42
Install MongoDB Community Edition

The mongo Shell


Alternative ways to access a collection
If the mongo Shell does not accept the name of the collection (contains a space, hyphen, starts
with a number, …) you can use an alternate syntax to refer to the collection:
> db[“3test”].find()

> db.getCollection(“3test”).find()

43
Install MongoDB Community Edition

The mongo Shell


Display Available Commands
To get a list of all commands, use the following command:
> db.listCommands()

Or also this nice format:


> db.runCommand({“listCommands”: 1})

44
Install MongoDB Community Edition

The mongo Shell


Display Mongo Help
At any point, you can access help for the mongo shell using the following operation:
> help

Furthermore, you can append the .help() method to some JavaScript methods, any cursor
object, as well as the db and db.collection objects to return additional help information.
> db.help()
> db.collection.help()

45
Install MongoDB Community Edition

The mongo Shell


Display Mongo Help
If you want to see key shortcuts use the following command:
> help keys

Tab completion and command history is available at the command prompt.

Some emacs keystrokes are available too:


Ctrl-A start of line
Ctrl-E end of line
Ctrl-K del to end of line

Multi-line commands
You can enter a multi line javascript expression. If parens, braces, etc. are not
closed, you will see a new line
beginning with '...' characters. Type the rest of your expression. Press Ctrl-C to
abort the data entry if you get stuck.

https://docs.mongodb.com/manual/reference/program/mongo/

46
Install MongoDB Community Edition

The mongo Shell


The .mongorc.js File
When starting, mongo checks the user’s home directory for a JS file named .mongorc.js.

If found, mongo interprets its content before displaying the prompt for the first time.

You can prevent .mongorc.js from being loaded by using the --norc option.

Users can define variables, customize the mongo shell prompt, or update information that they
would like updated every time they launch a shell
var prompt = function() {
var host = db.serverStatus().host;
var dbname = db.getName();
var time = new Date().toLocaleTimeString();
return sprintf("\n%s\\%s@%s> ", host, dbname, time.slice(0,-3));
}

DBQuery.prototype._prettyShell = true;

47
Install MongoDB Community Edition

The mongo Shell


The global .mongorc.js File
Global mongorc.js file which the mongo shell evaluates upon start-up.

If a user also has a .mongorc.js file located in the home directory, the mongo shell evaluates
the global /etc/mongorc.js file before evaluating the user’s .mongorc.js file.

On Windows, the global mongorc.js exists in the %ProgramData%\MongoDB directory.

The --norc option for mongo suppresses only the user’s .mongorc.js file.

48
Install MongoDB Community Edition

The mongo Shell


Command Options
--help, -h
Returns information on the options and use of mongo.

--verbose
Increases the verbosity of the output of the shell during the connection process.

--quiet
Silences output from the shell during the connection process..

--version
Returns the mongo release number.

--norc
Prevents the shell from sourcing and evaluating ~/.mongorc.js on start up..

49
Install MongoDB Community Edition

The mongo Shell


Command Options
--host <hostname>
Default: localhost
Specifies the name of the host machine where the mongod is running. If this is not
specified, mongo attempts to connect to a MongoDB process running on the localhost.

--port <port>
Default: 27017
Specifies the port where the mongod instance is listening. If --port is not specified, mongo
attempts to connect to port 27017.

--username <user>, -u <username>


Specifies a username with which to authenticate to a MongoDB.

--password <pass>, -p <pass>


Specifies a password with which to authenticate to a MongoDB.

50
Install MongoDB Community Edition

The mongo Shell


Command Options
--nodb
Prevents the shell from connecting to any database instances. Later, to connect to a
database within the shell.

--shell
Enables the shell interface. If you invoke the mongo command and specify a JavaScript
file as an argument, or use --eval to specify JavaScript on the command line, the --shell
option provides the user with a shell prompt after the file finishes executing.

--eval <javascript>
Evaluates a JavaScript expression that is specified as an argument. mongo does not load
its own environment when evaluating code. As a result many options of the shell
environment are not available.

<file.js>
Specifies a JavaScript file to run and then exit.
51
Configure a Windows Service for
MongoDB Community Edition
Install MongoDB Community Edition

Configure a Windows Service for MongoDB


Open an Administrator Command Prompt
Execute the remaining steps from the Administrator Command Prompt.

Create data and logs directories


> mkdir c:\data\db
> mkdir c:\data\log

Create a configuration file


Create a configuration file mongod.conf in YAML format, that includes all configuration options
needed.

53
Install MongoDB Community Edition

Configure a Windows Service for MongoDB


Install the MongoDB Service
> mongod --install
--config config\mongod.conf
--serviceName MongoDB
--serviceDisplayName "MongoDB 3.2 Community Server"
--serviceDescription "MongoDB 3.2 Community Server"
Install the MongoDB service by starting mongod.exe with the --install option and the --config
option to specify the previously created configuration file.

If needed, you can install services for multiple instances of mongod.exe.

Install each service with a unique --serviceName and --serviceDisplayName.

Use multiple instances only when sufficient system resources exist and your system design
requires it.

54
Install MongoDB Community Edition

Configure a Windows Service for MongoDB


Start the MongoDB Service
> net start MongoDB
El servicio de MongoDB 3.2 Community Server se ha iniciado correctamente.

View current services


> net start

Configure MongoDB Service as auto start


> sc config MongoDB start= auto
[SC] ChangeServiceConfig CORRECTO

55
Install MongoDB Community Edition

Configure a Windows Service for MongoDB


Stop the MongoDB Service
> net stop MongoDB
El servicio de MongoDB 3.2 Community Server está deteniéndose.
El servicio de MongoDB 3.2 Community Server se detuvo correctamente.

Remove the MongoDB Service


> mongod --remove
xxxx-xx-xxTxx:xx:xx+0200 I CONTROL [main] Trying to remove Windows service 'MongoDB'
xxxx-xx-xxTxx:xx:xx+0200 I CONTROL [main] Service 'MongoDB' removed

Reinstall the MongoDB Service


> mongod --install
--config config\mongod.conf
--serviceName MongoDB
--serviceDisplayName "MongoDB 3.2 Community Server"
--serviceDescription "MongoDB 3.2 Community Server"
56
Install MongoDB Community Edition

Configure a Windows Service for MongoDB


Manually create the MongoDB Service
> sc.exe create MongoDB
binPath= “…\mongod.exe --service --config=\“…\mongod.cfg\""
DisplayName= "MongoDB"
start= "auto"

sc.exe requires a space between “=” and the configuration values (eg “binPath= ”), and a “\” to
escape double quotes.

If successfully created, the following log message will display:

[SC] CreateService SUCCESS

To manually delete the service:


> sc.exe delete MongoDB

57
MongoDB Logs Messages
Install MongoDB Community Edition

MongoDB Logs Messages


The log messages have the form:
<timestamp> <severity> <component> [<context>] <message>

Starting in version 3.0, Mongo DB includes the severity level and the component associated
with each log message.

For example:
2016-06-25T12:32:24.546+0200 I CONTROL [initandlisten] MongoDB starting : pid=10084 port=27017
dbpath=C:\data\db\ 64-bit host=DESKTOP-TGCRHCH

2016-06-25T12:32:24.551+0200 I CONTROL [initandlisten] targetMinOS: Windows 7/Windows Server 2008 R2

2016-06-25T12:32:24.553+0200 I CONTROL [initandlisten] db version v3.2.7

2016-06-25T12:32:24.571+0200 I STORAGE [initandlisten] exception in initAndListen: 29 Data directory


C:\data\db\ not found., terminating

2016-06-25T12:34:24.571+0200 I NETWORK [initandlisten] waiting for connections on port 27017

59
Install MongoDB Community Edition

MongoDB Logs Messages


Timestamp:
2014-11-03T18:28:32.450-0500 I NETWORK [initandlisten] waiting for connections on port 27017

The default format for the <timestamp> is iso8601-local. To modify the timestamp format, use
the --timeStampFormat runtime option or the systemLog.timeStampFormat config setting.

Value Description
ctime Displays timestamps as Wed Dec 31 18:17:54.811.

iso8601-utc Displays timestamps in Coordinated Universal Time (UTC) in the ISO-


8601 format. For example, for New York at the start of the Epoch: 1970-
01-01T00:00:00.000Z
iso8601-local Displays timestamps in local time in the ISO-8601 format. For example,
for New York at the start of the Epoch: 1969-12-31T19:00:00.000-0500

60
Install MongoDB Community Edition

MongoDB Logs Messages


Severity Levels:
2014-11-03T18:28:32.450-0500 I NETWORK [initandlisten] waiting for connections on port 27017

The following table lists the severity levels associated with each log message:
Level Description
D Debug Messages (Verbosity Level > 0)
I Info Messages (Verbosity Level of 0)
W Warn Messages
E Error Messages
F Fatal Messages

You can specify the verbosity level of mongod.exe to determine the amount of Informational
and Debug messages MongoDB outputs.

61
Install MongoDB Community Edition

MongoDB Logs Messages


Component:
2014-11-03T18:28:32.450-0500 I NETWORK [initandlisten] waiting for connections on port 27017

Log messages now include components, providing functional categorization of the messages:
Component Description

- Messages not associated with a named component.

NETWORK Messages related to network activities, such as accepting connections

ACCESS Messages related to access control, such as authentication.

CONTROL Messages related to control activities, such as initialization.

QUERY Messages related to queries, including query planner activities

COMMAND Messages related to database commands, such as count.

WRITE Messages related to write operations, such as update commands.

62
Install MongoDB Community Edition

MongoDB Logs Messages


Component:
2014-11-03T18:28:32.450-0500 I NETWORK [initandlisten] waiting for connections on port 27017

Log messages now include components, providing functional categorization of the messages:
Component Description

INDEX Messages related to indexing operations, such as creating indexes.

GEO Messages related to the parsing of geospatial shapes

FTDC Messages related to the diagnostic data, such as server statistics and status msg.

REPL Messages related to replica sets, such as initial sync and heartbeats.

SHARDING Messages related to sharding activities, such as the startup of the mongos.

STORAGE Messages related to storage activities

JOURNAL Messages related specifically to journaling activities. .

63

You might also like