Reasons and solutions for Redis startup failure

Redis, which has been running for nearly half a year, when I came to start the computer to run the program this morning, I found that I could not connect to redis. I thought to myself that I had set it to start automatically when it was turned on. I never asked about it before. Under redis, the following error is prompted


I searched the Internet for a long time and couldn't find a solution. Later, I remembered and checked the log file of redis.


It is found that the current version of redis cannot handle the RDB of version 8.

During operation, Redis maintains data in memory in the form of data structures. In order to make these data available after Redis restarts, Redis provides two persistence modes, RDB and AOF, respectively.
When Redis is running, the RDB program saves the current in-memory database snapshot to the disk file. When Redis restarts, the RDB program can restore the database state by loading the RDB file.

The core of RDB function is rdbSave and rdbLoad two functions, the former is used to generate RDB file to disk, while the latter is used to reload the data in RDB file into memory.

So the final solution is to delete the RDB file /var/lib/redis/dump.rdb, and finally restart redis with /etc/init.d/redis-server start

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325895288&siteId=291194637