返回顶部
首页 > 资讯 > 数据库 >Redis 3.2.1从库启动报错"Error condition on socket for SYNC"问题解决一例
  • 462
分享到

Redis 3.2.1从库启动报错"Error condition on socket for SYNC"问题解决一例

2024-04-02 19:04:59 462人浏览 薄情痞子
摘要

Redis从库启动报错: # ./redis-server /data/redis/redis.conf  8890:S 07 May 13:47:38.592 * Increased maxi

Redis从库启动报错:

# ./redis-server /data/redis/redis.conf 
8890:S 07 May 13:47:38.592 * Increased maximum number of open files to 10032 (it was originally set to 1024).
                _._                                                  
           _.-``__ ''-._                                             
      _.-``    `.  `_.  ''-._           Redis 3.2.1 (00000000/0) 64 bit
  .-`` .-```.  ```\/    _.,_ ''-._                                   
 (    '      ,       .-`  | `,    )     Running in standalone mode
 |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379
 |    `-._   `._    /     _.-'    |     PID: 8890
  `-._    `-._  `-./  _.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |           Http://redis.io        
  `-._    `-._`-.__.-'_.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |                                  
  `-._    `-._`-.__.-'_.-'    _.-'                                   
      `-._    `-.__.-'    _.-'                                       
          `-._        _.-'                                           
              `-.__.-'                                               


8885:S 07 May 13:45:12.779 # Server started, Redis version 3.2.1
8885:S 07 May 13:45:12.779 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
8885:S 07 May 13:45:12.780 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
8885:S 07 May 13:45:12.780 * The server is now ready to accept connections on port 6379
8885:S 07 May 13:45:12.780 * Connecting to MASTER 192.168.140.51:6379
8885:S 07 May 13:45:12.780 * MASTER <-> SLAVE sync started
8885:S 07 May 13:45:12.781 * Non blocking connect for SYNC fired the event.
8885:S 07 May 13:45:12.782 # Error condition on Socket for SYNC: Connection reset by peer
8885:S 07 May 13:45:13.783 * Connecting to MASTER 192.168.140.51:6379
8885:S 07 May 13:45:13.784 * MASTER <-> SLAVE sync started
8885:S 07 May 13:45:13.784 * Non blocking connect for SYNC fired the event.
8885:S 07 May 13:45:13.785 # Error condition on socket for SYNC: Connection reset by peer
8885:S 07 May 13:45:14.786 * Connecting to MASTER 192.168.140.51:6379
8885:S 07 May 13:45:14.787 * MASTER <-> SLAVE sync started
8885:S 07 May 13:45:14.787 * Non blocking connect for SYNC fired the event.
8885:S 07 May 13:45:14.788 # Error condition on socket for SYNC: Connection reset by peer
8885:S 07 May 13:45:15.789 * Connecting to MASTER 192.168.140.51:6379
8885:S 07 May 13:45:15.790 * MASTER <-> SLAVE sync started
8885:S 07 May 13:45:15.791 * Non blocking connect for SYNC fired the event.
8885:S 07 May 13:45:15.792 # Error reply to PING from master: '-DENIED Redis is running in protected mode because protected mode is enabled, no bind address was specified, no authentication passWord is requested to clients. In this mode connections are only accepted from the loopback interface. If you want to connect'
8885:S 07 May 13:45:16.792 * Connecting to MASTER 192.168.140.51:6379




解决方法:
登陆Redis主库:
将bind 127.0.0.1改为bind 0.0.0.0
protected-mode yes改为no


然后重启主库






说明:protected-mode在同时存在如下两种情况时触发:


1) The server is not binding explicitly to a set of addresses using the "bind" directive.


2) No password is configured.




您可能感兴趣的文档:

--结束END--

本文标题: Redis 3.2.1从库启动报错"Error condition on socket for SYNC"问题解决一例

本文链接: https://lsjlt.com/news/45747.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

猜你喜欢
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作