Each document represents an individual bank account with a randomly-generated account balance. To this end, the examples throughout this guide refer to a sample collection named accounts containing a large number of documents. To illustrate MongoDB’s performance monitoring features, you’ll need a database with enough data that it will take MongoDB a significant length of time to execute queries. To switch to another database, run the use command followed by the name of your database:ĭatabase monitoring isn’t very practical or useful when working with a small data set, since the database system will only need to scan a few records for any given query. You can safely use this database to experiment with MongoDB and the MongoDB shell.Īlternatively, you could switch to another database to run all of the example commands given in this tutorial. Note: On a fresh connection, the MongoDB shell will connect to the test database by default. After providing the password, you’ll see the > prompt sign. mongo -u AdminSammy -p -authenticationDatabase adminĮnter the password set during installation to gain access to the shell.Be sure to change these details in the following command to reflect your own setup, if different: This tutorial follows the conventions of the prerequisite MongoDB security tutorial and assumes the name of this administrative user is AdminSammy and its authentication database is admin. To create the sample collection used in this guide, connect to the MongoDB shell as your administrative user. In order to explain how you can monitor MongoDB’s performance, this step outlines how to open the MongoDB shell to connect to your locally-installed MongoDB instance and create a sample collection within it. It will generally work with any MongoDB installation regardless of the operating system as long as authentication has been enabled. This tutorial concentrates on MongoDB itself, not the underlying operating system. Note: The linked tutorials on how to configure your server, install MongoDB, and secure the MongoDB installation refer to Ubuntu 20.04. To learn how to use MongoDB queries, follow our guide on How To Create Queries in MongoDB. Familiarity with querying MongoDB collections and filtering results.To secure MongoDB like this, follow our tutorial on How To Secure MongoDB on Ubuntu 20.04. Your server’s MongoDB instance secured by enabling authentication and creating an administrative user.To set this up, follow our tutorial on How to Install MongoDB on Ubuntu 20.04. This tutorial was validated using a server running Ubuntu 20.04, and you can prepare your server by following this initial server setup tutorial for Ubuntu 20.04.
0 Comments
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |