telnetto locate where the error occurred (in TencentDB for Redis or your business).
telnet in the command line tool to narrow down the cause of the error:
[root@VM-4-10-centos ~]# telnet 10.x.x.34 6379 Trying 10.x.x.34... Connected to 10.x.x.34. Escape character is '^]'.
As shown above, if the result indicates that the connection is successful, the TencentDB for Redis instance runs normally. Please troubleshoot your business:
To connect over private network, the CVM and TencentDB instances must be under the same account and in the same VPC in the same region, or both in the classic network.
The CVM instance cannot connect to the TencentDB for Redis instance if their security groups are incorrect.
Incorrect CVM security group configuration
To use the CVM instance to access the Redis instance, you need to configure an outbound rule in the security group of the CVM instance. If the target of the outbound rule isn't "0.0.0.0/0" and the protocol port isn't "ALL", the IP and port of the Redis instance should be added to the rule.
Incorrect Redis security group configuration
To use the CVM instance to access the Redis instance, you need to configure an inbound rule in the security group of the Redis instance. If the source of the inbound rule isn't "0.0.0.0/0" and the protocol port isn't "ALL", the IP and port of the CVM instance should be added to the rule.
- The Redis instance uses private network port 6379 by default and supports customizing its port. If the default port is changed, the new port should be opened in the inbound rule of the Redis security group.
- If the default port 6379 of the Redis instance is used, it should be opened in the inbound rule of the Redis security group.
info command. If the following information is displayed, the password of the TencentDB for Redis instance is correct.
[root@SNG-Qcloud /data/home/rickyu]# redis-cli -h 10.x.x.34 -p 6379 -a password 10.x.x.2:6379> info cpu # CPU used_cpu_sys:1623.176000 used_cpu_user:4649.572000 used_cpu_sys_children:0.000000 used_cpu_user_children:0.000000
NOAUTH Authentication required. is displayed, the password is incorrect.
10.0.4.31:6379> info memory NOAUTH Authentication required. 10.0.4.31:6379>
Log in to the TencentDB for Redis console and click an instance ID in the instance list to enter the instance details page, where you can reset the password. For more information, see Managing Accounts.
You can modify the maximum number of proxy connections in the console. To modify the maximum number of Redis connections, please submit a ticket.
If you receive the following error message:
"-READONLY You can't write against a read only slave.\r\n"
Log in to the TencentDB for Redis console, click an instance ID in the instance list, and select the System Monitoring tab to view memory utilization.
If memory is used up, writes will fail. Please expand capacity immediately or adopt the
volatile-lru eviction policy.
Instance data may be lost if the
allkeys-lrueviction policy is adopted. Please assess the impact before doing so.
TencentDB for Redis now allows you to manually enable public network access in the console, so that instances can be accessed over public network. For detailed directions, see Configuring the Public Network Address.
If you find that the connections are exceptional, there are a large number of access errors and slow queries, and you receive event alarms from CM at a certain time point, an exceptional event has occurred. In this case, contact us for assistance.
Configure event alarms in the Cloud Monitor console:
To enable connection between CVM and TencentDB for Redis instances over private network, they must be under the same account and in the same VPC in the same region, or both in the classic network.
- If the instance lists both show Classic Network or VPC, it means that the networks of the CVM and TencentDB for Redis instances are of the same type.
- If the instance lists both show the same VPC (in the same region), it means that the CVM and TencentDB for Redis instances are in the same VPC.