redis operation and maintenance related problems
1 architecture articles
redis + Redis-Sentinel 2.6 Sentinel Model
redis + cluster 3.2X cluster model
2 Disable command
FLUSHALL "" // clean up all of the data
FLUSHDB "" // clean up the current database
CONFIG "" // conducted redis command, consider renaming
keys "" // fuzzy matching
3 How to find big key
1 pip3 install rdbtools
2 rdb -c memory dump.rdb > result.csv
3 size_in_bytes (memory-byte) encoding (data type)
4 redis data migration
工具 redisdump
5 redis commonly used commands
1 Close redis-cli shutdown
2 Background Save key
SAVE will block the main line
BGSAVE without blocking the main line
3 Check whether there are key EXISTS key
4 Check the specified kv GET key Hget key
5 text batch operations
yum -y install unix2dos
unix2dos d1.txt
cat d1.txt | redis-cli -p 6379 --pipe
6 Backup
1 Main library does not open rdb and aof aof open from library
7 redis operation and maintenance issues related summary
1 do not frequent requests big key
2 Do not perform some very dangerous for redis command, the specific command in section 2
3 stand-alone multi-instance, perform bgsave pay attention turns to perform, to prevent OOM
4 Do not add redis from the start, which could lead to empty rdb away from the main coverage
When 5 continues to rise as concurrency, to split traffic as soon as possible, to prevent redis Caton happens
Redis-related problems due to version 6 due BUG
7 Do not mix redis and other types of databases deployed on a single server, to prevent the related impact
8 Get recent slow query by slowlog get
8 supplement
1 rdb file is copied thermal
2 redis each node in the cluster should have from the node, so in a hung node, will take over from, there are at least three cluster nodes