How Do I Clear Redis Data?
Exercise caution when clearing data.
- Redis 3.0
Data of a DCS Redis 3.0 instance cannot be cleared on the console, and can only be cleared by the FLUSHDB or FLUSHALL command in redis-cli.
Run the FLUSHALL command to clear all the data in the instance.
Run the FLUSHDB command to clear the data in the currently selected database.
- Redis 4.0 or later
To clear data of a DCS Redis 4.0 or later instance, you can run the FLUSHDB or FLUSHALL command in redis-cli, use the data clearing function on the DCS console, or run the FLUSHDB command on Web CLI.
To clear data of a Redis Cluster instance, run the FLUSHDB or FLUSHALL command on every shard of the instance. Otherwise, data may not be completely cleared.
- Currently, the data clearing function and Web CLI access on the console are supported only by DCS Redis 4.0 or later instances.
- When you run the FLUSHDB command on Web CLI, only one shard is cleared at a time. If there are multiple shards, connect to the master node of each shard and run the FLUSHDB command separately.
- Redis Cluster data cannot be cleared by using Web CLI.
Redis Commands FAQs
- Does DCS for Redis Support Command Audits?
- How Do I Clear Redis Data?
- How Do I Find Specified Keys and Traverse All Keys?
- Why Do I Fail to Execute Some Redis Commands?
- Why is "permission denied" Returned When I Run the Keys Command in Web CLI?
- How Do I Rename High-Risk Commands?
- Does DCS for Redis Support Pipelining?
- Does DCS for Redis Support the INCR and EXPIRE Commands?
- Why Does a Redis Command Fail to Take Effect?
- Is There a Time Limit on Executing Redis Commands? What Will Happen If a Command Times Out?
- Can I Configure Redis Keys to Be Case-Insensitive?
- Can I View the Most Frequently Used Redis Commands?
- Common Web CLI Errors
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbotmore