Can i know how to install or to update mongo db to 2.0.5 from 2.0.1 – jyothi Jun 6 '12 at 10:59 Installing the 10gen packages as described in my answer will give you 2.0.6. Previous versions are available for download and manual install from the MongoDB website, but I strongly suggest you stick to the packaged versions. C: mongodb bin >mongodb.exe C: mongodb bin mongod.conf --install Don't be tempted to put inverted commas around a dbpath with spaces. The service will appear to start when you execute net start MongoDB but it will terminate.
-->MongoDB is a popular open-source, high-performance NoSQL database. This article guides you through installing and configuring MongoDB on a Windows Server 2016 virtual machine (VM) in Azure. You can also install MongoDB on a Linux VM in Azure.
Before you install and configure MongoDB, you need to create a VM and, ideally, add a data disk to it. See the following articles to create a VM and add a data disk:
To begin installing and configuring MongoDB, log on to your Windows Server VM by using Remote Desktop.
Important
MongoDB security features, such as authentication and IP address binding, are not enabled by default. Security features should be enabled before deploying MongoDB to a production environment. For more information, see MongoDB Security and Authentication.
After you've connected to your VM using Remote Desktop, open Internet Explorer from the taskbar.
Select Use recommended security, privacy, and compatibility settings when Internet Explorer first opens, and click OK.
Internet Explorer enhanced security configuration is enabled by default. Add the MongoDB website to the list of allowed sites:
Select the Tools icon in the upper-right corner.
In Internet Options, select the Security tab, and then select the Trusted Sites icon.
Click the Sites button. Add https://*.mongodb.com to the list of trusted sites, and then close the dialog box.
Browse to the MongoDB - Downloads page (https://www.mongodb.com/downloads).
If needed, select the Community Server edition and then select the latest current stable release forWindows Server 2008 R2 64-bit and later. To download the installer, click DOWNLOAD (msi).
Run the installer after the download is complete.
Read and accept the license agreement. When you're prompted, select Complete install.
If desired, you can choose to also install Compass, a graphical interface for MongoDB.
On the final screen, click Install.
The path variables are not updated by the MongoDB installer. Without the MongoDB bin
location in your path variable, you need to specify the full path each time you use a MongoDB executable. To add the location to your path variable:
Right-click the Start menu, and select System.
Click Advanced system settings, and then click Environment Variables.
Under System variables, select Path, and then click Edit.
Add the path to your MongoDB bin
folder. MongoDB is typically installed in C:Program FilesMongoDB. Verify the installation path on your VM. The following example adds the default MongoDB install location to the PATH
variable:
Note
Be sure to add the leading semicolon (;
) to indicate that you are adding a location to your PATH
variable.
Create MongoDB data and log directories on your data disk. From the Start menu, select Command Prompt. The following examples create the directories on drive F:
Start a MongoDB instance with the following command, adjusting the path to your data and log directories accordingly:
It may take several minutes for MongoDB to allocate the journal files and start listening for connections. All log messages are directed to the F:MongoLogsmongolog.log file as mongod.exe
server starts and allocates journal files.
Note
The command prompt stays focused on this task while your MongoDB instance is running. Leave the command prompt window open to continue running MongoDB. Or, install MongoDB as service, as detailed in the next step.
For a more robust MongoDB experience, install the mongod.exe
as a service. Creating a service means you don't need to leave a command prompt running each time you want to use MongoDB. Create the service as follows, adjusting the path to your data and log directories accordingly:
The preceding command creates a service named MongoDB, with a description of 'Mongo DB'. The following parameters are also specified:
--dbpath
option specifies the location of the data directory.--logpath
option must be used to specify a log file, because the running service does not have a command window to display output.--logappend
option specifies that a restart of the service causes output to append to the existing log file.To start the MongoDB service, run the following command:
For more information about creating the MongoDB service, see Configure a Windows Service for MongoDB.
With MongoDB running as a single instance or installed as a service, you can now start creating and using your databases. To start the MongoDB administrative shell, open another command prompt window from the Start menu, and enter the following command:
You can list the databases with the db
command. Insert some data as follows:
Search for data as follows:
The output is similar to the following example:
Exit the mongo
console as follows:
Now that MongoDB is installed and running, open a port in Windows Firewall so you can remotely connect to MongoDB. To create a new inbound rule to allow TCP port 27017, open an administrative PowerShell prompt and enter the following command:
You can also create the rule by using the Windows Firewall with Advanced Security graphical management tool. Create a new inbound rule to allow TCP port 27017.
If needed, create a Network Security Group rule to allow access to MongoDB from outside of the existing Azure virtual network subnet. You can create the Network Security Group rules by using the Azure portal or Azure PowerShell. As with the Windows Firewall rules, allow TCP port 27017 to the virtual network interface of your MongoDB VM.
Note
TCP port 27017 is the default port used by MongoDB. You can change this port by using the --port
parameter when starting mongod.exe
manually or from a service. If you change the port, make sure to update the Windows Firewall and Network Security Group rules in the preceding steps.
In this tutorial, you learned how to install and configure MongoDB on your Windows VM. You can now access MongoDB on your Windows VM, by following the advanced topics in the MongoDB documentation.
댓글 영역