TencentDB for Redis

TencentDB for Redis
Getting Started
Product Documentation©2013-2022 Tencent Cloud. All rights reserved.

Page 1 of 23

TencentDB for Redis

Copyright Notice©2013-2024 Tencent Cloud. All rights reserved.
Copyright in this document is exclusively owned by Tencent Cloud. You must not reproduce, modify, copy or distributein any way, in whole or in part, the contents of this document without Tencent Cloud's the prior written consent.
Trademark Notice

All trademarks associated with Tencent Cloud and its services are owned by Tencent Cloud Computing (Beijing)
Company Limited and its affiliated companies. Trademarks of third parties referred to in this document are owned bytheir respective proprietors.
Service Statement
This document is intended to provide users with general information about Tencent Cloud's products and services
only and does not form part of Tencent Cloud's terms and conditions. Tencent Cloud's products or services are
subject to change. Specific products and services and the standards applicable to them are exclusively provided for in
Tencent Cloud's applicable terms and conditions.

©2013-2022 Tencent Cloud. All rights reserved.

Page 2 of 23

TencentDB for Redis

Contents
Getting Started
Creating TencentDB for Redis InstanceConnecting to TencentDB for Redis Instance©2013-2022 Tencent Cloud. All rights reserved.

Page 3 of 23

TencentDB for Redis

Getting Started
Creating TencentDB for Redis Instance：

Last updated 2024-04-26 12:38:43

Overview
This document describes how to purchase and configure a TencentDB for Redis instance.

Prerequisites
You have registered a Tencent Cloud account and completed identity verification.
Click here to register a Tencent Cloud accountClick here to complete identity verification.
You have determined a region and AZ for the instance. For more information, see Regions and AZs.
You have determined the specification and performance requirements of the instance. For more information, see
Memory Edition (Standard Architecture) and Performance.
You have determined a VPC and security group for the instance. For more information, see Virtual Private Cloud andConfiguring Security Groups for TencentDB.
To deploy the instance across multiple AZs in the same region, learn more about the architecture of multi-AZ
deployment first.
To support read/write separation, learn more about how it is implemented first.
You have checked out the billing details of the instance. For more information, see Billing Overview. Database fees forone hour will be frozen when you create a pay-as-you-go database. Make sure that your account balance is sufficient
before making a purchase.

Directions
1. Log in to the TencentDB for Redis purchase page with your Tencent Cloud account.
2. Configure the instance as needed based on the parameter descriptions below:©2013-2022 Tencent Cloud. All rights reserved.

Page 4 of 23

TencentDB for Redis

Parameter

Required

Description

Billing Mode

Yes

Pay-as-you-go is supported. For more information, see Billing Overview.
Select a region where your instance resides. You should select a region closest
to you to reduce access latency.
Note that the region cannot be changed after the instance is successfully

RegionYescreated.
We recommend that you select the same region as the CVM instance for private
network communication.
Tencent Cloud products in different regions cannot communicate with eachother over the private network. For example, CVM instances in Guangzhou
region cannot access TencentDB for Redis instances in Shanghai region overthe private network. Select a region with caution, as it cannot be changed after
purchase. If you need cross-region communication over the private network, see
Creating Intra-account Peering Connection.

©2013-2022 Tencent Cloud. All rights reserved.

Page 5 of 23

TencentDB for Redis

Instance
EditionCompatible
VersionYes

Yes

Select Memory Edition, a high-performance edition based on the open-source
Redis engine. The CKV Edition is unavailable currently.
It is a high-performance edition based on open-source Redis and compatible
with Redis 6.2, 5.0, 4.0, and 2.8.
v2.8 is unavailable currently, and v4.0 or later is recommended. To purchasev2.8, submit a ticket.

Architecture

Yes

Select a product deployment architecture. For more information, see Memory
Edition (Standard Architecture) and Memory Edition (Cluster Architecture).
v4.0 or later supports the standard architecture and cluster architecture.
v2.8 only supports the standard architecture.

MemoryCapacity

Replica
Quantity

Shard
Quantity
Shard
Capacity
Specs
Preview

Yes

Configure the required memory size (256 MB–64 GB) if you select Standard
Architecture for Architecture.
Select the number of database replicas. Multiple replicas provide master-replicahigh availability, enhancing the data security. Replicas can also be used to

Yes

Yes

Yes

-

