Skip to content

Commit 50b5d34

Browse files
authored
Merge pull request #7925 from v-ribi/virtual-machines-windows-classic-install-mongodb
�Updated for new portal. Some steps are new, as are corresponding pics.
2 parents 7139932 + d3369d4 commit 50b5d34

14 files changed

+87
-61
lines changed

articles/virtual-machines/virtual-machines-windows-classic-install-mongodb.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ ms.workload: infrastructure-services
1414
ms.tgt_pltfrm: vm-windows
1515
ms.devlang: na
1616
ms.topic: article
17-
ms.date: 01/10/2017
17+
ms.date: 03/07/2017
1818
ms.author: iainfou
1919

2020
---
2121
# Install MongoDB on a Windows VM in Azure
2222
> [!IMPORTANT]
2323
> Azure has two different deployment models for creating and working with resources: [Resource Manager and classic](../azure-resource-manager/resource-manager-deployment-model.md?toc=%2fazure%2fvirtual-machines%2fwindows%2fclassic%2ftoc.json). This article covers using the classic deployment model. Microsoft recommends that most new deployments use the Resource Manager model. To install and configure MongoDB using the Resource Manager deployment model, see [this article](virtual-machines-windows-install-mongodb.md?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json).
2424
25-
[MongoDB][MongoDB] is a popular open-source, high-performance NoSQL database. This article guides you through creating a Windows Server virtual machine (VM) using the [Azure classic portal][AzurePortal]. You then create and attach a data disk to the VM before installing and configuring MongoDB. If you have an existing VM in Azure that you would like to use, you can jump straight to [installing and configuring MongoDB](#install-and-run-mongodb-on-the-virtual-machine).
25+
[MongoDB][MongoDB] is a popular open-source, high-performance NoSQL database. This article guides you through creating a Windows Server virtual machine (VM) using the [Azure portal][AzurePortal]. You then create and attach a data disk to the VM before installing and configuring MongoDB. If you have an existing VM in Azure that you would like to use, you can jump straight to [installing and configuring MongoDB](#install-and-run-mongodb-on-the-virtual-machine).
2626

2727
## Create a virtual machine running Windows Server
2828
Follow these instructions to create a virtual machine.
@@ -31,8 +31,8 @@ Follow these instructions to create a virtual machine.
3131

3232
> [!NOTE]
3333
> You can add an endpoint for MongoDB while creating the virtual machine, and configure it as follows: name it as **Mongo**, use **TCP** as the protocol, and set both the public and private ports to **27017**.
34-
>
35-
>
34+
>
35+
>
3636
3737
## Attach a data disk
3838
To provide storage for the virtual machine, attach a data disk and then initialize it so that Windows can use it. If you already have a data disk, you can attach that existing disk, or you can attach an empty disk.
@@ -49,4 +49,7 @@ In this tutorial, you learned how to create a virtual machine running Windows Se
4949

5050
[MongoDocs]: http://docs.mongodb.org/manual/
5151
[MongoDB]: http://www.mongodb.org/
52-
[AzurePortal]: http://manage.windowsazure.com
52+
[AzurePortal]: https://portal.azure.com/
53+
54+
<!-- Classic portal. Removed 03/07/2017 -->
55+
<!-- [AzurePortal]: http://manage.windowsazure.com -->

includes/howto-attach-disk-windows-linux.md

Lines changed: 38 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,38 +4,56 @@
44
## Attach an empty disk
55
Attaching an empty disk is a simple way to add a data disk, because Azure creates the .vhd file for you and stores it in the storage account.
66

7-
1. Click **Virtual Machines**, and then select the appropriate VM.
8-
2. On the command bar, click **Attach**, and then click **Attach Empty Disk**.
7+
1. Click **Virtual Machines (classic)**, and then select the appropriate VM.
98

10-
![Attach an empty disk](./media/howto-attach-disk-windows-linux/AttachEmptyDisk.png)
9+
2. In the Settings menu, click **Disks**.
1110

12-
3. The **Attach an Empty Disk** dialog box appears.
11+
![Attach a new empty disk](./media/howto-attach-disk-windows-linux/menudisksattachnew.png)
1312

14-
![Attach a new empty disk](./media/howto-attach-disk-windows-linux/AttachEmptyDetail.png)
13+
3. On the command bar, click **Attach new**.
14+
The **Attach new disk** dialog box appears.
1515

16-
Perform the following steps:
16+
![Attach a new disk](./media/howto-attach-disk-windows-linux/newdiskdetail.png)
17+
18+
Fill in the following information:
1719
- In **File Name**, accept the default name or type another one for the .vhd file. The data disk uses an automatically generated name, even if you type another name for the .vhd file.
18-
- Type the **Size (GB)** of the data disk.
19-
- Click the check mark to finish.
20+
- Select the **Type** of the data disk. All virtual machines support standard disks. Many virtual machines also support premium disks.
21+
- Select the **Size (GB)** of the data disk.
22+
- For **Host caching**, choose none or Read Only.
23+
- Click OK to finish.
24+
25+
4. After the data disk is created and attached, it's listed in the disks section of the VM.
2026

21-
4. After the data disk is created and attached, it's listed in the dashboard of the VM.
22-
23-
![Empty data disk successfully attached](./media/howto-attach-disk-windows-linux/AttachEmptySuccess.png)
27+
![New and empty data disk successfully attached](./media/howto-attach-disk-windows-linux/newdiskemptysuccessful.png)
2428

2529
> [!NOTE]
26-
> After you add a data disk, you need to log on to the VM and initialize the disk so that it can be used.
30+
> After you add a data disk, you need to log on to the VM and initialize the disk so that it can be used.
2731
2832
## How to: Attach an existing disk
2933
Attaching an existing disk requires that you have a .vhd available in a storage account. Use the [Add-AzureVhd](https://msdn.microsoft.com/library/azure/dn495173.aspx) cmdlet to upload the .vhd file to the storage account. After you've created and uploaded the .vhd file, you can attach it to a VM.
3034

31-
1. Click **Virtual Machines**, and then select the appropriate virtual machine.
32-
2. On the command bar, click **Attach**, and then select **Attach Disk**.
35+
1. Click **Virtual Machines (classic)**, and then select the appropriate virtual machine.
36+
37+
2. In the Settings menu, click **Disks**.
38+
39+
3. On the command bar, click **Attach existing**.
40+
41+
![Attach data disk](./media/howto-attach-disk-windows-linux/menudisksattachexisting.png)
42+
43+
4. Click **Location**. The available storage accounts display. Next, select an appropriate storage account from those listed.
44+
45+
![Provide disk storage account](./media/howto-attach-disk-windows-linux/existdiskstorageaccounts.png)
46+
47+
5. A **Storage account** holds one or more containers that contain disk drives (vhds). Select the appropriate container from those listed.
48+
49+
![Provide container of virtual-machines-windows](./media/howto-attach-disk-windows-linux/existdiskcontainers.png)
50+
51+
6. The **vhds** panel lists the disk drives held in the container. Click one of the disks, and then click Select.
52+
53+
![Provide disk image for virtual-machines-windows](./media/howto-attach-disk-windows-linux/existdiskvhds.png)
3354

34-
![Attach data disk](./media/howto-attach-disk-windows-linux/AttachExistingDisk.png)
55+
7. The **Attach existing disk** panel displays again, with the location containing the storage account, container, and selected hard disk (vhd) to add to the virtual machine.
3556

36-
3. Select the data disk and then click the check mark to attach the data disk.
37-
38-
![Enter data disk details](./media/howto-attach-disk-windows-linux/AttachExistingDetail.png)
39-
4. After the data disk is attached, it's listed in the dashboard of the VM.
57+
Set **Host caching** to none or Read only, then click OK.
4058

41-
![Data disk successfully attached](./media/howto-attach-disk-windows-linux/AttachExistingSuccess.png)
59+
![Data disk successfully attached](./media/howto-attach-disk-windows-linux/exisitingdisksuccessful.png)

includes/install-and-run-mongo-on-win2k8-vm.md

Lines changed: 41 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,27 @@ Follow these steps to install and run MongoDB on a virtual machine running Windo
22

33
> [!IMPORTANT]
44
> 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 [Security and Authentication](http://www.mongodb.org/display/DOCS/Security+and+Authentication).
5-
>
6-
>
5+
>
6+
>
77
88
1. After you've connected to the virtual machine using Remote Desktop, open Internet Explorer from the **Start** menu on the virtual machine.
99
2. Select the **Tools** button in the upper right corner. In **Internet Options**, select the **Security** tab, and then select the **Trusted Sites** icon, and finally click the **Sites** button. Add *https://\*.mongodb.org* to the list of trusted sites.
1010
3. Go to [Downloads - MongoDB](https://www.mongodb.com/download-center#community).
1111
4. Find the **Current Stable Release** of **Community Server**, select the latest **64-bit** version in the Windows column. Download, then run the MSI installer.
12-
5. MongoDB is typically installed in C:\Program Files\MongoDB. Search for Environment Variables on the desktop and add the MongoDB binaries path to the PATH variable. For example, you might find the binaries at C:\Program Files\MongoDB\Server\3.2\bin on your machine.
13-
6. Create MongoDB data and log directories in the data disk (drive **F:**, for example) you created in the preceding steps. From **Start**, select **Command Prompt** to open a command prompt window. Type:
14-
12+
5. MongoDB is typically installed in C:\Program Files\MongoDB. Search for Environment Variables on the desktop and add the MongoDB binaries path to the PATH variable. For example, you might find the binaries at C:\Program Files\MongoDB\Server\3.4\bin on your machine.
13+
6. Create MongoDB data and log directories in the data disk (such as drive **F:**) you created in the preceding steps. From **Start**, select **Command Prompt** to open a command prompt window. Type:
14+
1515
C:\> F:
1616
F:\> mkdir \MongoData
1717
F:\> mkdir \MongoLogs
1818
7. To run the database, run:
19-
19+
2020
F:\> C:
2121
C:\> mongod --dbpath F:\MongoData\ --logpath F:\MongoLogs\mongolog.log
22-
22+
2323
All log messages are directed to the *F:\MongoLogs\mongolog.log* file as mongod.exe server starts and preallocates journal files. It may take several minutes for MongoDB to preallocate the journal files and start listening for connections. The command prompt stays focused on this task while your MongoDB instance is running.
2424
8. To start the MongoDB administrative shell, open another command window from **Start** and type the following commands:
25-
25+
2626
C:\> cd \my_mongo_dir\bin
2727
C:\my_mongo_dir\bin> mongo
2828
>db
@@ -35,55 +35,58 @@ Follow these steps to install and run MongoDB on a virtual machine running Windo
3535
> show collections
3636
...
3737
> help
38-
38+
3939
The database is created by the insert.
4040
9. Alternatively, you can install mongod.exe as a service:
41-
41+
4242
C:\> mongod --dbpath F:\MongoData\ --logpath F:\MongoLogs\mongolog.log --logappend --install
43-
44-
A service is installed named MongoDB with a description of "Mongo DB". The `--logpath` option must be used to specify a log file, since the running service does not have a command window to display output. The `--logappend` option specifies that a restart of the service causes output to append to the existing log file. The `--dbpath` option specifies the location of the data directory. For more service-related command line options, see [Service-related command line options][MongoWindowsSvcOptions].
45-
43+
44+
A service is installed named MongoDB with a description of "Mongo DB". The `--logpath` option must be used to specify a log file, since the running service does not have a command window to display output. The `--logappend` option specifies that a restart of the service causes output to append to the existing log file. The `--dbpath` option specifies the location of the data directory. For more service-related command-line options, see [Service-related command-line options][MongoWindowsSvcOptions].
45+
4646
To start the service, run this command:
47-
47+
4848
C:\> net start MongoDB
4949
10. Now that MongoDB is installed and running, you need to open a port in Windows Firewall so you can remotely connect to MongoDB. From the **Start** menu, select **Administrative Tools** and then **Windows Firewall with Advanced Security**.
5050
11. a) In the left pane, select **Inbound Rules**. In the **Actions** pane on the right, select **New Rule...**.
51-
51+
5252
![Windows Firewall][Image1]
53-
53+
5454
b) In the **New Inbound Rule Wizard**, select **Port** and then click **Next**.
55-
55+
5656
![Windows Firewall][Image2]
57-
57+
5858
c) Select **TCP** and then **Specific local ports**. Specify a port of "27017" (the default port MongoDB listens on) and click **Next**.
59-
59+
6060
![Windows Firewall][Image3]
61-
61+
6262
d) Select **Allow the connection** and click **Next**.
63-
63+
6464
![Windows Firewall][Image4]
65-
65+
6666
e) Click **Next** again.
67-
67+
6868
![Windows Firewall][Image5]
69-
69+
7070
f) Specify a name for the rule, such as "MongoPort", and click **Finish**.
71-
71+
7272
![Windows Firewall][Image6]
73-
12. If you didn't configure an endpoint for MongoDB when you created the virtual machine, you can do it now. You need both the firewall rule and the endpoint to be able to connect to MongoDB remotely. In the Management Portal, click **Virtual Machines**, click the name of your new virtual machine, and then click **Endpoints**.
74-
73+
74+
12. If you didn't configure an endpoint for MongoDB when you created the virtual machine, you can do it now. You need both the firewall rule and the endpoint to be able to connect to MongoDB remotely.
75+
76+
In the Azure portal, click **Virtual Machines (classic)**, click the name of your new virtual machine, and then click **Endpoints**.
77+
7578
![Endpoints][Image7]
76-
13. Click **Add** at the bottom of the page. Select **Add a Stand-Alone Endpoint** and click **Next**.
77-
78-
![Endpoints][Image8]
79+
80+
13. Click **Add**.
81+
7982
14. Add an endpoint with name "Mongo", protocol **TCP**, and both **Public** and **Private** ports set to "27017". Opening this port allows MongoDB to be accessed remotely.
80-
83+
8184
![Endpoints][Image9]
8285

