LinuxCommandLibrary

mongod

mongoDB database server daemon

TLDR

Start MongoDB server

$ mongod
copy
Specify data directory
$ mongod --dbpath [/data/db]
copy
Specify port
$ mongod --port [27017]
copy
Bind to all interfaces
$ mongod --bind_ip_all
copy
Enable authentication
$ mongod --auth
copy
Use config file
$ mongod --config [/etc/mongod.conf]
copy
Run as replica set
$ mongod --replSet [rs0]
copy

SYNOPSIS

mongod [options]

DESCRIPTION

mongod is the MongoDB database server daemon. It handles data requests and manages data storage.
The tool is the core database process. Supports replication, sharding, and authentication.

PARAMETERS

--dbpath PATH

Database directory path.
--port PORT
Listening port number.
--bind_ip IP
IP addresses to bind.
--auth
Enable authentication.
--config FILE
Configuration file.
--replSet NAME
Replica set name.
--help
Display help information.

CAVEATS

Requires proper storage configuration. Resource intensive. Needs careful security setup.

HISTORY

mongod is the MongoDB server process, the core component of MongoDB since its initial release in 2009.

SEE ALSO

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community