MongoDB: Step-2: Setting up the server
Step2 — Server & Client set up
This covers the setting up of the server on the cloud, the options for mongo client, typical mongo replica setup.
MongoDB server (on local)
MongoDB is open-source and the community edition of the server is available for free download.
Download the mongo server as per your OS and follow the instructions as mentioned in the below link. You will be surprised by the size of MongoDB package and the ease of installation if you have gone through some of the RDBMS installations in the past.
--dbpath
option points to your database directory. Create one folder for this, say it it “c:\data\db”
Run the below command to run a standalone server
“C:\Program Files\MongoDB\Server\4.2\bin\mongod.exe” — dbpath=”c:\data\db”
Setting up the MongoDB Server on the cloud for training
For the purposes of learning, it is easy to get started using the Mongo Atlas Cloud configuration wizard which will set up a free instance of a mongo replica set in the cloud with a provider of your choice.
The process is very simple, go through the wizard which will allow you to make your choice of mongo setup. The set up will take a few minutes. You will also have to whitelist your IP to your cloud configuration as part of the wizard steps.
Download the mongo client of your choice which can be a command-line program or mongo compass. My choice of mongo client is Mongo Shell as it allows me the flexibility to run different types of queries. Save the URL given to you to connect to the remote mongo server instance for future use.
Mongo Clients
MongoCompass and MongoShell are the official mongo clients offered by MongoDB.
There are few others too like Robo-3T(formerly RoboMongo) which are faster than MongoCompass but their limitation as they don’t support all the security options as what MongoCompass provides.
MongoDB Ops Manager
Enterprise MongoDB comes with the MongoDB Ops Manager which offers various views and controls on the cluster. This helps you monitor your cluster and take appropriate action.
Link to Step3
All related links
https://medium.com/@sarada.sastri/mongodb-step-1-an-overview-791e4fe861aa
https://medium.com/@sarada.sastri/mongodb-step-2-setting-up-the-server-4b0fad446c3e
https://medium.com/@sarada.sastri/mongodb-step-3-mongo-client-commands-4366b5ef139f
https://medium.com/@sarada.sastri/mongodb-step-4-designing-the-schema-8c91ee947230
https://medium.com/@sarada.sastri/mongodb-step-5-indexes-and-query-performance-optimizations-ed1bf744315b