We had already discussed about the basics of NoSQL in our previous article. Here, let’s have a look at various considerations for deployment and configuration of NoSQL. MongoDB supports a variety of platforms such as Windows, Linux, Mac OS and Solaris for installation to provide document-oriented database. This article will cover MongoDB installation and hands-on experience on Windows platform. Following are the step-by-step instruction for MongoDB deployment on Windows:
Compatibility Check
1. MongoDB supports four versions of Windows including Windows 64-bit 2008 R2+, Windows 64-bit 2008 R2+ legacy, Windows 64-bit legacy and Windows 32-bit. For installation, you need to identify your Windows version, and ensure that it is supported by MongoDB.
a. To check your Windows version, press ‘Windows + R’ keys to open Windows Run, type “MSINFO32” and press ‘Enter’ to open the ‘System Information’ window.
b. In the ‘System Information’ window, the System Summary Tab provides information about operating system name and version.
Download and Install
2. Download MongoDB setup from official site of MongoDB. Here you can find the latest setup file:
https://www.mongodb.org/downloads?_ga=1.208203799.465445206.1432014970
3. Go to the download location and run the executable file for MongoDB. MongoDB allows users to deploy MongoDB by simply running .exe file or can be deployed using command prompt.
While installing, if you choose ‘Complete Install’ option, all the configuration files will be installed on the default location at “SystemDrive:Program FilesMongoDB”. To define a custom location and components for installation, you can select the Custom Install option.
4. Verify installation by navigating to the specified installation folder. Folder might contain more than ten executable files including mongod.exe, mongo.exe, mongodump.exe, mongorestore.exe, mongoimport.exe, mongoexport.exe, mongostat.exe, and mongotop.exe.
Setup and configuration
5. Setup a data directory to store all data.
a. Go to Command Prompt, navigate to the path where you want to create data directory and type md datadb command.
6. To start with MongoDB, first you need to start a daemon of MongoDB. On the command prompt, go to the installation folder.
7. Run Mongod.exe command to execute the file. This starts the MongoDB database and displays a message ‘Waiting for connections’. This indicates that the MongoDB is now running.
8. Open new command prompt to connect with MongoDB (leaving the current command prompt as is).
9. On the new command prompt, go to the installation folder location and run the command mongo.exe.
10. The above step will connect the console with the MongoDB server. You can verify the connection status of MongoDB in both of the command prompt. You MongoDB database is now ready.