enhance the read-only performance.
The replica quantity may vary by region or edition as configured in the console
by default.
Set the number of shards as needed if you select Cluster Architecture forArchitecture. The more the shards, the larger the cluster storage capacity.
Set the capacity of each shard if you select Cluster Architecture forArchitecture.
Preview the selected specification and the supported maximum number ofconnections and maximum network throughput to verify whether they meet yourexpectations.
Specify whether to enable read/write separation.

Read-Only
ReplicaNo

After read/write separation is enabled, write operations are routed to the master
node, and read operations are routed to the replica node. The data read fromthe replica node will be delayed after the master node.
If you don't enable read/write separation upon purchase, you can also enable itlater as needed. For more information, see Read/Write Separation.

Network

Yes

Currently, only VPC is supported.

AZ

Yes

Choose whether to enable multi-AZ deployment. Both single-AZ deployment andmulti-AZ deployment are supported. Multi-AZ deployed instances have higher
availability and better disaster recovery capability than single-AZ deployed
instances. For more information, see Multi-AZ Deployment.
If the master node is deployed in a single AZ, specify an AZ for it.

©2013-2022 Tencent Cloud. All rights reserved.

Page 6 of 23

TencentDB for Redis

If the master node is deployed in multiple AZs, after selecting the master AZ,
you need to specify an AZ for a replica in the drop-down list of replica x, where x
is the replica number, such as replica 1 and replica 2.

IPv4
Network

Port

Yes

Yes

Select the VPC and subnet. We recommend that you select the same VPC in thesame region as the CVM instance to be connected to.
VPCs are region-specific (e.g., Guangzhou), while subnets are AZ-specific (e.g.,
Guangzhou Zone 1). One VPC can be divided into one or multiple subnets,
which are interconnected over the private network by default. Different VPCs are
isolated over the private network by default, no matter whether they are in thesame or different regions.
You can switch the VPC after instance purchase as instructed in Configuring
Network. You can also click Create VPCs and Create Subnets to create thedesired network environment as instructed in Creating VPC.
Customize the port number, which is 6379 by default and ranges from 1024 to65535. You can modify it after the purchase.
Select the parameter template associated with the instance.

Parameter
Template

Yes

The system automatically matches the appropriate default template based on
the selected compatible version and architecture to configure parameters for the
instance in batches.
If you want to create your own template, click Create Parameter Template.

Project

Yes

Assign the instance to a project in the drop-down list for easy management.
The default project is Default Project.
You can also click Create Project to enter the Project Management pageand customize the project name to manage your Tencent Cloud resources.

Tag

No

Add tags to your instance for easy classification and management. Click Add toselect tag keys and values.
Set security group rules to control the inbound traffic to your database.
Set security group rules to control the inbound traffic to your database. You canSecurity
Group

Alarm
PolicyYes

Yeseither select a security group from the Existing Security Groups drop-down
list or click Custom Security Groups to create one and set inbound rules.
For more information, see Configuring Security Group.
After selecting a security group from the drop-down list, click Preview Rules tolearn about the protocol rules and policies of this security group.
Choose an alarm policy for the monitoring metrics.
If you don't select an alarm policy, TencentDB for Redis provides a default alarm
policy, allowing you to view the default policies on the alarm management pageof Tencent Cloud Observability Platform.
Select a custom alarm policy. Pre-log in to the alarm management page ofTencent Cloud Observability Platform to configure the alarm policy. For specificoperations, see Creating Alarm Policy.

©2013-2022 Tencent Cloud. All rights reserved.

Page 7 of 23

TencentDB for Redis

Instance
Name
Setting
password

password

Yes

Supports Chinese, letters, and digits with a length less than 60, including
hyphens (-) and underscores (_).

Yes

Select the password authentication method, supporting the choice between
Password Authentication and Passwordless Authentication. The default is
password authentication.

No

