Run the command in redis-cli to check whether the command takes effect.
The following describes two scenarios:
The SET command is used to set the string value. If the value is not changed, run the following commands in redis-cli to access the instance:
Set the timeout to 10 seconds and run the TTL command to view the remaining time. As shown in the following example, the remaining time is 7 seconds.
Redis clients (including redis-cli, Jedis clients, and Python clients) communicate with Redis server using a binary protocol.
If Redis commands are run properly in redis-cli, the problem may lie in the service code. In this case, create logs in the code for further analysis.