1. set key出现的报错

在192.168.56.57客户端登录192.168.56.56的redis服务器时,报错如下:
[root@localhost src]# ./redis-cli -h 192.168.56.56 -p 6379 -a "aabbcc"
192.168.56.56:6379> ping
Error: Connection reset by peer 再telnet一下192.168.56.56的redis服务器的6379端口,提示redis服务有保护模式,需要解除
[root@localhost src]# telnet 192.168.56.56 6379
Trying 192.168.56.56...
Connected to 192.168.56.56.
Escape character is '^]'. -DENIED Redis is running in protected modebecause protected mode is enabled, no bind address was specified, noauthentication password is requested to clients.
In this mode connections areonly accepted from the loopback interface. If you want to connect from externalcomputers to Redis you may adopt one of the following
solutions: 1) Justdisable protected mode sending the command 'CONFIG SET protected-mode no' fromthe loopback interface by connecting to Redis from the same host
the server isrunning, however MAKE SURE Redis is not publicly accessible from internet ifyou do so. Use CONFIG REWRITE to make this change permanent.
2) Alternativelyyou can just disable the protected mode by editing the Redis configurationfile, and setting the protected mode option to 'no', and then restarting theserver.
3) If you started the server manually just for testing, restart it withthe '--protected-mode no' option.
4) Setup a bind address or an authenticationpassword. NOTE: You only need to do one of the above things in order for theserver to start accepting connections from the outside.
Connection closed by foreign host.

2. 原因是redis的保护模式

默认redis需要设置管理员账号密码,开启了保护模式

所以如果第一次使用没有设置管理员,就会出现报错,关闭保护模式即可

3. 解决方法

方法一:

修改redis的守护进程为no ,不启用
127.0.0.1:6379> config set daemonize "no"
OK 修改redis的保护模式为no,不启用
127.0.0.1:6379> config set protected-mode "no"
OK

方法二:推荐

修改配置文件

1) 绑定IP地址,看业务开放
bind 0.0.0.0 2)Redis默认不是以守护进程的方式运行,可以通过该配置项修改,使用yes启用守护进程,设置为no daemonize no 3)保护模式 protected-mode no

3. 启动加载配置文件

/usr/local/redis/bin/redis-server  /usr/local/redis/conf/redis6379.conf
# 检查启动状态命令
ps -ef|grep redis |grep 6379

redis关闭保护模式的更多相关文章

  1. Windows Redis 取消保护模式C#进行访问

    运行redis服务程序和客户端程序设置即可. config set protected-mode “no”

  2. Redis 保护模式

    默认 redis 启用了保护模式,即如果是远程链接不能进行 CRUD 等操作,如果进行该操作报错如下 (error) DENIED Redis is running in protected mode ...

  3. centos7下的redis集群模式

    1.先安装好单机版的redis 2.Reids安装包里有个集群工具,要复制到/usr/local/bin里去 cd /home/redis/redis-4.0./src ls - cp redis-t ...

  4. Redis 5 配置 Redis sentinel(哨兵模式)

    先了解一下哨兵都 做了什么工作:Redis 的 Sentinel 系统用于管理多个 Redis 服务器(instance), 该系统执行以下三个任务: * 监控(Monitoring): Sentin ...

  5. Linux虚拟机系统中进行redis的哨兵模式配置

    一.配置步骤 开一台虚拟机1.创建三个redis配置文件:/etc/redis下pidfile "/var/run/redis6380.pid" redis的id号port 638 ...

  6. Redis三种模式——主从复制,哨兵模式,集群

    一.Redis主从复制作用 数据冗余:主从复制实现了数据的热备份,是持久化之外的一种数据冗余方式. 故障恢复:当主节点出现问题时,可以由从节点提供服务,实现快速的故障恢复:实际上是一种服务的冗余. 负 ...

  7. redis之禁用保护模式以及修改监听IP

    今天在安装filebeat的时候,出现了关于redis报错的问题,所以来总结一下: 报错信息是: (error) DENIED Redis is running in protected mode b ...

  8. Redis进阶:Redis的哨兵模式搭建

    Redis进阶:Redis的哨兵模式搭建 哨兵机制介绍 单机版的Redis存在性能瓶颈,Redis通过提高主从复制实现读写分离,提高了了Redis的可用性,另一方便也能实现数据在多个Redis直接的备 ...

  9. 企业IT管理员IE11升级指南【1】—— Internet Explorer 11增强保护模式 (EPM) 介绍

    企业IT管理员IE11升级指南 系列: [1]—— Internet Explorer 11增强保护模式 (EPM) 介绍 [2]—— Internet Explorer 11 对Adobe Flas ...

随机推荐

  1. 【bzoj1878】[SDOI2009]HH的项链

    考虑非莫队的离线算法.. 若[l,r]中有重复数值很麻烦,考虑取一个数为代表(最左或最右) 1.最左:用BIT,先把所有第一个出现的数扔进去,将询问左端点升序,每次都可能产生历史的无用点,并出现新的“ ...

  2. 010. C++ 传值与传引用

    1.参数传递 参数传递:pass by value vs. pass by reference(to const) 推荐:能传引用,尽量传引用(高效,尤其在需要拷贝的对象很大时) class comp ...

  3. lightoj 1020 (博弈水题)

    lightoj 1020 A Childhood Game 链接:http://lightoj.com/volume_showproblem.php?problem=1020 题意:一堆石子有 m 个 ...

  4. Qt ------ 再论事件循环

    在介绍在以前,我们要认识两个术语: 可重入的(Reentrant):如果多个线程可以在同一时刻调用一个类的所有函数,并且保证每一次函数调用都引用一个唯一的数据,就称这个类是可重入的(Reentrant ...

  5. JS中encodeURI、encodeURIComponent、decodeURI、decodeURIComponent

    js 对文字进行编码涉及2个函数:encodeURI,encodeURIComponent,相应2个解码函数:decodeURI,decodeURIComponent 1.用来编码和解码URI的 统一 ...

  6. tomcat maven插件启动报错tomcat-users.xml cannot be read

    tomcat maven插件启动报错tomcat-users.xml cannot be read [ERROR] Failed to execute goal org.codehaus.mojo:t ...

  7. 阿里云ECS/Ubuntu下***浅析

    公司项目中需要WebRTC作为即时通讯部分的核心技术,这部分的开发由我负责.实际上手前需要访问谷歌进行源码的下载以及编译,在这里记录下我各种折腾服务器***过程. 目前手上有两台阿里云ESC: 华南节 ...

  8. Google Map API使用详解(一)——Google Map开发背景知识

    一.谷歌地图主页 谷歌地图对应不同的地区都会有一些专门的主页,首次登陆时会显示这些地区.比如,香港的:http://maps.google.com.hk,台湾的:http://maps.google. ...

  9. easyui 更改dialog弹出的位置

    方法一: 在弹出dialog的时候不用$('#dialogDiv').dialog('open');打开.用$('#dialogDiv').window('open');打开.再用window的res ...

  10. c# WebService SOAP及Rest调用

    SOAP及Rest的调用区别参照如下: REST似乎在一夜间兴起了,这可能引起一些争议,反对者可以说REST是WEB诞生之始甚而是HTTP出现之日就相伴而生的原则.但是毋庸置疑的事实是,在Google ...