暂无图片
分享
幻听
2024-04-10
redis 7.2.4 主从复制,从节点没有同步主节点的lua脚本

1. 原来是4.0.11的redis版本,一主两从节点。主节点使用 script load "$(cat ha.lua)" 脚本后,返回了hash值,

从节点使用 script exists 94c5e054d61f4006b44c3ea43ef2607d1abd0e28 ,返回成功。

2.将4.0.11的redis版本,主从环境都升级至 7.2.4版本后,主节点使用 script load "$(cat ha.lua)" 脚本后,返回了hash值, 从节点使用 script exists 94c5e054d61f4006b44c3ea43ef2607d1abd0e28  ,返回失败,为空值,没有同步过来

收藏
分享
3条回答
默认
最新
一般

配置文件贴出来看看

参考一下https://zhuanlan.zhihu.com/p/667454308?utm_id=0

暂无图片 评论
暂无图片 有用 0
幻听
题主
2024-04-11
主从是没问题的,你这个教程就比我的配置多了个aof的开启,但是我4.0.11也是没开启aof的,但是从节点也正常同步lua脚本缓存。就是升级到7.2.4就不能同步脚本了
幻听
题主
2024-04-11
bind 0.0.0.0 protected-mode no port 6379 tcp-backlog 511 timeout 0 tcp-keepalive 300 daemonize yes pidfile /var/run/redis_6379.pid loglevel notice logfile "/var/log/redis_6379.log" databases 16 always-show-logo no set-proc-title yes proc-title-template "{title} {listen-addr} {server-mode}" locale-collate "" save 900 1 300 100 60 10000 stop-writes-on-bgsave-error yes rdbcompression yes rdbchecksum yes dbfilename "exp_osx.so" rdb-del-sync-files no dir "/var/lib/redis/6379" masterauth "123#Pass" requirepass "123#Pass" replica-serve-stale-data yes replica-read-only yes repl-diskless-sync yes repl-diskless-sync-delay 5 repl-diskless-sync-max-replicas 0 repl-diskless-load disabled repl-disable-tcp-nodelay no replica-priority 100 acllog-max-len 128 lazyfree-lazy-eviction no lazyfree-lazy-expire no lazyfree-lazy-server-del no replica-lazy-flush no lazyfree-lazy-user-del no lazyfree-lazy-user-flush no oom-score-adj no oom-score-adj-values 0 200 800 disable-thp yes appendonly yes appendfilename "appendonly.aof" appenddirname "appendonlydir" 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 yes aof-timestamp-enabled no slowlog-log-slower-than 10000 slowlog-max-len 128 latency-monitor-threshold 0 notify-keyspace-events "" hash-max-listpack-entries 512 hash-max-listpack-value 64 list-max-listpack-size -2 list-compress-depth 0 set-max-intset-entries 512 set-max-listpack-entries 128 set-max-listpack-value 64 zset-max-listpack-entries 128 zset-max-listpack-value 64 hll-sparse-max-bytes 3000 stream-node-max-bytes 4096 stream-node-max-entries 100 activerehashing yes client-output-buffer-limit normal 0 0 0 client-output-buffer-limit replica 256mb 64mb 60 client-output-buffer-limit pubsub 32mb 8mb 60 hz 10 dynamic-hz yes aof-rewrite-incremental-fsync yes rdb-save-incremental-fsync yes jemalloc-bg-thread yes
一般

从机中为啥没有replicaof语句?

4.0是slaveof

另外,你redis-cli连接之后,info replication显示什么?

暂无图片 评论
暂无图片 有用 0
幻听
题主
2024-04-11
7.0开始不支持lua脚本缓存的同步了,哎,谢了哈。 Lua脚本(脚本本身代码)不再支持持久化和复制,仅对命令执行结果进行持久化和复制
幻听
问题已关闭: 问题已经得到解决
暂无图片 评论
暂无图片 有用 0
回答交流
提交
问题信息
请登录之后查看
邀请回答
暂无人订阅该标签,敬请期待~~
暂无图片墨值悬赏