MongoDB by default listens on port 27017. Ports 3306 and 5432 are for MySQL and PostgreSQL respectively, and 8080 is commonly used for web servers.
systemctl status mongod. What output indicates the service is running correctly?The status line showing active (running) means MongoDB is running properly. Other statuses indicate stopped, failed, or starting states.
The correct way to start MongoDB service is using systemctl start mongod. Other commands are either invalid or incorrect syntax.
mongo shell, you get Failed to connect to 127.0.0.1:27017. What is the most likely cause?If the MongoDB service is not running, the shell cannot connect to the default port 27017. Ports 3306 and 5432 are unrelated, and the shell command is correct.
Option C enables journaling for data durability and sets WiredTiger cache size to 2GB, balancing performance and memory. Other options disable journaling or use invalid flags.
