![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=1739317517-QfQeV15nz3TMcqWjBj4BjyOfyLvXDOM8-0-45f2985d175fbbbdb0df517cb928c61f)
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=1739317517-9KYyNJAX4554o1OSy8Vun6riFD2qWHYF-0-58a80c1a104c8da43fb54c39039677ce)