JAVA连接Redis错误提示(一)
来源:互联网 发布:搜索算法工程师 编辑:程序博客网 时间:2024/05/18 12:31
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 test.JedisPoolTest.test(JedisPoolTest.java:22) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
这个问题解决是看前辈写的东西
报错的大意就是:redis运行在保护模式,没有绑定访问地址,没有登录密码认证,在这种模式下,连接只接受环回接口(loopback,一种路由接口),
下面有几种解决办法:
1)使用命令:“CONFIG SET protected-mode no” ,禁用保护模式。
直接linux中登录redis然后打这个代码就行了
2)修改配置文件,禁用保护模式。
3)重新启动redis server 使用 “–protected-mode no” 参数
4) 设置一个绑定ip或设置认证密码
redis 设置密码
修改redis.conf 配置文件,找到 “requirepass”
取消注释,在后面添加你的密码
requirepass myRedis //这是密码
阅读全文
0 0
- JAVA连接Redis错误提示(一)
- JAVA连接Redis错误提示(二)
- 网络连接错误提示
- jedis连接redis提示JedisConnectionException
- tomcat连接池提示错误
- 连接数据库提示4064错误
- redis连接错误:Connection refused
- redis主从连接不成功错误
- linux上安装redis数据库,并实现 java连接redis一路遇到的错误
- java连接redis
- Redis Java连接操作
- Redis Java连接使用
- Java连接Redis
- Java连接Redis
- java连接Redis
- java连接redis
- java接口连接redis
- Redis - Java连接
- 检查链表是否为回文 python实现
- Android Zygote启动流程源码解析
- web实现进入指定目录
- Android 如何解决Android的库自定义属性和生成过程中的包名重映射?
- java.lang.AbstractMethodError: org.apache.bval.jsr303.ConfigurationImpl.getDefaultParameterName....
- JAVA连接Redis错误提示(一)
- 乘法逆元+扩展欧几里得+Lucas
- ActiveMQ入门教程
- nltk词性标注英文简称及分类
- Servlet和Filter的共同点和区别
- 2017.08.16【NOIP 普及组】模拟赛C组总结
- PLSQL 有效序列号
- Faster R-CNN 深入理解 && 改进方法汇总
- MySQ数据库中的基础语句