azure - REDIS Slave无法连接Master

标签 azure redis ubuntu-16.04

Redis 从站无法连接到 Redis 主站。 我们在 Azure 服务器上安装了 redis。

以下是redis日志,

    Connecting to MASTER MasterIP:6379
 * MASTER <-> SLAVE sync started
 * Non blocking connect for SYNC fired the event.
 * Master replied to PING, replication can continue...
 * Partial resynchronization not possible (no cached master)
 * Master does not support PSYNC or is in error state (reply: -ERR Can't SYNC while not connected with my 
 * Retrying with SYNC...
 # MASTER aborted replication with an error: ERR Can't SYNC while not connected with my master

同时找到master redis连接恰好在slave连接丢失的时间,

* Background saving terminated with success
# Connection with slave  IP:6379 lost.
# Connection with slave  IP:6379 lost.
# Connection with slave  IP:6379 lost.
# Connection with slave  IP:6379 lost.
# Connection with slave  IP:6379 lost.
# Connection with slave  IP:6379 lost.
# Connection with slave  IP:6379 lost.
# Connection with slave  IP:6379 lost.
# Connection with slave  IP:6379 lost.
# Connection with slave  IP:6379 lost.
# Connection with slave  IP:6379 lost.
# Connection with slave  IP:6379 lost.
# Connection with slave  IP:6379 lost.
# Connection with slave  IP:6379 lost.
# Connection with slave  IP:6379 lost.
* SLAVE OF **UNKNOWN IP**:8888 enabled (user request)
* Connecting to MASTER **UNKNOW IP**:8888
* MASTER <-> SLAVE sync started
* Non blocking connect for SYNC fired the event.
* Master replied to PING, replication can continue...
# Unable to AUTH to MASTER: -Reading from master: Connection timed out

这里,master会自动尝试连接到一些未知的IP。

如何进一步调试?

最佳答案

# Replication
role:slave
master_host:xxx.xx.xx.xxx
master_port:xxxx
master_link_status:up
master_last_io_seconds_ago:6
master_sync_in_progress:0
  1. 使用命令“info”检查redis Slave的复制状态,确保角色为Slave
  2. 检查master_link_status是否开启,如果关闭,可能有两个原因:
    (1) 尝试与 MASTER 同步时出现 I/O 错误:连接丢失
    使用 config set client-output-buffer-limit 'slave 512mb 128mb 120' 更改缓冲区限制( client-output-buffer-limit )或更改配置文件
    (2) 无法对 MASTER 进行 AUTH:-ERR 客户端已发送 AUTH,但未设置密码
    如果不正确,请更改密码

关于azure - REDIS Slave无法连接Master,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59505367/

相关文章:

linux - Shell脚本执行失败

linux - 如果使用用户标志安装,则找不到 deepspeech 的命令错误

c# - 部署到云失败并提示无法减小 DiagnosticStore 的大小?

data-structures - Redis 数据结构存储所有链接的所有点击

azure - 使用 IP 地址而不是主机名访问 azure 应用程序服务

redis - Python3/Redis : redis. 异常。响应错误:未知命令 'JSON.SET'

Laravel Echo/Socket.io 在 sleep 后保持连接活跃

c++ - Affdex 'opencv-webcam-demo' 在 Ubuntu 16.04 中崩溃

azure - 内部错误 : A procedure imported by 'ScopeEngineManaged.dll' could not be loaded

iis - Azure 网站提供静态 JS/CSS 的速度很慢,但不提供二进制的