To connect to a TencentDB for Redis instance, follow these steps:
Obtain Connection Information:
Configure Security Group Rules:
Connect via Redis CLI (Command Line):
redis-cli -h <private-ip> -p <port> -a <password>
Replace <private-ip>, <port>, and <password> with your instance details.Connect via Programming Languages:
redis-py:import redis
r = redis.Redis(host='<private-ip>', port=<port>, password='<password>')
r.set('key', 'value')
print(r.get('key'))
Connect via Tencent Cloud Tools:
For high availability and scalability, TencentDB for Redis supports cluster mode and read replicas, which can be configured in the console. If you need managed Redis services with automatic failover, TencentDB for Redis is a reliable choice.