ApsaraDB for Redis has two editions: Community Edition and Enhanced Edition (Tair). ApsaraDB for Redis Enhanced Edition (Tair) provides three instance series types: DRAM-based instances, persistent memory-optimized instances, and ESSD-based instances. This topic describes how to create an ApsaraDB for Redis instance.
Prerequisites
- An Alibaba Cloud account is created. For more information, see Sign up with Alibaba Cloud.
- If you want to create a pay-as-you-go instance, make sure that you have sufficient balance within your account.
Select a series type and specifications
Before you create an ApsaraDB for Redis instance, you must select a series type and specifications based on various factors, such as performance, price, and workload. For more information, see Select an ApsaraDB for Redis instance.
Create an ApsaraDB for Redis instance that uses local disks
- Go to the Instances page of the ApsaraDB for Redis console.
- In the upper-left corner of the page, click Create Instance.
- On the ApsaraDB for KVStore (Subscription) page, set Product Type to Redis (Local Disk, Including Tair).
- Set Billing Method.
- Subscription: You must pay for the instance when you create it. For long-term use, the subscription billing method is more cost-effective than the pay-as-you-go billing method. You are charged lower prices for longer subscription periods.
- Pay-As-You-Go: You are charged on an hourly basis after you create the instance. For short-term use, we recommend that you select the pay-as-you-go billing method. If you no longer need a pay-as-you-go instance, you can release the instance to reduce costs.
- Configure the parameters described in the following table.
Parameter Description Region The region in which you want to create the instance. The region cannot be changed after the instance is created. - To maximize access speed, we recommend that you select a region that is close to the geographic location of your users.
- To enable connections over the internal network, make sure that the ApsaraDB for Redis instance is deployed in the same region as Elastic Compute Service (ECS) instances that need to access the ApsaraDB for Redis instance. Otherwise, these ECS instances can access the ApsaraDB for Redis instance only over the Internet. This does not fully unleash the ApsaraDB for Redis instance performance.
Deployment Type - Single-zone Deployment: The master and replica nodes are deployed in the same zone. This deployment type can provide single-data center disaster recovery.
- Dual-zone Deployment: The master node and replica node are separately deployed in the specified primary zone and secondary zone of the same region to form a zone-disaster recovery architecture.
Primary Zone The zone in which you want to create the instance. Each region has multiple isolated locations known as zones. Each zone has its own independent power supply and network. All of the zones in a region provide the same level of service performance. If some ECS instances are used to access an ApsaraDB for Redis instance, the instance that is deployed in the same zone as the ECS instances can be accessed at a slightly lower latency compared with the instance that is deployed in a different zone.Note If you set the Deployment Type parameter to Dual-zone Deployment, you must also set the Secondary Zone parameter to a zone that is different from the zone specified for the Primary Zone parameter. The primary zone and secondary zone together form a master-replica zone-disaster recovery architecture.Network Type The network type of the instance. This parameter can be set only to VPC. A virtual private cloud (VPC) is an isolated network that provides higher security and better performance than the traditional classic network.
Important To enable connections over the internal network, make sure that the ApsaraDB for Redis instance is connected to the same network type as the ECS instances or ApsaraDB RDS instances that need to access the ApsaraDB for Redis instance.VPC The VPC in which you want to create the instance. If you do not have a VPC, create one first. For more information, see Create and manage a VPC. VSwitch The vSwitch that you want to connect to the instance in the VPC. If no vSwitches are available in the VPC in the current zone, create a vSwitch. For more information, see Create and manage a vSwitch. Edition - Community Edition: This edition is compatible with the open source Redis protocol and provides high performance.
- Enterprise Edition (Tair): This edition is developed based on ApsaraDB for Redis Community Edition. This edition is optimized in terms of performance, storage medium, and data module. For more information, see Overview.
Series The series type of the instance. This parameter is supported only if the Edition parameter is set to Enhanced Edition (Tair). This parameter can be set only to Performance-enhanced. This series type uses the multi-threading model. The performance of an instance of this series type is three times that of a Community Edition instance with the same specifications. This series type also provides multiple data modules to simplify development. For more information, see DRAM-based instances. Version The database engine version of the instance. We recommend that you select a relatively new database engine version that has more features. Architecture Type - Cluster: eliminates the performance bottleneck that is caused by the single-threading model. You can use the high-performance cluster instance to process large-capacity workloads.
- Standard: runs in a master-replica architecture, provides high-performance caching services, and ensures high data reliability.
- Read/Write Splitting: ensures high availability (HA) and high performance, and supports multiple specifications. The read/write splitting architecture allows a large number of concurrent reads of hot data from read replicas. This reduces the loads on the master node and minimizes O&M costs.
Shards The number of shards in the cluster instance. Data is distributed across the shards. Note This parameter is supported only if the Architecture Type parameter is set to Cluster.Node Type - The node type of the instance. If you set the Architecture Type parameter to Cluster or Standard, this parameter can be set only to Master-Replica.
- If you set the Architecture Type parameter to Read/Write Splitting, you can select the node type based on the number of read replicas.
Instance Class The specifications of the instance. Each option contains a group of configurations, such as the memory capacity, maximum number of concurrent connections to the instance, and maximum bandwidth. For more information, see Overview. Note Database metadata is generated when an instance is created. The size of the metadata on each shard of a cluster instance ranges from 30 MB to 50 MB. The total size of the metadata in a cluster instance equals the total size of metadata on all shards.Set Password - The time when you want to set the password. Later: You want to set the password after the instance is created. For more information, see Change or reset the password.
- Now: You want to set the password immediately.
- The password must be 8 to 32 characters in length.
- The password must contain at least three of the following character types: uppercase letters, lowercase letters, digits, and specific special characters.
- These special characters include
! @ # $ % ^ & * ( ) _ + - =
Instance Name The name of the instance, which is used to identify and manage the instance. Note The name must be 2 to 80 characters in length and must start with a letter. It cannot contain spaces or specific special characters. These special characters include @ / : = " < > { [ ] }Quantity The number of instances that you want to create. The instances have the same specifications. You can create up to 99 instances at a time. Subscription Duration The subscription duration of the instance. If you select the subscription billing method, you must specify a subscription duration and select whether to enable auto-renewal. Resource Group The resource group to which you want to assign the instance. For more information, see What is Resource Management? - Click Buy Now.
- On the Confirm Order page, read the ApsaraDB for Redis (Redis/Memcache) Agreement of Service, select I have read and agree to ApsaraDB for Redis (Redis/Memcache) Agreement of Service, and then follow the instructions to pay for the instance. After your payment is complete, wait for 1 to 5 minutes. To view the created instance, you can select the region where the instance resides on the Instances page of the ApsaraDB for Redis console.
Create an ApsaraDB for Redis Enhanced Edition (Tair) instance that uses cloud disks
For more information, see Create a Tair instance.Create an ApsaraDB for Redis instance that uses cloud disks
- Go to the Instances page of the ApsaraDB for Redis console.
- In the upper-left corner of the page, click Create Instance.
- On the buy page, set Product Type to Redis (Cloud Disk). Note Only the subscription billing method is supported for instances that use cloud disks. In this billing method, you must pay when you create the instance.
- Configure the parameters described in the following table.
Parameter Description Region The region in which you want to create the instance. The region cannot be changed after the instance is created. - To maximize access speed, we recommend that you select a region that is close to the geographic location of your users.
- To enable connections over the internal network, make sure that the ApsaraDB for Redis instance is deployed in the same region as Elastic Compute Service (ECS) instances that need to access the ApsaraDB for Redis instance. Otherwise, these ECS instances can access the ApsaraDB for Redis instance only over the Internet. This does not fully unleash the ApsaraDB for Redis instance performance.
Deployment Type - Single-zone Deployment: The master and replica nodes are deployed in the same zone. This deployment type can provide single-data center disaster recovery.
- Dual-zone Deployment: The master node and replica node are separately deployed in the specified primary zone and secondary zone of the same region to form a zone-disaster recovery architecture.
Primary Zone The zone in which you want to create the instance. Each region has multiple isolated locations that are known as zones. Each zone has its own independent power supply and network. To minimize the network latency between an ECS instance and an ApsaraDB for Redis instance that are deployed in the same zone, connect them over the internal network. Note If you set the Deployment Type parameter to Dual-zone Deployment, you must also set the Secondary Zone parameter to a zone that is different from the zone specified for the Primary Zone parameter. The primary zone and secondary zone together form a master-replica zone-disaster recovery architecture.Network Type The network type of the instance. This parameter can be set only to VPC. A VPC is an isolated network that provides higher security and better performance than the traditional classic network. Important Make sure that the ApsaraDB for Redis instance is connected to the same VPC as the ECS instances or ApsaraDB RDS instances that need to access the ApsaraDB for Redis instance. ECS instances located in other regions can access the ApsaraDB for Redis instance only over the Internet.VPC The VPC in which you want to create the instance. If you do not have a VPC, create one first. For more information, see Create and manage a VPC. vSwitch The vSwitch that you want to connect to the instance in the VPC. If no vSwitches are available in the VPC in the current zone, create a vSwitch. For more information, see Create and manage a vSwitch. Version The database engine version of the instance. We recommend that you select a relatively new database engine version that has more features. Architecture - Non-cluster: uses the master-replica or read/write splitting architecture. For more information, see Standard master-replica instances and Read/write splitting instances. Specifies whether to enable Read/Write Splitting.
- If you disable Read/Write Splitting, the instance uses the standard master-replica architecture.
- If you enable Read/Write Splitting, the instance uses the read/write splitting architecture. In this case, you must specify the Replicas parameter. Valid values: 2 to 6. A value in this range includes a master node. Up to five read replicas are supported.
- Cluster: uses the sharded cluster architecture. For more information, see Cluster master-replica instances. If you select Cluster, you must perform the following operations:
- Set Connection Mode to one of the following values:
- Proxy: uses proxy nodes to enable architecture changes, route commands, balance loads, and perform failovers. The connection mode can aggregate connections and enhance read performance. In addition, this mode is easy to use and simplifies your business system. For more information, see Features of proxy nodes.
- Direct Connection: allows you to directly connect to the instance in the same manner as you connect to open source Redis.
Important After an instance is created, the connection mode cannot be changed, and the proxy and direct connection modes cannot be enabled at the same time. Proceed with caution. - Specify Shards. The instance performance increases with the number of shards. You can calculate the instance capacity with the following formula: Instance capacity = Number of shards × Shard specifications. An instance can contain 2 to 64 shards when it is created. To increase the number, you can add shards after you create the instance. For more information, see Adjust the number of shards for an ApsaraDB for Redis instance with cloud disks.
Note Instances of specific editions or engine versions do not support the cluster architecture or the proxy mode. The parameters displayed in the ApsaraDB for Redis console prevail. - Set Connection Mode to one of the following values:
Shard Specifications The specifications of the instance. A standard instance contains only a single shard. Each option contains a group of configurations, such as the memory capacity, maximum number of concurrent connections, and maximum bandwidth. For more information, see Community Edition instances that use cloud disks. Note Database metadata is generated when an instance is created. The size of the metadata on each shard of a cluster instance ranges from 30 MB to 50 MB. The total size of the metadata in a cluster instance equals the total size of metadata on all shards.Replicas If you enable Read/Write Splitting, the Replicas parameter can be specified. Otherwise, this parameter is automatically set to 2. Each shard has a master node and a replica node to ensure HA.
Set Password - The time when you want to set the password. Later: You want to set the password after the instance is created. For more information, see Change or reset the password.
- Now: You want to set the password immediately.
- The password must be 8 to 32 characters in length.
- The password must contain at least three of the following character types: uppercase letters, lowercase letters, digits, and specific special characters.
- These special characters include
! @ # $ % ^ & * ( ) _ + - =
Instance Name The name of the instance, which is used to identify and manage the instance. Note The name must be 2 to 80 characters in length and must start with a letter. It cannot contain spaces or specific special characters. These special characters include @ / : = " < > { [ ] }Validity Period The subscription duration of the instance. - Click Buy Now.
- On the Confirm Order page, read the ApsaraDB for Redis (Redis) Agreement of Service, select I have read and agree to ApsaraDB for Redis (Redis) Agreement of Service, and then follow the instructions to pay for the instance. After your payment is complete, wait for 1 to 5 minutes. To view the created instance, you can select the region where the instance resides on the Instances page of the ApsaraDB for Redis console.
FAQ
- Q: How long does it take to create an instance?
A: The amount of time that is required to create an instance depends on the number of shards in the instance. A larger number of shards requires more resources. As a result, it takes longer to create the instance. For example, it can take 2 to 3 minutes to create a standard master-replica instance, 10 to 15 minutes to create a 128-shard cluster master-replica instance, and 20 to 40 minutes to create a 256-shard cluster master-replica instance.
Note- A standard instance is regarded as a single-shard instance.
- The master node of a read/write splitting instance is regarded as a shard that processes both read and write requests. Each read replica of a read/write splitting instance is regarded as a shard that processes only read requests.
- Q: Why am I unable to find the created instance?
A: The following table describes the possible causes and solutions.
Possible cause Solution The region that you selected in the ApsaraDB for Redis console is not the region in which the instance is deployed. Log on to the ApsaraDB for Redis console and select the region in which the instance is deployed. The instance list in the ApsaraDB for Redis console is not updated or is updated before the instance is created. Wait a few minutes and then update the instance list to check whether the instance is displayed in the list. - Q: Why am I refunded for an instance that I just created?
A: The system may fail to create the instance due to insufficient resources. In this case, your payment is refunded. You can check your refund on the Orders page. After you confirm that the payment is refunded, you can try to create an instance in another zone.
- Q: Why am I unable to create a standalone ApsaraDB for Redis instance?
A: Standalone instances were phrased out as of December 19, 2019. For more information, see Deprecated standalone instances.
Related API operations
Operation | Description |
---|---|
CreateInstance | Creates an ApsaraDB for Redis instance. |
CreateTairInstance | Creates a Tair cloud disk-based instance. |