redis默认只允许本地访问,要使redis可以远程访问可以修改redis.conf
打开redis.conf文件在NETWORK部分有说明
################################## NETWORK #####################################
# By default, if no "bind" configuration directive is specified, Redis listens
# for connections from all the network interfaces available on the server.
# It is possible to listen to just one or multiple selected interfaces using
# the "bind" configuration directive, followed by one or more IP addresses.
#
# Examples:
#
# bind 192.168.1.100 10.0.0.1
# bind 127.0.0.1 ::1
#
# ~~~ WARNING ~~~ If the computer running Redis is directly exposed to the
# internet, binding to all the interfaces is dangerous and will expose the
# instance to everybody on the internet. So by default we uncomment the
# following bind directive, that will force Redis to listen only into
# the IPv4 lookback interface address (this means Redis will be able to
# accept connections only from clients running into the same computer it
# is running).
#
# IF YOU ARE SURE YOU WANT YOUR INSTANCE TO LISTEN TO ALL THE INTERFACES
# JUST COMMENT THE FOLLOWING LINE.
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
bind 127.0.0.1
解决办法:注释掉bind 127.0.0.1可以使所有的ip访问redis
若是想指定多个ip访问,但并不是全部的ip访问,可以bind
注意
下面还有个说明
# 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 yes
在redis3.2之后,redis增加了protected-mode,在这个模式下,即使注释掉了bind 127.0.0.1,再访问redisd时候还是报错,如下
(error) 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 from external computers to Redis you may adopt one of the following solutions: 1) Just disable protected mode sending the command 'CONFIG SET protected-mode no' from the loopback interface by connecting to Redis from the same host the server is running, however MAKE SURE Redis is not publicly accessible from internet if you do so. Use CONFIG REWRITE to make this change permanent. 2) Alternatively you can just disable the protected mode by editing the Redis configuration file, and setting the protected mode option to 'no', and then restarting the server. 3) If you started the server manually just for testing, restart it with the '--protected-mode no' option. 4) Setup a bind address or an authentication password. NOTE: You only need to do one of the above things in order for the server to start accepting connections from the outside.
修改办法:protected-mode no
查看版本号:
入redis-3.2.3目录,使用命令:cd redis-3.2.3,然后输入命令 src/redis-cli
输入info命令,会输出一系列的关于redis的信息,找到redis_version,就是redis的版本信息了,到此就是用命令查看到了redis的版本信息了。

redis开启外网访问相关推荐

  1. django runserver开启服务(开启外网访问与ipv6访问)

    首先setting要设置: ALLOWED_HOSTS = ["*"] 然后在启动时,使用: python manage.py runserver \[::\]:8000 或是: ...

  2. 关于腾讯云redis 无法外网访问的解决方案

    关于腾讯云redis 无法外网访问的解决方案 参考文章: (1)关于腾讯云redis 无法外网访问的解决方案 (2)https://www.cnblogs.com/gu-bin/p/12164466. ...

  3. 小米路由器开启外网访问SSH和WEB管理界面

    前   言 关于<小米路由器开启SSH并连接>参考下文https://blog.csdn.net/desertworm/article/details/117958369 由于小米路由为了 ...

  4. Mysql开启外网访问

    Mysql开启外网访问 进入mysql数据库 user mysql; 更新域属性,'%'表示允许外部访问 update user set host='%' where user = 'root'; 更 ...

  5. CentOS 7 上安装 Redis3.2.3 并开启外网访问

    >>> CentOS 7 上安装 redis3.2.3安装与配置 前一段时间写过一篇codis集群的文章,写那篇文章主要是因为当时的项目不支持redis自身集群的功能. 而现在最新的 ...

  6. 解决elasticsearch开启外网访问,绑定IP下,浏览器访问超时问题

    使用浏览器外网访问时,返回超时,time_out,查看防火墙,关闭(centos6,7防火墙命令不一样)

  7. mysql开启外网访问权限

    1.打开mysql.exe(MySQL Command Line Client),输入密码 2.输入:use mysql; 3.查询host输入: select user,host from user ...

  8. ubuntu, debian 安装redis,设置开机自动启动和密码,允许外网访问

    文章目录 ubuntu, debian 安装redis,设置开机自动启动和密码,允许外网访问 通过Python3连接redis ubuntu, debian 安装redis,设置开机自动启动和密码,允 ...

  9. Redis设置外网可访问

    更改redis.conf 文件 bind 127.0.0.1 protected-mode yes # requirepass foobared (设置密码-可选) 更改为 bind 0.0.0.0 ...

最新文章

  1. 转,大佬关于虚拟内存与物理内存关系讲解。
  2. 如何解决虚拟机频繁分离和附加磁盘导致的识别错误
  3. 淘宝开源的代码质量检测工具!
  4. distributed representations的意义
  5. TCP服务器端和客户端建立连接 - 服务器端的回调处理
  6. 用 git 同步 Colab 与 Gitlab、Github 之间的文件
  7. tf.concat, np.concatenate
  8. Windows2003 WINS 服务
  9. Android Multimedia框架总结(十五)Camera框架之Camera2补充
  10. 浙江省高考计算机重点知识,2017届浙江省新高考信息技术考试标准
  11. Samba瞎折腾一下
  12. 文本转成图片(自动换行、自定义字体),图片抗锯齿优化,图片压缩优化
  13. 极域电子教室解控方法
  14. 软件测试的意义究竟是什么?
  15. 【图像处理】自动报靶系统(重弹孔)【含GUI Matlab源码 973期】
  16. 为知笔记——使用第三方Markdown的Typora编辑器编辑为知笔记
  17. 激光雷达与毫米波雷达的区别
  18. [暑假]解决:开发分支拉错问题,比如我们在master修改成feature
  19. 【日志】20220414
  20. mysql timestamp 默认_MySQL数据库TIMESTAMP怎么设置默认值 | 学步园

热门文章

  1. python小游戏编程100例_经典编程100例——python版(例9例10)
  2. 解决样本不平衡问题的奇技淫巧 汇总
  3. c++中用于字符输入的函数
  4. 【项目管理】沟通管理
  5. 软件项目管理0724:见供应商的体会
  6. 《系统集成项目管理工程师》必背100个知识点-92信息系统的特点
  7. TCP/IP 协议栈及 OSI 参考模型详解
  8. Leaflet中加载Geoserver发布的WMS服务显示地图
  9. Openlayers中使用Image的rotation实现车辆定位导航带转角(判断车辆图片旋转角度)
  10. Springboot+Maven在IDEA中配置好Maven后执行Reimport时提示:com.google.inject.internal.Errors.throwCreationExceptio