|NO.Z.00019|——————————|BigDataEnd|——|Hadoop&Redis.V01|——|Redis.v01|持久化机制|
一、Redis持久化
### --- 为什么要持久化
~~~     Redis是内存数据库,宕机后数据会消失。
~~~     Redis重启后快速恢复数据,要提供持久化机制
~~~     Redis持久化是为了快速的恢复数据而不是为了存储数据### --- Redis有两种持久化方式:RDB和AOF
~~~     注意:Redis持久化不保证数据的完整性。
~~~     当Redis用作DB时,DB数据要完整,
~~~     所以一定要有一个完整的数据源(文件、mysql)在系统启动时,
~~~     从这个完整的数据源中将数据load到Redis中数据量较小,不易改变,比如:字典库(xml、Table)### --- 通过info命令可以查看关于持久化的信息
127.0.0.1:6379> info
# Persistence
loading:0
rdb_changes_since_last_save:0
rdb_bgsave_in_progress:0
rdb_last_save_time:1631786668
rdb_last_bgsave_status:ok
rdb_last_bgsave_time_sec:0
rdb_current_bgsave_time_sec:-1
rdb_last_cow_size:8744960
aof_enabled:0
aof_rewrite_in_progress:0
aof_rewrite_scheduled:0
aof_last_rewrite_time_sec:-1
aof_current_rewrite_time_sec:-1
aof_last_bgrewrite_status:ok
aof_last_write_status:ok
aof_last_cow_size:0Walter Savage Landor:strove with none,for none was worth my strife.Nature I loved and, next to Nature, Art:I warm'd both hands before the fire of life.It sinks, and I am ready to depart
                                                                                                                                                   ——W.S.Landor
 
                    
                 
                
            
         浙公网安备 33010602011771号
浙公网安备 33010602011771号