redis报错

1

redis connection refused: connect

解决办法

注释掉 redis.conf中的bind 127.0.0.1

2

Exception in thread "main" redis.clients.jedis.exceptions.JedisDataException: 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的文件夹下的src

输入(前提是得开启redis服务):

./redis-cli

config set protected-mode "no"

转载于:https://juejin.im/post/5b40617ae51d45198b6c5d8c

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
要解决Docker启动Redis报错的问题,可以尝试以下两种方法: 方法一:设置stop-writes-on-bgsave-error值为no 1. 打开配置文件emqx_auth_redis.conf,配置redis连接地址。 2. 进入解压目录,执行docker build .来生成镜像。 3. 执行docker run命令启动服务,并指定端口号,例如:docker run --name emqx -p 1883:1883 -p 8883:8883 -p 18083:18083 -d 镜像ID。 4. 登录Redisredis-cli -h 127.0.0.1 -p 6379 5. 在Redis命令行中执行config set stop-writes-on-bgsave-error no来设置stop-writes-on-bgsave-error的值为no。 方法二:修改redis.conf配置文件 1. 使用vim打开Redis的配置文件redis.conf。 2. 找到stop-writes-on-bgsave-error这一行的配置项。 3. 将yes修改为no。 4. 保存并关闭文件。 5. 重启Redis服务,使修改的配置生效。 通过以上两种方法中的任意一种,您应该能够解决Docker启动Redis报错的问题。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [docker dockerFile 一键部署 emqx](https://download.csdn.net/download/qq_39231899/82331253)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *2* *3* [docker中启动redis整合Springboot提示错误解决方案](https://blog.csdn.net/administratop/article/details/126498441)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值