If your TencentDB for Redis connection fails, follow these steps to diagnose and resolve the issue:
Check Network Connectivity:
Ensure your client machine has a stable network connection to the TencentDB for Redis instance. Verify if you can ping the instance's endpoint or telnet to the Redis port (default: 6379).
Example:
telnet <Redis-instance-endpoint> 6379
If the connection fails, check firewall rules or VPC configurations.
Verify Instance Status:
Log in to the Tencent Cloud console and confirm that your Redis instance is running. If the instance is stopped or isolated, restart it.
Check Authentication:
Ensure you're using the correct password (if authentication is enabled). A wrong password will cause connection failures.
Example:
When connecting via redis-cli:
redis-cli -h <Redis-instance-endpoint> -a <your-password>
Review Whitelist Settings:
TencentDB for Redis uses a whitelist to control access. If your IP is not added to the whitelist, connections will be blocked. Add your client IP to the whitelist in the console.
Check Connection Limits:
If the instance reaches its maximum connection limit, new connections will fail. Monitor active connections and scale up if needed.
Example: Use the INFO clients command in redis-cli to check current connections:
redis-cli -h <Redis-instance-endpoint> -a <your-password> INFO clients
Use Tencent Cloud Tools:
For troubleshooting, use Tencent Cloud's Database Audit or Redis Monitoring tools to identify connection issues.
Contact Support:
If the issue persists, contact Tencent Cloud support with logs and error details for further assistance.
For managed Redis services, TencentDB for Redis provides high availability and auto-failover. If you need scaling or performance optimization, consider upgrading to a higher-tier instance or enabling read replicas.