8386
> [!NOTE]
8487
> The port 27017 is the default port used by MongoDB. You can change this default port by specifying the `--port` parameter when starting the mongod.exe server. Make sure to give the same port number in the firewall and the "Mongo" endpoint in the preceding instructions.
85-
>
86-
>
88+
>
89+
>
8790
8891
[MongoDownloads]: http://www.mongodb.org/downloads
8992

@@ -96,6 +99,8 @@ Follow these steps to install and run MongoDB on a virtual machine running Windo
9699
[Image4]: ./media/install-and-run-mongo-on-win2k8-vm/WinFirewall4.png
97100
[Image5]: ./media/install-and-run-mongo-on-win2k8-vm/WinFirewall5.png
98101
[Image6]: ./media/install-and-run-mongo-on-win2k8-vm/WinFirewall6.png
99-
[Image7]: ./media/install-and-run-mongo-on-win2k8-vm/WinVmAddEndpoint.png
100-
[Image8]: ./media/install-and-run-mongo-on-win2k8-vm/WinVmAddEndpoint2.png
101-
[Image9]: ./media/install-and-run-mongo-on-win2k8-vm/WinVmAddEndpoint3.png
102+
[Image7]: ./media/install-and-run-mongo-on-win2k8-vm/menusendpointadd.png
103+
<!-- Removed 03/08/2017. Not in new portal. -->
104+
<!-- [Image8]: ./media/install-and-run-mongo-on-win2k8-vm/WinVmAddEndpoint2.png
105+
-->
106+
[Image9]: ./media/install-and-run-mongo-on-win2k8-vm/newendpointdetails.png
14 KB
Loading
10.7 KB
Loading
10.3 KB
Loading
27.2 KB
Loading
29.3 KB
Loading
29.3 KB
Loading
32.4 KB
Loading

0 commit comments

Comments
 (0)