Home  >  Q&A  >  body text

缓存 - redis异常退出重启后是怎么跟MYSQL同步的?

假设如下情况
Redis将内存中的数据写入磁盘后不久 发生异常崩溃了 在崩溃前Redis对内存中的数据又作了修改并同步到了Mysql
此时当Redis再次运行并从磁盘读取上一次的备份后 Redis的内存数据与Mysql中的数据是不一致的
Redis自身就带有纠错功能 还是需要在Redis运行前人工同步一次? 这种数据不一致的情况是怎么解决的?
一点小疑惑 希望有人能来解答一下

PHP中文网PHP中文网2733 days ago655

reply all(1)I'll reply

  • 習慣沉默

    習慣沉默2017-04-27 09:05:09

    Redis works as a master-slavor cluster, and the sentinel monitors the master. If it fails, it will automatically replicate and switch between master and slave. To synchronize heterogeneous mysql, you need to write a script to run it. . .

    reply
    0
  • Cancelreply