redis master slave

下载:

http://download.redis.io/releases/redis-5.0.4.tar.gz
http://download.redis.io/releases/redis-4.0.9.tar.gz

 

bind 0.0.0.0   # 修改
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 "redis.log"   # 修改
databases 16
always-show-logo yes
save 900 1
save 300 10
save 60 10000
stop-writes-on-bgsave-error yes
rdbcompression yes
rdbchecksum yes
dbfilename dump.rdb
dir ./   # 修改
masterauth  L3LQho9kCkSH0iCYUmVI
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
requirepass test123456
lazyfree-lazy-eviction no
lazyfree-lazy-expire no
lazyfree-lazy-server-del no
slave-lazy-flush no
appendonly yes   # 修改
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
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

 


 

# redis 迁移

info

slaveof host port

slave no one

info


# log

29770:M 05 May 20:17:23.327 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
29770:M 05 May 20:17:23.328 # Server initialized
29770:M 05 May 20:17:23.328 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
29770:M 05 May 20:17:23.328 * Ready to accept connections
29770:S 05 May 20:18:02.600 * Before turning into a slave, using my master parameters to synthesize a cached master: I may be able to synchronize with the new master with just a partial transfer.
29770:S 05 May 20:18:02.600 * SLAVE OF 192.168.5.222:6379 enabled (user request from 'id=3 addr=127.0.0.1:36602 fd=8 name= age=30 idle=0 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=32768 obl=0 oll=0 omem=0 events=r cmd=slaveof')
29770:S 05 May 20:18:03.432 * Connecting to MASTER 192.168.5.222:6379
29770:S 05 May 20:18:03.432 * MASTER <-> SLAVE sync started
29770:S 05 May 20:18:03.433 * Non blocking connect for SYNC fired the event.
29770:S 05 May 20:18:03.434 * Master replied to PING, replication can continue...
29770:S 05 May 20:18:03.435 * Trying a partial resynchronization (request cb6dcce49accd1ff897e1a618ca0b9d9bac4a7cd:1).
29770:S 05 May 20:18:03.443 * Full resync from master: af375a5e7ff14b0b6ab499f5be543cf9155fd6be:698
29770:S 05 May 20:18:03.443 * Discarding previously cached master state.
29770:S 05 May 20:18:03.583 * MASTER <-> SLAVE sync: receiving 269612 bytes from master
29770:S 05 May 20:18:03.586 * MASTER <-> SLAVE sync: Flushing old data
29770:S 05 May 20:18:03.587 * MASTER <-> SLAVE sync: Loading DB in memory
29770:S 05 May 20:18:03.590 * MASTER <-> SLAVE sync: Finished with success
29770:S 05 May 20:18:03.591 * Background append only file rewriting started by pid 30125
29770:S 05 May 20:18:03.710 * AOF rewrite child asks to stop sending diffs.
30125:C 05 May 20:18:03.710 * Parent agreed to stop sending diffs. Finalizing AOF...
30125:C 05 May 20:18:03.710 * Concatenating 0.00 MB of AOF diff received from parent.
30125:C 05 May 20:18:03.711 * SYNC append only file rewrite performed
30125:C 05 May 20:18:03.711 * AOF rewrite: 0 MB of memory used by copy-on-write
29770:S 05 May 20:18:03.733 * Background AOF rewrite terminated with success
29770:S 05 May 20:18:03.733 * Residual parent diff successfully flushed to the rewritten AOF (0.00 MB)
29770:S 05 May 20:18:03.733 * Background AOF rewrite finished successfully

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值