Redis get key error
背景
程序中一直用的key,突然不可以用,于是登录到redis集群上,手动get了一下,发现如下错误
错误
(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.
现在redis 处于拒绝模式,绑定地址也没有指定,在这种模式下,只接受回环地址接口的接口。
解决方案
其实,这里面提示了4种方法: 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. 可以,编辑redis配置文件,配置和第一点一样。
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. 设置一个绑定的地址,或者认证的密码。注意,只用做上面的一个就够了。
因为我这边是开发环境,就直接采用第二种方式了。
- 全国首创!今天起,杭州“刷”的一下就能直接乘地铁
- 2018年前端技术趋势预览
- SQL SERVER 内存分配及常见内存问题 简介
- 深入浅出事件流处理NEsper(一)
- 微软官方提供的用于监控MS SQL Server运行状况的工具及SQL语句
- 生成人工智能:创意专家新的强大工具
- JavaScript能做什么?
- SQL中利用DMV进行数据库性能分析
- 完整部署CentOS7.2+OpenStack+kvm 云平台环境(1)--基础环境搭建
- 独家!万达网科大裁员后将转型AI 朱战备或接班曲德君
- Git分支管理的策略梳理
- 数据场景分析 线上线下商家到底谁能干过谁?
- 张钦坤:云计算、开放平台与服务商版权责任
- biztalk 2010 dev版安装小记
- JavaScript 教程
- JavaScript 编辑工具
- JavaScript 与HTML
- JavaScript 与Java
- JavaScript 数据结构
- JavaScript 基本数据类型
- JavaScript 特殊数据类型
- JavaScript 运算符
- JavaScript typeof 运算符
- JavaScript 表达式
- JavaScript 类型转换
- JavaScript 基本语法
- JavaScript 注释
- Javascript 基本处理流程
- Javascript 选择结构
- Javascript if 语句
- Javascript if 语句的嵌套
- Javascript switch 语句
- Javascript 循环结构
- Javascript 循环结构实例
- Javascript 跳转语句
- Javascript 控制语句总结
- Javascript 函数介绍
- Javascript 函数的定义
- Javascript 函数调用
- Javascript 几种特殊的函数
- JavaScript 内置函数简介
- Javascript eval() 函数
- Javascript isFinite() 函数
- Javascript isNaN() 函数
- parseInt() 与 parseFloat()
- escape() 与 unescape()
- Javascript 字符串介绍
- Javascript length属性
- javascript 字符串函数
- Javascript 日期对象简介
- Javascript 日期对象用途
- Date 对象属性和方法
- Javascript 数组是什么
- Javascript 创建数组
- Javascript 数组赋值与取值
- Javascript 数组属性和方法
- PAT (Advanced Level) Practice 1001 A B Format (20 分)
- 【Java】09 List 集合与 Collections 工具类
- PAT (Advanced Level) Practice 1003 Emergency (25 分)
- 数据结构严书习题6.65已知前中序,求二叉链表
- 【Java】10 Deque 接口
- 12.深入k8s:kubelet创建pod流程源码分析
- (较为详细)树的遍历方式一览(附完整源码可在VScode与cb运行)
- 【Java】12 Map 集合
- 【Java】11 Set 集合
- 4.表格-HTML基础
- 2.语义化-HTML进阶
- MATLAB 与 C 语言的混合编程
- leetcode树之二叉树的层平均值
- C++雾中风景15:聊聊让人抓狂的Name Mangling
- 【Java】15 File 类