Today, let's take a quick look ๐ at the daemon process for MongoDB - MongoD ๐ฅ;
which handles all the queries that we execute in Mongo Shell ๐ and is also responsible for persisting data.
๐ก
Daemon process are background process that are not interacted with directly.
Take a look at the below diagram and try to understand it.
That's why, MongoD is present inside every mongo server, whether it is a replicaset or a sharded server.
We can start the mongoD process in a mongo server with the help of a command -mongod
.
Below is the default configuration for MongoD -
๐ก
DBPath is the directory where all the data files for your database are stored. The dbpath also contains journaling logs to provide durability in case of a crash.
๐ก
Port option allows us to specify the port on which mongod will listen for client connections.
mongod --port <port_number>
๐ก
auth enables authentication to control which users can access the database. When auth is specified, all database clients who want to connect to mongod first need to authenticate.
๐ก
bind_ip option allows us to specify which IP addresses mongod should bind to. When mongod binds to an IP address, clients from that address are able to connect to mongod.
mongod --bind_ip
localhost
,123.123.123.123
Well, thanks for reading ๐. I hope you got to learn something new. And if you are still figuring out what the hell journaling logs are ๐ then stay tuned ๐; let's see you in the next one ๐๐ป