You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> 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).
24
24
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).
26
26
27
27
## Create a virtual machine running Windows Server
28
28
Follow these instructions to create a virtual machine.
@@ -31,8 +31,8 @@ Follow these instructions to create a virtual machine.
31
31
32
32
> [!NOTE]
33
33
> 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
+
>
36
36
37
37
## Attach a data disk
38
38
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
Copy file name to clipboardExpand all lines: includes/howto-attach-disk-windows-linux.md
+38-20Lines changed: 38 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,38 +4,56 @@
4
4
## Attach an empty disk
5
5
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.
6
6
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.
9
8
10
-

9
+
2. In the Settings menu, click **Disks**.
11
10
12
-
3. The **Attach an Empty Disk** dialog box appears.
11
+

13
12
14
-

13
+
3. On the command bar, click **Attach new**.
14
+
The **Attach new disk** dialog box appears.
15
15
16
-
Perform the following steps:
16
+

17
+
18
+
Fill in the following information:
17
19
- 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.
20
26
21
-
4. After the data disk is created and attached, it's listed in the dashboard of the VM.
22
-
23
-

27
+

24
28
25
29
> [!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.
27
31
28
32
## How to: Attach an existing disk
29
33
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.
30
34
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
+

42
+
43
+
4. Click **Location**. The available storage accounts display. Next, select an appropriate storage account from those listed.
44
+
45
+

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
+

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
+

33
54
34
-

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.
35
56
36
-
3. Select the data disk and then click the check mark to attach the data disk.
37
-
38
-

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.
40
58
41
-

59
+

Copy file name to clipboardExpand all lines: includes/install-and-run-mongo-on-win2k8-vm.md
+41-36Lines changed: 41 additions & 36 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,27 +2,27 @@ Follow these steps to install and run MongoDB on a virtual machine running Windo
2
2
3
3
> [!IMPORTANT]
4
4
> 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
+
>
7
7
8
8
1. After you've connected to the virtual machine using Remote Desktop, open Internet Explorer from the **Start** menu on the virtual machine.
9
9
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.
10
10
3. Go to [Downloads - MongoDB](https://www.mongodb.com/download-center#community).
11
11
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:
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.
24
24
8. To start the MongoDB administrative shell, open another command window from **Start** and type the following commands:
25
-
25
+
26
26
C:\> cd \my_mongo_dir\bin
27
27
C:\my_mongo_dir\bin> mongo
28
28
>db
@@ -35,55 +35,58 @@ Follow these steps to install and run MongoDB on a virtual machine running Windo
35
35
> show collections
36
36
...
37
37
> help
38
-
38
+
39
39
The database is created by the insert.
40
40
9. Alternatively, you can install mongod.exe as a service:
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 commandline options, see [Service-related commandline 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
+
46
46
To start the service, run this command:
47
-
47
+
48
48
C:\> net start MongoDB
49
49
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**.
50
50
11. a) In the left pane, select **Inbound Rules**. In the **Actions** pane on the right, select **New Rule...**.
51
-
51
+
52
52
![Windows Firewall][Image1]
53
-
53
+
54
54
b) In the **New Inbound Rule Wizard**, select **Port** and then click **Next**.
55
-
55
+
56
56
![Windows Firewall][Image2]
57
-
57
+
58
58
c) Select **TCP** and then **Specific local ports**. Specify a port of "27017" (the default port MongoDB listens on) and click **Next**.
59
-
59
+
60
60
![Windows Firewall][Image3]
61
-
61
+
62
62
d) Select **Allow the connection** and click **Next**.
63
-
63
+
64
64
![Windows Firewall][Image4]
65
-
65
+
66
66
e) Click **Next** again.
67
-
67
+
68
68
![Windows Firewall][Image5]
69
-
69
+
70
70
f) Specify a name for the rule, such as "MongoPort", and click **Finish**.
71
-
71
+
72
72
![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
+
75
78
![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
+
79
82
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
+
81
84
![Endpoints][Image9]
82
85
83
86
> [!NOTE]
84
87
> 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.
0 commit comments