Redis集群之主从复制错误:NOAUTH Authentication required解决方式
Redis  /  管理员 发布于 2年前   1620
Reids集群之主从复制授权失败错误代码NOAUTH Authentication required,如下:
117764:S 13 Feb 2023 11:55:35.194 * Connecting to MASTER 192.168.1.2:7001
117764:S 13 Feb 2023 11:55:35.194 * MASTER <-> REPLICA sync started
117764:S 13 Feb 2023 11:55:35.195 * Non blocking connect for SYNC fired the event.
117764:S 13 Feb 2023 11:55:35.195 * Master replied to PING, replication can continue...
117764:S 13 Feb 2023 11:55:35.195 * (Non critical) Master does not understand REPLCONF listening-port: -NOAUTH Authentication required.
117764:S 13 Feb 2023 11:55:35.196 * (Non critical) Master does not understand REPLCONF capa: -NOAUTH Authentication required.
117764:S 13 Feb 2023 11:55:35.196 * Partial resynchronization not possible (no cached master)
117764:S 13 Feb 2023 11:55:35.196 # Unexpected reply to PSYNC from master: -NOAUTH Authentication required.
117764:S 13 Feb 2023 11:55:35.196 * Retrying with SYNC...
117764:S 13 Feb 2023 11:55:35.197 # MASTER aborted replication with an error: NOAUTH Authentication required
架构配置:
主端口:7001
从端口:7002
解决方案
1.修改从库的配置redis.conf
因为配置设置了requirepass
2.从库连接主库也需要密码认证
增加一条配置
masterauth 你的主密码
重启服务
1.查找进程id,然后kill掉,不然会报错
ps -ef | grep redis
kill -9 pid 对应的进程号 (7002 对应的)
2.重启
redis-server ./7002/redis.conf
测试及检查是否正常
重启后再来查看日志
Connecting to MASTER 192.168.1.2:7001
78799:S 13 Feb 2023 11:55:53.259 * MASTER <-> REPLICA sync started
78799:S 13 Feb 2023 11:55:53.260 * Non blocking connect for SYNC fired the event.
78799:S 13 Feb 2023 11:55:53.260 * Master replied to PING, replication can continue...
78799:S 13 Feb 2023 11:55:53.261 * Trying a partial resynchronization (request 00abe83b722584efa6aea404d9f7d4d2bd163a58:1).
78799:S 13 Feb 2023 11:55:53.290 * Full resync from master: 354294f94435643ec4b9d27674ae5230f403c5ae:0
78799:S 13 Feb 2023 11:55:53.290 * Discarding previously cached master state.
78799:S 13 Feb 2023 11:56:00.722 * MASTER <-> REPLICA sync: receiving 349303117 bytes from master
78799:S 13 Feb 2023 11:56:02.637 * MASTER <-> REPLICA sync: Flushing old data
78799:S 13 Feb 2023 11:56:03.028 * MASTER <-> REPLICA sync: Loading DB in memory
78799:S 13 Feb 2023 11:56:05.908 * MASTER <-> REPLICA sync: Finished with success
78799:S 13 Feb 2023 11:56:05.911 * Background append only file rewriting started by pid 78840
ps:
看到主从复制一下success信息
MASTER <-> REPLICA sync: Finished with success
不再有错误提示为准,说明问题解决了
122 在
学历:一种延缓就业设计,生活需求下的权衡之选中评论 工作几年后,报名考研了,到现在还没认真学习备考,迷茫中。作为一名北漂互联网打工人..123 在
Clash for Windows作者删库跑路了,github已404中评论 按理说只要你在国内,所有的流量进出都在监控范围内,不管你怎么隐藏也没用,想搞你分..原梓番博客 在
在Laravel框架中使用模型Model分表最简单的方法中评论 好久好久都没看友情链接申请了,今天刚看,已经添加。..博主 在
佛跳墙vpn软件不会用?上不了网?佛跳墙vpn常见问题以及解决办法中评论 @1111老铁这个不行了,可以看看近期评论的其他文章..1111 在
佛跳墙vpn软件不会用?上不了网?佛跳墙vpn常见问题以及解决办法中评论 网站不能打开,博主百忙中能否发个APP下载链接,佛跳墙或极光..
Copyright·© 2019 侯体宗版权所有·
粤ICP备20027696号