Three: Common problems bgrewriteaof background process rewrite Aofbgsave background save Rdb Snapshot save Rdb snapshot Lastsave Last save time slaveof master-host Port,set the current instance to master slave flushall empty All library keys flushdb Clear all keys of the current library showdown [Save/Nosave] Note: If you accidentally run the Flushall, shutdown Nosave immediately,shut down the server and edit the aof file manually, remove the "Flushall" related rows from the file, and then turn on the server to import back the original data.if, after the Flushall, the system happens bgrewriteaof, then the AOF is emptied, the data is lost.Slowlog Show slow query note: How slow is slow?Answer: by slowlog-Log-slower-than 10000, to designate,number of slow queries stored by the server (in microseconds)?Answer: by slowlog-Max-len 128,to do the restricted Info [Replication/cpu/memory.] View information for Redis server config Get Configuration item config set configuration item value (Special option, it is not allowed to be set with this command, such as slave-of,need to be set with a separate slaveof command) Parameters to be aware of when Redis operations1:Memory#Memoryused_memory: 859192spatial Used_memory_rss of data structure: 7634944Real Space Mem_fragmentation_ratio: 8.89 the ratio of the top 2, 1.N is good, if this value is too large, the Redis memory fragmentation is serious, you can export and import again. 2:master-slave replication#Replicationrole:Slavemaster_host: 192.168.1.128Master_port: 6379Master_link_status: up3:Persistence of#PersistenceRdb_changes_since_last_save: 0Rdb_last_save_time: 1375224063 4:Fork Time#Statuslatest_fork_usec: 936 The last time an Rdb snapshot was exported,persistence takes a microsecond of attention: If an instance has 10G content, the export takes 2 minutes,write 10,000 times per minute, resulting in an ongoing RDB export, where the disk is in a high IO state. 5:Slow log config get/set slowlog-Log-slower-Thanconfig Get/set slowlog-Max-Lenslowlog get N Get slow log run time change master-Slave Modifying a Slave (set to a) to new master1) command that the service does not make the slave command for other Redis services:slaveof no One2) modify its readonly to Yes other slave and point to new master A1) command the service for the Slave command format of new master a slaveof IP port
aof Recovery of Redis and transfer between RDB servers