Introduction
In this challenge, you'll configure the Redis maxmemory limit to prevent data loss due to memory exhaustion. As a system administrator, your task is to connect to the Redis server using redis-cli and use the CONFIG SET command to limit Redis memory usage to 200MB.
The challenge requires you to set the maxmemory parameter to 200mb within the redis-cli environment and then exit.
Configure Redis Maxmemory Limit
Your Redis server is nearing its memory capacity, risking data loss. As the system administrator, configure maxmemory to 200MB to prevent crashes and ensure data integrity.
Tasks
- Use the
CONFIG SETcommand to limit Redis memory usage to 200MB.
Requirements
- Connect to the Redis server using the
redis-clicommand. - Use the
CONFIG SETcommand to set themaxmemoryparameter to200mb. - After executing the
CONFIG SETcommand, exit theredis-cliusing theexitcommand.
Examples
After successfully setting the maxmemory parameter, you can check the configuration using the CONFIG GET command.
127.0.0.1:6379> CONFIG GET maxmemory
1) "maxmemory"
2) "200mb"
127.0.0.1:6379> exit
This indicates that the maxmemory has been successfully set to 200MB.
Hints
- Use the
redis-clicommand to interact with the Redis server. - The
CONFIG SETcommand modifies Redis configuration parameters. - Remember to include the unit
mbwhen setting themaxmemoryparameter. - Remember to exit the
redis-cliafter setting the parameter.
Summary
In this challenge, the task is to configure the Redis maxmemory setting to 200MB to prevent data loss due to the server nearing its memory capacity. This involves connecting to the Redis server using redis-cli and executing the CONFIG SET maxmemory 200mb command.
The key learning points are using redis-cli to interact with the Redis server, understanding the CONFIG SET command for modifying Redis configuration parameters, and remembering to include the unit mb when setting the maxmemory parameter.


