redis个人配置误区总结

有三天没有写日报了

这三天一直弄redis(快疯了)--->查了快100篇博客和资料

终于有一点眉目了

项目重新构建差不多10几次了

v2-08a569f5de506e88472a1679b445009b_b.jpg


一直报错,开始找文档的问题,后面在检查端口还有配置问题

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.

at redis.clients.jedis.Protocol.processError(Protocol.java:127)

at redis.clients.jedis.Protocol.process(Protocol.java:161)

at redis.clients.jedis.Protocol.read(Protocol.java:215)

at redis.clients.jedis.Connection.readProtocolWithCheckingBroken(Connection.java:340)

at redis.clients.jedis.Connection.getStatusCodeReply(Connection.java:239)

at redis.clients.jedis.Jedis.set(Jedis.java:121)

at com.fuwei.test.RedisStringJava.main(RedisStringJava.java:10)


Process finished with exit code 1

这个错误

blog.csdn.net/a53267272(解决方法)

1.修改redis.conf配置文件,将绑定的ip地址端口号给注释见下图



v2-3982628eb0c30823361e87158b60c590_b.jpg


  2.由于Linux上的redis处于安全保护模式,这就让你无法从虚拟机外部去轻松建立连接,这里就有两种解决方法,一种是在redis.conf中设置保护模式为no,见下图



v2-889d617256951114b1b99ca9fc3f3df8_b.jpg


3.另外一种方式是加上安全认证,即redis默认是没有密码的可以直接登录,这里加上密码,配置见下图



v2-d10b6d85b9d2f34d17c074ed6555124d_b.jpg


linux的环境下面的远程连接有点问题(主要是远程连接的问题)

本地测试


v2-991f8b9ac8668fbcae45ef72796b6922_b.jpg


简单的打印了一下


v2-7b54abb75c06ca30f69d743410b34fd3_b.jpg


终于找到问题的地方


今天完成的事情:弄了三天终于站到问题在哪里,今天也一直调试,还是有bug,报错,终于啊,这个几天弄的我快抑郁了


这几天的困难:那天方向出了问题,就是那个开始就弄redis与spring的集成,注解比较乱,不好找问题地方,下次慢慢的开始简单的步骤来,先不看复杂的问题,先易后难,又慢慢总结学习到


今天的收获:下次不要一直找文档的错误,有时候换个方向,看看配置和环境有的时候的问题


明天的计划:完成redis后面的配置

坚持(最近马上绩点出来了)


v2-9b037296c37c8101adf206c43ab5baa9_b.jpg




v2-162c96ef37621aab88d678cbfc9a0828_b.jpg

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值