配置redis主从关系的bind注意情况

    在配置redis主从集群的时候需要修改bind的配置,如果master服务器redis.conf文件不修改或修改方式不正确会出现以下错误:

    1.不修改bind,使用默认的bind 127.0.0.1

26018:S 25 Oct 2019 16:39:48.218 * Connecting to MASTER 21.21.21.12:6389
26018:S 25 Oct 2019 16:39:48.219 * MASTER <-> REPLICA sync started
26018:S 25 Oct 2019 16:39:48.219 # Error condition on socket for SYNC: Connection refused

    这个时候就会出现 Error condition on socket for SYNC: Connection refused连接拒绝的错误

    2.注释掉bind 127.0.0.1

24788:S 25 Oct 2019 16:10:44.684 * Connecting to MASTER 12.63.86.96:6389
24788:S 25 Oct 2019 16:10:44.685 * MASTER <-> REPLICA sync started
24788:S 25 Oct 2019 16:10:44.685 * Non blocking connect for SYNC fired the event.
24788:S 25 Oct 2019 16:10:44.685 # Error condition on socket for SYNC: Connection reset by peer

    注释掉也会出现Connection reset by peer的错误信息

    那么正确的写法是什么,有以下两种方式:

    1.修改为bind 0.0.0.0

    2.修改为bind 当前服务器的ip地址,修改后如果需要通过redis-cli命令去链接服务器的时候,也必须加上 -h 服务器ip  才可以正常使用

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值