redis关闭保护模式
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关闭保护模式的更多相关文章
- Windows Redis 取消保护模式C#进行访问
运行redis服务程序和客户端程序设置即可. config set protected-mode “no”
- Redis 保护模式
默认 redis 启用了保护模式,即如果是远程链接不能进行 CRUD 等操作,如果进行该操作报错如下 (error) DENIED Redis is running in protected mode ...
- centos7下的redis集群模式
1.先安装好单机版的redis 2.Reids安装包里有个集群工具,要复制到/usr/local/bin里去 cd /home/redis/redis-4.0./src ls - cp redis-t ...
- Redis 5 配置 Redis sentinel(哨兵模式)
先了解一下哨兵都 做了什么工作:Redis 的 Sentinel 系统用于管理多个 Redis 服务器(instance), 该系统执行以下三个任务: * 监控(Monitoring): Sentin ...
- Linux虚拟机系统中进行redis的哨兵模式配置
一.配置步骤 开一台虚拟机1.创建三个redis配置文件:/etc/redis下pidfile "/var/run/redis6380.pid" redis的id号port 638 ...
- Redis三种模式——主从复制,哨兵模式,集群
一.Redis主从复制作用 数据冗余:主从复制实现了数据的热备份,是持久化之外的一种数据冗余方式. 故障恢复:当主节点出现问题时,可以由从节点提供服务,实现快速的故障恢复:实际上是一种服务的冗余. 负 ...
- redis之禁用保护模式以及修改监听IP
今天在安装filebeat的时候,出现了关于redis报错的问题,所以来总结一下: 报错信息是: (error) DENIED Redis is running in protected mode b ...
- Redis进阶:Redis的哨兵模式搭建
Redis进阶:Redis的哨兵模式搭建 哨兵机制介绍 单机版的Redis存在性能瓶颈,Redis通过提高主从复制实现读写分离,提高了了Redis的可用性,另一方便也能实现数据在多个Redis直接的备 ...
- 企业IT管理员IE11升级指南【1】—— Internet Explorer 11增强保护模式 (EPM) 介绍
企业IT管理员IE11升级指南 系列: [1]—— Internet Explorer 11增强保护模式 (EPM) 介绍 [2]—— Internet Explorer 11 对Adobe Flas ...
随机推荐
- Redis的Sorted Set有序集合命令
Sorted Set是Set的一个升级版本,它在Set的基础上增加了一个顺序属性,这一属性在添加修改元素的时候可以指定,每次指定后,zset会自动重新按新的值调整顺序.可以理解为有两列的mysql表, ...
- 一些平台无关的整型类型,int8_t,uint8_t....
pecific integral type limits Specifier Common Equivalent Signing Bits Bytes Minimum Value Maximum Va ...
- mysql三-1:存储引擎
一 什么是存储引擎 mysql中建立的库===>文件夹 库中建立的表===>文件 现实生活中我们用来存储数据的文件有不同的类型,每种文件类型对应各自不同的处理机制:比如处理文本用txt类型 ...
- [USACO12DEC] 逃跑的BarnRunning Away From…(主席树)
[USACO12DEC]逃跑的BarnRunning Away From- 题目描述 It's milking time at Farmer John's farm, but the cows hav ...
- C++并发编程 thread
std::thread C++11在标准库中为多线程提供组件, 使用线程需要包含头文件 thread, 其命名空间为 std. 启动新线程 每个进程至少有一个线程: 执行main()函数的线程, 其余 ...
- IIS最大并发连接数
最大并发连接数 = 队列长度 + 工作线程数 [工作线程数] IIS实际可以第一时间处理的请求数.比如,工作线程数 = 100,一万个连接请求同时涌过来,那么只有100个可以被处理,其余9900个进入 ...
- maven创建spring项目之后,启动报错java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
出错情景:maven中已经加载了spring的核心包,但是项目启动时,报错: org.apache.catalina.core.StandardContext listenerStart严重: Err ...
- JAVA Remote Object
RMI(Remote Method Invocation)远程方法调用是一种计算机之间利用远程对象相互调用实现双方通讯的一种通讯机制.使用这种机制,某一台计算机上的对象可以调用另一台计算机上的对象来获 ...
- (转)ios error:unrecognized selector sent to class
转自:http://blog.itpub.net/12231606/viewspace-1081952/ 今天将app统计的.a静态库包含到一个app应用中,调试时报下面的错误: *** Termin ...
- ZooKeeper在线迁移
在至少有一个Leader存在的前提下,进行Zookeeper的在线增量.在线减量.在线迁移 在全过程中ZooKeeper不停止服务 注意事项 首先,当我们要从3台扩充到5台时,应保证集群不停止服务. ...