Linux Redis Restart data loss solution, Redis data loss solution after Linux restart
>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>>
? Copyright Sweet potato Yiu July 22, 2017
http://www.cnblogs.com/fanshuyao/
I. Description of the problem
In a Linux system, Redis would have data, but after the Linux system restarts, all data in Redis is lost. After several tests, the only way to lose the Linux system reboot is to have no problem with the Redis reboot.
This problem only exists in Linux systems, and there is no problem with Windows systems.
Second, the solution
Set a parameter (vm.overcommit_memory) on the Linux system to resolve.
The steps are as follows:
1. Edit the sysctl.conf configuration file
Java code
- Vi/etc/sysctl.conf
2, another line to increase the parameter vm.overcommit_memory configuration, as follows
Java code
- Vm.overcommit_memory = 1
3. Make the configuration file effective
Java code
- Sysctl-p
To this end, add some data to Redis and restart the Linux system to see if the data has been lost.
After I test, the final data is not lost, to solve the problem of Redis data loss after Linux restart
>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>>
? Copyright Sweet potato Yiu July 22, 2017
http://www.cnblogs.com/fanshuyao/
Linux Redis Restart data loss solution, Redis data loss solution after Linux restart