To view MongoDB instance details, you can use the following methods:
MongoDB Shell (mongosh):
Connect to your MongoDB instance using the mongosh command-line tool. Once connected, run the db.stats() command to view database-level statistics or db.serverStatus() for server-level details.
Example:
mongosh "mongodb://username:password@host:port/database"
> db.stats()
> db.serverStatus()
MongoDB Compass (GUI Tool):
MongoDB Compass provides a graphical interface to view instance details, including collections, indexes, performance metrics, and server status.
Example:
Cloud Provider Console (e.g., Tencent Cloud):
If your MongoDB instance is hosted on Tencent Cloud, you can view instance details through the Tencent Cloud Database for MongoDB console. The console provides metrics like CPU usage, storage, connection count, and backup status.
Example:
System Logs and Monitoring Tools:
Check MongoDB logs (mongod.log) for operational details or integrate with monitoring tools like Prometheus and Grafana for advanced insights.
For Tencent Cloud users, enabling Cloud Monitor can help track performance metrics and set alerts for your MongoDB instance.