adopt one of the following solutions: 1) Just disable protected mode sending the command 'CONFIG SET protected-mode restarting the server. 3) If you started the server manually just for testing, restart it with the '--protected-mode 为no即可,我们按照这个提示进行调整,如下: redis-cli -p 22140 127.0.0.1:22140> config get protect* 1) "protected-mode" 2 ) "yes" 127.0.0.1:22140> config set protected-mode no OK 127.0.0.1:22140> config rewrite OK 确实,调整完了之后 现在我们来看这个protected-mode参数的意思: Redis中的protected-mode是为了增加Redis的安全而设置的参数,从Redis3.2版本开始添加,而我们恰好跳过了这个版本,这个参数生效有
文件在NETWORK部分有说明 bind 127.0.0.1 解决办法:注释掉bind 127.0.0.1可以使所有的ip访问redis 若是想指定多个ip访问,但并不是全部的ip访问,可以bind protected-mode yes 在redis3.2之后,redis增加了protected-mode,在这个模式下,即使注释掉了bind 127.0.0.1,再访问redisd时候还是报错,如下 修改办法:protected-mode
一、protected-mode 默认情况下,redis node和sentinel的protected-mode都是yes,在搭建集群时,若想从远程连接redis集群,需要将redis node和sentinel 的protected-mode修改为no,若只修改redis node,从远程连接sentinel后,依然是无法正常使用的,且sentinel的配置文件中没有protected-mode配置项,需要手工添加 依据redis文档的说明,若protected-mode设置为no后,需要增加密码验证或是IP限制等保护机制,否则是极度危险的。
为server 命令,redis.windows-service.conf 为配置文件,大家还经常要远程连接Redis,记得修改 找到bind 127.0.0.1,把这行前面加个#注释掉 再查找protected-mode yes 把yes修改为no redis3.2版本后新增protected-mode配置,默认是yes,即开启。 设置外部网络连接redis服务,设置方式如下: 1、关闭protected-mode模式,此时外部网络可以直接访问 2、开启protected-mode保护模式,需配置bind ip或者设置访问密码 END
redis/bin/ sed -i 's/^daemonize no/daemonize yes/g' ${directory}/redis/bin/redis.conf sed -i 's/^protected-mode yes/protected-mode no/g' ${directory}/redis/bin/redis.conf sed -i 's/^bind 127.0.0.1/# bind 127.0.0.1 redis/bin/ sed -i 's/^daemonize no/daemonize yes/g' ${directory}/redis/bin/redis.conf sed -i 's/^protected-mode yes/protected-mode no/g' ${directory}/redis/bin/redis.conf sed -i 's/^bind 127.0.0.1/# bind 127.0.0.1
#bind 127.0.0.1 注:在redis3.2之后,redis增加了protected-mode,在这个模式下,即使注释掉了bind 127.0.0.1,再访问redisd时候还是报错,需要把protected-mode yes改为protected-mode no
onlineinternship/redis cd redis #2、下载redis官方配置文件 redis配置文件 #3、修改配置项 bind 127.0.0.1 #注释掉这部分,这是限制redis只能本地访问 protected-mode redis数据库存放文件夹(可选) appendonly yes #redis持久化(可选) logfile "access.log" requirepass 123456(设置成你自己的密码) protected-mode 是在没有显示定义 bind 地址(即监听全网断),又没有设置密码 requirepass 时,protected-mode 只允许本地回环 127.0.0.1 访问。 也就是说当开启了 protected-mode 时,如果你既没有显示的定义了 bind 监听的地址,同时又没有设置 auth 密码。那你只能通过 127.0.0.1 来访问 redis 服务。 redis-slave docker restart redis-slave 登录 redis master 使用 info 命令查看从的状态 如果配置不成功记得检查 redis master 的 bind 和 protected-mode
远程连接配置 1.1 操作步骤 需要几个步骤: 修改配置文件,修改这么几处: 1)关闭保护模式 protected-mode 2)改为“需要密码” 3)修改绑定 IP 重启redis,即可 下面拆解步骤来描述 : 1.2 编辑配置文件 redis.conf 使用文本编辑工具打开 redis.conf 关闭保护模式 找到 protected-mode 设置为: protected-mode no 改为“
点击redis图标进入性能调整菜单,把bind一项修改为0.0.0.0 进入配置文件选项,ctrl+f搜索protected-mode ,将protected-mode yes修改为protected-mode
adopt one of the following solutions: 1) Just disable protected mode sending the command 'CONFIG SET protected-mode restarting the server. 3) If you started the server manually just for testing, restart it with the '--protected-mode 解决方案 其实,这里面提示了4种方法: 1、Just disable protected mode sending the command ‘CONFIG SET protected-mode no’ 3、If you started the server manually just for testing, restart it with the ‘–protected-mode no’ option
的安装目录 找到redis.windows.conf和redis.windows-service.conf配置文件 打开编辑找到 bind 127.0.0.1 ==》# bind 127.0.0.1 找到 protected-mode yes ==》protected-mode no 两个文件都要修改保存后重启redis服务 配置文件 修改前 修改后 重启服务 测试连接成功!
查了很多资料大概是因为redis默认bind 127.0.0.1,之所以说这是最靠谱的因为这是解决办法之一,当然单单注释bind还是不行,我们仍然会得到异常,解决的第二个方法就是把配置文件protected-mode redis默认开启了protected-mode,保证只有主机才能访问到,所以正确解决jedis conneciton refused的解决方案如下: 1) 宝塔软件商城找到redis,点击设置,找到配置文件 4) 找到配置文件中protected-mode yes,默认protected mode yes,需要将其改为protected-mode no 5 )重新开启reids-server 或者重载也是可以的
启动之后再data目录下就会生成日志文件 四、远程连接 redis默认不支持远程连接,想要远程连接的话需要在配置文件中加一个配置,就可以从windows上连接到linux上的redis服务了 protected-mode redis主从复制 创建三个配置文件,修改端口等信息 port 6379 daemonize yes logfile "6379.log" dir /home/zhou/redis-4.0.0/data protected-mode no port 6380 daemonize yes logfile "6380.log" dir /home/zhou/redis-4.0.0/data protected-mode no port 6381 daemonize yes logfile "6381.log" dir /home/zhou/redis-4.0.0/data protected-mode no 启动三个redis服务器
3.将“protected-mode yes”改成“protected-mode no”。 4.添加以下一行代码。 daemonize no 5.重启redis服务即可。
. #94 protected-mode yes protected-mode no # ...... #901 # requirepass foobared requirepass 123456 yes protected-mode no #476 # #477 # replicaof <masterip> <masterport> replicaof 172.17.0.2 6371 no protected-mode no #18 #19 # port <sentinel-port> #20 # The port that this sentinel instance no protected-mode no #18 #19 # port <sentinel-port> #20 # The port that this sentinel instance no protected-mode no #18 #19 # port <sentinel-port> #20 # The port that this sentinel instance
window环境下安装Redis及可视化工具Redis Desktop Manager 如果长时间连接不上,可能有两种可能性 1、bind了127.0.01:只允许在本机连接redis 2、protected-mode desktop manager工具需要配置,其余不用) 解决办法: # 打开redis配置文件 vi /etc/redis.conf # 找到 bind 127.0.0.1 将其注释 # 找到 protected-mode yes 将其改为 protected-mode no 重启redis service redis stop service redis start 再次连接 关于 参考https://www.cnblogs.com
byte 原来是 启动 redis-server的时候 没有加上配置文件,于是把redis.conf 复制到/etc/下一份, 在配置文件里redis.conf 注释掉bind 127.0.0.1, 然后 protected-mode 当然上面这种方式在本地玩玩就行了,毕竟外网都是可以访问的,线上的话还是需要bind ip,protected-mode 最好也设置为yes bind 你需要访问的ip即可。
keys * 6.修改下配置,允许远程连接,默认无密码 # 打开redis配置文件 vi /etc/redis.conf # 找到 bind 127.0.0.1 将其注释 # 找到 protected-mode yes 将其改为 protected-mode no 7.重启redis服务 systemctl restart redis.service
redis.conf 远程访问 注释掉bind 127.0.0.1可以使所有的ip访问redis 若是想指定多个ip访问,但并不是全部的ip访问,可以bind 在redis3.2之后,redis增加了protected-mode adopt one of the following solutions: 1) Just disable protected mode sending the command 'CONFIG SET protected-mode restarting the server. 3) If you started the server manually just for testing, restart it with the '--protected-mode 修改办法:protected-mode no 设置为守护进程后台启动 修改:daemonize no 使用redis账号访问 默认情况下,访问Redis服务器是不需要密码的,为了增加安全性,设置Redis
daemonize no 改为 daemonize yes【修改后:daemonize yes】 ②【必选】设置允许远程连接:注释掉bind 127.0.0.1【修改后:# bind 127.0.0.1】,并且把protected-mode yes 改为 protected-mode no【修改后:protected-mode no】 ③【可选】为Redis设置登录密码:取消注释# requirepass foobared,并设置自己的密码