Before you can use an ApsaraDB for MongoDB instance, you must create one. This topic describes how to quickly create an ApsaraDB for MongoDB instance.
Prerequisites
An Alibaba Cloud account is created. For more information, see Create an Alibaba Cloud account.
Billing
Creating a MongoDB instance incurs fees related to specifications and storage. For more information, see Billable items.
Free trial
Alibaba Cloud offers free trials for ApsaraDB for MongoDB replica set instances. If you are an enterprise user who uses ApsaraDB for MongoDB for the first time, you can go to the All Free Tier Products Available page to apply for a trial. If you are not a first-time user of ApsaraDB for MongoDB, follow the steps described in this topic to create a replica set instance in the ApsaraDB for MongoDB console.
Procedure
Replica set instance
The following example describes how to create a pay-as-you-go replica set instance that runs MongoDB 8.0. For more information, see Create a replica set instance.
Visit the ApsaraDB for MongoDB buy page.
On the page that appears, configure the parameters described in the following table.
Parameter
Description
Example
Product Type
Select an appropriate product type based on your business requirements.
Replica Set (Pay-as-you-go)
Region
Select the region where you want to deploy the instance.
China (Hangzhou)
Deployment Type
Select the zone deployment type of the instance.
Single zone
Zone
Select the zone where you want to deploy the instance.
Hangzhou Zone J
Engine Version
Select an appropriate database version based on your business requirements.
MongoDB 8.0
Active-standby Nodes
Specify the number of nodes in the instance based on your business requirements.
Three Nodes
Read-only Nodes
Specify the number of read-only nodes in the instance based on your business requirements.
No Read-only Node
Storage Engine
Set the value to WiredTiger.
WiredTiger
Storage Type
Select the storage type of the instance based on your business requirements.
ESSD PL1
Encryption Type
Specify whether to enable disk encryption.
No Encryption
Resource Group
Select the resource group that is used to manage the instance.
Default Resource Group
Tag
Specify the tags that you want to add to the instance.
N/A
Network Type
Set the value to VPC.
VPC
VPC
Select the virtual private cloud (VPC) where you want to deploy the instance. If you want to access the instance from an ECS instance, we recommend that you select the same VPC as the ECS instance to connect to the ApsaraDB for MongoDB instance over a private network.
You can directly use Default VPC. If no default VPC exists, you can go to the VPC console to create one.
Default VPC
vSwitch
Select the vSwitch to which the instance belongs.
You can directly use Default vSwitch. If no default vSwitch exists, you can go to the VPC console to create one.
Default vSwitch
Category
Select the instance category.
Dedicated
Specifications
Select the instance specifications.
2 Cores, 4 GB (Dedicated)
Storage
Specify the storage capacity of the instance.
20 GB
Username
Set the value to root.
root
Set Password
Select Set Now.
If selecting Set Later, you must reset a password before connecting to the instance.
Set Now
Password
Enter the password for the root account and confirm the password.
This password is only an example. Do not use it in actual business scenarios.
PassWord123!
Instance Name
Specify the instance name.
Test Instance
Quantity
Specify the number of instances with the same configurations.
1
Click Buy Now.
After you confirm that the parameter configurations are correct, click Activate Now.
On the Activated page, click Console to go to the instance list page. You can view the newly created instance in the instance list.
It takes about 10 to 15 minutes to create an instance. If the instance does not appear in the instance list, refresh the page later.
Sharded cluster instance
The following example describes how to create a pay-as-you-go sharded cluster instance that runs MongoDB 8.0. For more information, see Create a sharded cluster instance.
Visit the ApsaraDB for MongoDB buy page.
On the page that appears, configure the parameters described in the following table.
Parameter
Description
Example
Product Type
Select an appropriate product type based on your business requirements.
Sharded Cluster (Pay-as-you-go)
Region
Select the region where you want to deploy the instance.
China (Hangzhou)
Zone Type
Select the zone deployment type of the instance.
Single zone
Zone
Select the zone where you want to deploy the instance.
Hangzhou Zone J
Protocol Type
Set the value to MongoDB.
MongoDB
Engine Version
Select an appropriate database version based on your business requirements.
MongoDB 8.0
Storage Engine
Set the value to WiredTiger.
WiredTiger
Storage Type
Select the storage type of the instance based on your business requirements.
ESSD PL1
Encryption Type
Specify whether to enable disk encryption.
No Encryption
Category
Select the instance category.
Dedicated
Resource Group
Select the resource group that is used to manage the instance.
Default Resource Group
Tag
Specify the tags that you want to add to the instance.
N/A
Network Type
Set the value to VPC.
VPC
VPC
Select the VPC where you want to deploy the instance. If you want to access the instance from an ECS instance, we recommend that you select the same VPC as the ECS instance to connect to the ApsaraDB for MongoDB instance over a private network.
You can directly use Default VPC. If no default VPC exists, you can go to the VPC console to create one.
Default VPC
vSwitch
Select the vSwitch to which the instance belongs.
You can directly use Default vSwitch. If no default vSwitch exists, you can go to the VPC console to create one.
Default vSwitch
Mongos specification
Select the specifications of the mongos component.
2 Cores, 8 GB (Dedicated)
Mongos Quantity
Specify the number of mongos components.
2
Shard specifications
Select the specifications of the shard component.
2 Cores, 8 GB (Dedicated)
Shard Storage
Specify the storage capacity of the shard component.
20 GB
Shard Read-only Nodes
Specify the number of read-only nodes in the shard component.
No Read-only Node
Shard Quantity
Specify the number of shard components.
2
ConfigServer Specification
Specify the specifications of the configServer component.
4 Cores, 8 GB (Dedicated)
ConfigServer Storage
Specify the storage capacity of the configServer component.
20 GB
Username
Set the value to root.
root
Set Password
Select Set Now.
If selecting Set Later, you must reset a password before connecting to the instance.
Set Now
Password
Enter the password for the root account and confirm the password.
This password is only an example. Do not use it in actual business scenarios.
PassWord123!
Instance Name
Specify the instance name.
Test Instance
Click Buy Now.
After you confirm that the parameter configurations are correct, click Activate Now.
On the Activated page, click Console to go to the instance list page. You can view the newly created instance in the instance list.
It takes about 10 to 15 minutes to create an instance. If the instance does not appear in the instance list, refresh the page later.
Standalone instance
The following example describes how to create a pay-as-you-go standalone instance that runs MongoDB 4.0. For more information, see Create a standalone instance.
Visit the ApsaraDB for MongoDB buy page.
On the page that appears, configure the parameters described in the following table.
Parameter
Description
Example
Product Type
Select an appropriate product type based on your business requirements.
Replica Set (Pay-as-you-go)
Region
Select the region where you want to deploy the instance.
China (Hangzhou)
Deployment Type
Select the zone deployment type of the instance.
Single zone
Zone
Select the zone in which you want to deploy the instance.
Hangzhou Zone G
Engine Version
Select MongoDB 4.0.
MongoDB 4.0
Active-standby Nodes
Specify the number of nodes in the instance based on your business requirements.
Single Node
Read-only Nodes
Set the value to No Read-only Node.
No Read-only Node
Storage Engine
Set the value to WiredTiger.
WiredTiger
Storage Type
Set the value to ESSD PL1.
ESSD PL1
Resource Group
Select the resource group that is used to manage the instance.
Default Resource Group
Tag
Specify the tags that you want to add to the instance.
N/A
Network Type
Set the value to VPC.
VPC
VPC
Select the VPC where you want to deploy the instance. If you want to access the instance from an ECS instance, we recommend that you select the same VPC as the ECS instance to connect to the ApsaraDB for MongoDB instance over a private network.
You can directly use Default VPC. If no default VPC exists, you can go to the VPC console to create one.
Default VPC
vSwitch
Select the vSwitch to which the instance belongs.
You can directly use Default Switch. If no default vSwitch exists, you can go to the VPC console to create one.
Default vSwitch
Category
Set the value to General-purpose.
General-purpose
Specifications
Select the instance specifications.
1 Core, 2 GB (General-purpose)
Storage
Specify the storage capacity of the instance.
20 GB
Username
Set the value to root.
root
Set Password
Select Set Now.
If you select Set Later, you must reset a password before connecting to the instance.
Set Now
Password
Enter the password for the root account and confirm the password.
This password is only an example. Do not use it in actual business scenarios.
PassWord123!
Instance Name
Specify the instance name.
Test Instance
Quantity
Specify the number of instances with the same configurations.
1
Click Buy Now.
After you confirm that the parameter configurations are correct, click Activate Now.
On the Activated page, click Console to go to the instance list page. You can view the newly created instance in the instance list.
It takes about 10 to 15 minutes to create an instance. If the instance does not appear in the instance list, refresh the page later.