用户工具

站点工具


linux:redis

差别

这里会显示出您选择的修订版和当前版本之间的差别。

到此差别页面的链接

两侧同时换到之前的修订记录前一修订版
后一修订版
前一修订版
linux:redis [2017/12/11 15:57] – Add usage section memorylinux:redis [2023/12/03 10:24] (当前版本) – 外部编辑 127.0.0.1
行 51: 行 51:
  
   info replication   info replication
 +
 +删除根据key的前缀删除
 +
 +  EVAL "return redis.call('del', unpack(redis.call('keys', ARGV[1])))" 0 prefix:*
 +
 +==== Export && Import ====
 +
 +Export redis data on ''server1'' and import it on ''server2''.
 +
 +On server1:
 +
 +<code bash>
 +# make a snapshot
 +redis-cli 'save'
 +scp /var/lib/redis/dump.rds server2:/tmp/dump.rds
 +</code>
 +
 +On server2:
 +
 +<code bash>
 +# Stop redis
 +systemctl stop redis
 +chown redis:redis /tmp/dump.rds
 +cp /tmp/dump.rds /var/lib/redis/dump.rds
 +# make sure /etc/redis.conf `appendonly no`
 +systemctl start redis
 +# finish
 +</code>
  
 ===== Reference ===== ===== Reference =====
行 56: 行 84:
   * [[https://redis.io/topics/sentinel|Redis Sentinel Documentation]]   * [[https://redis.io/topics/sentinel|Redis Sentinel Documentation]]
   * [[https://redis.io/topics/security|Redis Security]]   * [[https://redis.io/topics/security|Redis Security]]
 +  * [[https://gnuhpc.gitbooks.io/redis-all-about|Redis开发运维实践指南]]
linux/redis.1512979076.txt.gz · 最后更改: 2023/12/03 10:24 (外部编辑)