Redis命令行工具
封装了下redis的scan命令和delete命令,可以安全的使用scan命令查找未知类型的正则匹配的key和批量删除key。
……每一行错误,都值得记录。
封装了下redis的scan命令和delete命令,可以安全的使用scan命令查找未知类型的正则匹配的key和批量删除key。
……腾讯云redis使用iptables开启转发(云redis本身 不支持设置外网地址)
……
|
|
protected-mode yes
port 6379
tcp-backlog 511
timeout 0
tcp-keepalive 300
daemonize yes
supervised no
pidfile /var/run/redis_6379.pid
loglevel notice
logfile "/var/log/redis.log"
databases 16
always-show-logo yes
save 900 1
save 300 10
save 60 10000
# 只要满足以下三个条件中的任意一个,BGSAVE命令就会被执行:
# 服务器在900秒之内,对数据库进行了至少1次修改
# 服务器在300秒之内,对数据库进行了至少10次修改
# 服务器在60秒之内,对数据库进行了至少10000次修改
stop-writes-on-bgsave-error yes
rdbcompression yes
rdbchecksum yes
dbfilename dump.rdb
dir ./
slave-serve-stale-data yes
slave-read-only yes
repl-diskless-sync no
repl-diskless-sync-delay 5
repl-disable-tcp-nodelay no
slave-priority 100
lazyfree-lazy-eviction no
lazyfree-lazy-expire no
lazyfree-lazy-server-del no
slave-lazy-flush no
appendonly no
appendfilename "appendonly.aof"
appendfsync everysec
no-appendfsync-on-rewrite no
auto-aof-rewrite-percentage 100
auto-aof-rewrite-min-size 64mb
aof-load-truncated yes
aof-use-rdb-preamble no
lua-time-limit 5000
slowlog-log-slower-than 10000
单位是微妙(1秒=1000毫秒=1000000微秒),默认值10000
slowlog-max-len 128
latency-monitor-threshold 0
notify-keyspace-events ""
hash-max-ziplist-entries 512
hash-max-ziplist-value 64
list-max-ziplist-size -2
list-compress-depth 0
set-max-intset-entries 512
zset-max-ziplist-entries 128
zset-max-ziplist-value 64
hll-sparse-max-bytes 3000
activerehashing yes
client-output-buffer-limit normal 0 0 0
client-output-buffer-limit slave 256mb 64mb 60
client-output-buffer-limit pubsub 32mb 8mb 60
hz 10
aof-rewrite-incremental-fsync yes
masterauth "123","ALL"
# 针对master对应的slave节点设置的,在slave节点数据同步的时候用到
requirepass "1234","ALL"
# 本节点(实例)登录权限的限制
……
一、 简单介绍 Redis是一个开源(BSD授权)的基于内存键值对存储数据库,也常用来做缓存和消息中介。它支持字符串、哈希、列表、集合等多种数据结构。Redis内置了复制、Lua脚本、事务和磁盘持久性,并通过哨兵(Redis Sentinel)和集群(Redis Cluster)自动分区提供高可用性。
……