zoukankan      html  css  js  c++  java
  • Redis:连接报错

    报错信息为

    Error: 远程主机强迫关闭了一个现有的连接。或者 Error: 你的主机中的软件中止了一个已建立的连接。

    在远程Redis服务及中连接redis正常,但是在客户机上连接时态。

    解决方法是关闭protected-mode,并且开放所有端口的访问0.0.0.0。

    当然,实际/生产情况或许并不建议你这么做,但是对于我的提供Redis服务的虚拟机而言,并没有什么问题。

    原因在Redis的配置模板中有写

    # Protected mode is a layer of security protection, in order to avoid that
    # Redis instances left open on the internet are accessed and exploited.
    #
    # When protected mode is on and if:
    #
    # 1) The server is not binding explicitly to a set of addresses using the
    #    "bind" directive.
    # 2) No password is configured.
    #
    # The server only accepts connections from clients connecting from the
    # IPv4 and IPv6 loopback addresses 127.0.0.1 and ::1, and from Unix domain
    # sockets.
    #
    # By default protected mode is enabled. You should disable it only if
    # you are sure you want clients from other hosts to connect to Redis
    # even if no authentication is configured, nor a specific set of interfaces
    # are explicitly listed using the "bind" directive.
    

    所以对于我在客户机上连接失败的原因就是我没有设置密码,开启了protected_mode,并且还尝试从互联网上访问(虽然并不是互联网)

  • 相关阅读:
    nodejs利用windows API读取文件属性(dll)
    nodejs调用delphi编写的dll
    Ubuntu 安装配置Jenkins
    electron将网站打包成桌面应用
    NW.js将网站打包成桌面应用
    Jenkins配置邮件SMTP(使用QQ邮箱)
    Jenkins搭建Nodejs自动化测试
    Ubuntu 安装node.js
    使用superobject 解析Json数据
    使用superobject 新建Json数据(数组)
  • 原文地址:https://www.cnblogs.com/freesfu/p/13736953.html
Copyright © 2011-2022 走看看