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 SET
command to limit Redis memory usage to 200MB.
Requirements
- Connect to the Redis server using the
redis-cli
command.
- Use the
CONFIG SET
command to set the maxmemory
parameter to 200mb
.
- After executing the
CONFIG SET
command, exit the redis-cli
using the exit
command.
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-cli
command to interact with the Redis server.
- The
CONFIG SET
command modifies Redis configuration parameters.
- Remember to include the unit
mb
when setting the maxmemory
parameter.
- Remember to exit the
redis-cli
after setting the parameter.