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. 【BZOJ4456】旅行者(最短路,分治)

    [BZOJ4456]旅行者(最短路,分治) 题面 BZOJ Description 小Y来到了一个新的城市旅行.她发现了这个城市的布局是网格状的,也就是有n条从东到西的道路和m条从南到北 的道路,这些 ...

  2. 51NOD 1559:车和矩形——题解

    http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1559 波雷卡普有一个n×m,大小的棋盘,上面有k个车.他又放了q个矩形在 ...

  3. KinFu --- KinectFusion的开源实现

    KinectFusion是微软研究院的一个项目,研究用Kinect来实时地重构3D表面,最终用于人机交互. 先看视频:http://research.microsoft.com/en-us/proje ...

  4. NOIP2017结束了

    NOIP 2017 两天T1总分80 D1T3爆零 学军数据255 洛谷数据270 大概连1=都没有吧 没有预料到的结果 想了很久 最后只能选择接受 看完成绩单 高二爷们也许只剩下CYC LLQ ZS ...

  5. bzoj1016: [JSOI2008]最小生成树计数(kruskal+dfs)

    一直以为这题要martix-tree,实际上因为有相同权值的边不大于10条于是dfs就好了... 先用kruskal求出每种权值的边要选的次数num,然后对于每种权值的边2^num暴搜一下选择的情况算 ...

  6. 【loj2133】【NOI2015】品酒大会

    Portal --> loj2133 Solution 虽然说这题貌似用后缀树之类的好像会更加简短一点..但是还是因为在智力康复所以就还是用后缀数组好了嗯(哇好感动啊难得那么顺畅写了一道noi的 ...

  7. 没有为扩展名“.cshtml”注册的生成提供程序。

    新建的mvc4 空项目,然后从其他项目里拷贝shared文件夹和_ViewStart.cshtml文件过去,然后在@符号上出现 没有为扩展名“.cshtml”注册的生成提供程序.错误 解决方法: 需要 ...

  8. C++类成员空间分配和虚函数表

    最近在自学python,看到继承和类,就顺便复习了C++的类和继承等方面的知识. 先看Base基类 class Base { private: virtual void display() { cou ...

  9. mongodb replica set 和 nodejs中使用mongoose连接replica

    一.mongodb replication 介绍 官网上的第一句话就是Replication is the process of synchronizing data across multiple ...

  10. 阿里云对象存储OSS使用 HTTPS

    一.前言 阿里云对象存储oss本身也是可以用HTTPS直接访问的,但是它本身的地址是http://***.oss-cn-hangzhou.aliyuncs.com这样的,那么如果我们想使用自己的域名, ...