Redis集群之主从复制错误:NOAUTH Authentication required解决方式
Redis  /  管理员 发布于 7个月前   746
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
不再有错误提示为准,说明问题解决了
路人 在
php中使用hyperf框架调用讯飞星火大模型实现国内版chatgpt功能示例中评论 教程很详细,如果加个前端chatgpt对话页面就完美了..博主 在
科学上网翻墙之v2rayN-Core客户端免费公益节点使用教程中评论 @ mashrdn 多切换几个节点测试,免费ssr是没那么稳..mashrdn 在
科学上网翻墙之v2rayN-Core客户端免费公益节点使用教程中评论 V2rayn免费节点添加上去了,youtobe无法打开网页,是怎么回事..张伟 在
科学上网翻墙之v2rayN-Core客户端免费公益节点使用教程中评论 3q!有用,不过免费节点隔天就要去git上复制新的导进去..博主 在
科学上网翻墙访问Google , 上外网神器佛跳墙VPN(永久免费)使用流程步骤中评论 该篇教程已不能用了,告知大家,免的老有老铁问我!..
Copyright·© 2019 侯体宗版权所有·
粤ICP备20027696号