When Setting Password is selected as Password Authentication, you must
set an access password for the instance. The password complexity
requirements are:
The character count must be [8,30].
It must include at least two of the following: lowercase letters, uppercase letters,
numbers, and special characters ()`~!@#$%^&*-+=_|{}[]:;<>,.?/ .
It cannot start with /.

Confirming
Password

No

Enter the instance access password again.

Purchase
QuantityYes

Pay-as-you-go purchases are limited to a maximum quantity of 30 pertransaction, with a purchase quantity range of [1,100] for each region.
Click Terms of Service to fully understand the use of Cloud Database Service

Terms ofServiceYes

content, service fees, usage rules, intellectual property, and other related
service terms.
Click Service Level Agreement to understand the agreement that must becomplied with when using TencentDB for Redis.
Check the box I have read and agree to the Terms of Service and Service
Level Agreement.

3. After verifying that the parameters are correctly configured, click Buy Now. After the purchase success message isdisplayed, click Go to Console. After the instance becomes Running in the status , you can use it normally.

Related Operations
Use a CVM instance to directly access the private network address of the TencentDB instance. For more information,
see Connecting to TencentDB for MongoDB Instance.

Related Operations
Changing instance specification©2013-2022 Tencent Cloud. All rights reserved.

Page 8 of 23

TencentDB for Redis

You can elastically adjust the specification of your TencentDB for Redis instance based on your actual businessneeds to optimize resource utilization and costs in real time. For detailed directions, see Changing InstanceSpecification.
Assigning instance to project
Assigned instances can be reassigned to other projects. For detailed directions, see Assigning Instances to Projects.
Editing instance tag
For instances with assigned tags, you can also edit tag keys and values again. For directions, see Editing InstanceTag.
Renaming instanceIf the current instance name is not easy to identify and manage, you can reset it by clicking

in the Instance ID/Name column in the Instance List.

Resetting instance access password
If you forgot or want to change the default account password, you can directly reset it. For detailed directions, see
Resetting Password.
Upgrading instance
TencentDB for Redis instances can be upgraded from an earlier version to a later version, with cross-version upgrade
supported. For detailed directions, see Upgrading Instance Version.
TencentDB for Redis instances can be upgraded from Standard Architecture to Cluster Architecture. For detailed
directions, see Upgrading Instance Architecture.
Payment overdue
After activating TencentDB for Redis, make sure that your account balance is sufficient. An insufficient balance may
cause overdue payments or even instance repossession. For more information, see Payment Overdue.

Related APIs
API Name©2013-2022 Tencent Cloud. All rights reserved.

Description

Page 9 of 23

TencentDB for Redis

CreateInstances

Creates a TencentDB for Redis instance

ModifyInstance

Modifies the information of an instance©2013-2022 Tencent Cloud. All rights reserved.

Page 10 of 23

TencentDB for Redis

Connecting to TencentDB for Redis Instance：

Last updated 2023-03-14 15:51:56

Overview
This document describes three methods for connecting to a running instance. Then, you can run Redis commands for
read, write, and query.
Connection via client: You can connect to a TencentDB instance at its automatically assigned private address from a
Windows or Linux CVM instance. This connection method utilizes the high-speed private network of Tencent Cloudand features low delay. Both instances should be under the same account and reside in the same VPC in the same
region or reside in the classic network.
Notes
CVM and TencentDB instances in different VPCs (under the same or different accounts in the same or different
regions) can be interconnected over the private network through Cloud Connect Network.
CVM and TencentDB instances in different VPCs can be connected through the public network address as instructedin Configuring Public Network Address.
Connection via DMC: You can use Tencent Cloud Database Management Center (DMC) to log in to your TencentDB
instance to access them, view their key metric information, and run Redis commands.
Connection via SDK: You can connect to a TencentDB for Redis instance by configuring its private IP, port, instanceID, and password in the SDK for the corresponding programming language. Then, you can manipulate it, get and set
its key, and do more.

Preparations
Prepare a TencentDB for Redis instance. For more information, see Creating TencentDB for Redis Instance.
Prepare a database account and password. For more information, see Managing Account. You can use the default
account or a custom account.
Configure security group rules for the CVM instance and the TencentDB for Redis instance. For more information, see
Configuring Security Group.
Obtain the Private IPv4 Address for database connection in the Network Info section on the Instance Details
page in the TencentDB for Redis console.

Connecting Using a Client Tool

©2013-2022 Tencent Cloud. All rights reserved.

Page 11 of 23

TencentDB for Redis

Notes:
Currently, Redis 6.2 does not support the RESP3 protocol.

Connecting from a Linux CVM instance
Step 1. Prepare the environment
1. Log in to the Linux CVM instance. For more information, see Customizing Linux CVM Configurations.
2. Taking a CVM instance on CentOS as an example, run the following command to install the Redis client.

yum install redis -y©2013-2022 Tencent Cloud. All rights reserved.

Page 12 of 23

TencentDB for Redis

If Complete! is displayed, the client is installed successfully.
Step 2. Connect to an instance
Passwordless authentication
If your instance is password-free, the connection command is as follows:

redis-cli -h IP address -p port
Here, the IP address and port are the Private IPv4 Address and Port obtained in the Network Info section on the
Instance Details page in the TencentDB for Redis console.

©2013-2022 Tencent Cloud. All rights reserved.

Page 13 of 23

TencentDB for Redis

Access with default accountThe default account refers to the account assigned by the system by default. When you purchase and create a
TencentDB for Redis instance, the password you set to access the instance is the database password corresponding
to the default account. To use the default account with a password to access the database, the following open-source
connection command is supported:©2013-2022 Tencent Cloud. All rights reserved.

Page 14 of 23

TencentDB for Redis

redis-cli -h IP address -p port -a password
Here, the IP address and port are the Private IPv4 Address and Port obtained in the Network Info section on the
Instance Details page in the TencentDB for Redis console. For example, if the password you set is abcd1234 ,the connection command should be as follows:©2013-2022 Tencent Cloud. All rights reserved.

Page 15 of 23

TencentDB for Redis

redis-cli -h IP address -p port -a abcd1234
Notes
To access instances purchased before January 2018, you need to replace the "password" with "instance
ID:password", for example, redis-cli -h IP address -p port -a crs-bkuza6i3:abcd1234 .
Access with custom accountIf you use a custom account as described in Managing Account when connecting, then the authentication method of
the custom account is account name@password , which acts as the password parameter for accessing
TencentDB for Redis:©2013-2022 Tencent Cloud. All rights reserved.

Page 16 of 23

TencentDB for Redis

redis-cli -h IP address -p port -a account name@password

Connecting from a Windows CVM instance
1. Configure and log in to the Windows CVM instance. For more information, see Customizing Windows CVM
Configurations.
2. In the Windows CVM instance, download the TencentDB for Redis client over the internet and install it.
3. Open the TencentDB for Redis client, configure the instance's private IP address, and click Test Connection toconnect to the instance.

©2013-2022 Tencent Cloud. All rights reserved.

Page 17 of 23

TencentDB for Redis

Parameter

Description

Name

The name of the connection to the database instance.

Address
Verification

Enter the private IPv4 address of the database instance, which can be obtained in the Network
Info section on the Instance Details page in the console.
Enter the password for database instance connection.

©2013-2022 Tencent Cloud. All rights reserved.

Page 18 of 23

TencentDB for Redis

4. Clickand enter a Redis command in the input box in the bottom-right corner to run it.

Connection via DMC©2013-2022 Tencent Cloud. All rights reserved.

Page 19 of 23

TencentDB for Redis

1. Log in to the TencentDB for Redis console.
2. Above the instance list, select the region.
3. In the instance list, find the target instance.
4. Click Log In in the Operation column.
5. You will be redirected to the login page of DMC. Enter the default account password of the target instance and click
Log In.

6. You can view the instance monitoring information on the Instance Info tab on the Database Management page.

©2013-2022 Tencent Cloud. All rights reserved.

Page 20 of 23

TencentDB for Redis

7. Click the Command Line tab and enter a Redis command in the input box at the bottom to run it:©2013-2022 Tencent Cloud. All rights reserved.

Page 21 of 23

TencentDB for Redis

8. If you are unfamiliar with Redis command parameters, you can select the slot range and database for storing key
values in the Object List section on the left of the page, click Create, select the key data type, click OK, edit the key
name in the Key Name input box, and click Add element and create key. Then, enter the corresponding key value
and click OK in the Add Element window. The system will run commands based on the set key and key value.

Connection via SDK©2013-2022 Tencent Cloud. All rights reserved.

Page 22 of 23

TencentDB for Redis

TencentDB for Redis can be accessed via SDKs for various programming languages, including PHP, Java, Node.js,
Python, C, Go, and .NET. For specific samples, see PHP Connection Sample. You can download an SDK client andthen connect to a TencentDB for Redis instance by configuring its private IP, port, instance ID, and password as
instructed in the sample code.

FAQs
For FAQs, see Connection and Login.

©2013-2022 Tencent Cloud. All rights reserved.

Page 23 of 23