![MongoDB 4 Quick Start Guide](https://wfqqreader-1252317822.image.myqcloud.com/cover/381/36699381/b_36699381.jpg)
上QQ阅读APP看书,第一时间看更新
Configure and run MongoDB on RHEL/Fedora/CentOS
If you followed the procedure outlined previously, a configuration file /etc/mongod.conf will have been auto-generated by the installation script. By default, database files will be placed in /var/lib/mongodb and log files in /var/log/mongodb/mongod.log. Here is an example of the auto-generated file for MongoDB v4.0 on CentOS 7:
![](https://epubservercos.yuewen.com/845C96/19470388008854906/epubprivate/OEBPS/Images/613438e9-857f-493f-adab-89650cff2e74.png?sign=1739389069-WJOz9NREP1T7wEZSWXfQN7xKMiDaiCHu-0-1f402f1daa6a2c6786aafcdae427f539)
You are now able to perform these operations:
Operation Command
Start | stop | restart the server /bin/systemctl start|stop|restart mongod.service
Access MongoDB via the shell (covered later) mongo --host 127.0.0.1:27017
After starting the service, use the command /bin/systemctl status mongod.service to confirm the status of MongoDB:
![](https://epubservercos.yuewen.com/845C96/19470388008854906/epubprivate/OEBPS/Images/109abe56-15bd-4fb1-9eab-5bcd2048402a.png?sign=1739389069-PlN52fX5wFcdyknOz16Y2fxG5kC2A4zP-0-9db9cbcf3ca674260067c5fbf6081a2e)