• Redis错误:jedis.exceptions.JedisDataException: ERR Client sent AUTH, but no password is set


    原文链接:http://blog.csdn.net/rchm8519/article/details/48347797

    redis.clients.util.Pool.getResource(Pool.Java:50)
    redis.clients.jedis.JedisPool.getResource(JedisPool.java:88)
    com.radiadesign.catalina.session.RedisSessionManager.acquireConnection(RedisSessionManager.java:107)
    com.radiadesign.catalina.session.RedisSessionManager.loadSessionFromRedis(RedisSessionManager.java:388)
    com.radiadesign.catalina.session.RedisSessionManager.findSession(RedisSessionManager.java:330)
    org.apache.catalina.connector.Request.doGetSession(Request.java:2981)
    org.apache.catalina.connector.Request.getSessionInternal(Request.java:2599)
    com.radiadesign.catalina.session.RedisSessionHandlerValve.invoke(RedisSessionHandlerValve.java:28)
    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
    org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
    org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421)
    org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1074)
    org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)
    org.apache.tomcat.util.NET.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1739)
    org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1698)
    java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    java.lang.Thread.run(Thread.java:745)
    root cause

    redis.clients.jedis.exceptions.JedisDataException: ERR Client sent AUTH, but no password is set
    redis.clients.jedis.Protocol.processError(Protocol.java:113)
    redis.clients.jedis.Protocol.process(Protocol.java:138)
    redis.clients.jedis.Protocol.read(Protocol.java:192)
    redis.clients.jedis.Connection.readProtocolWithCheckingBroken(Connection.java:282)
    redis.clients.jedis.Connection.getStatusCodeReply(Connection.java:181)
    redis.clients.jedis.BinaryJedis.auth(BinaryJedis.java:1930)
    redis.clients.jedis.JedisFactory.makeObject(JedisFactory.java:71)
    org.apache.commons.pool2.impl.GenericObjectPool.create(GenericObjectPool.java:819)
    org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:429)
    org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:360)
    redis.clients.util.Pool.getResource(Pool.java:48)
    redis.clients.jedis.JedisPool.getResource(JedisPool.java:88)
    com.radiadesign.catalina.session.RedisSessionManager.acquireConnection(RedisSessionManager.java:107)
    com.radiadesign.catalina.session.RedisSessionManager.loadSessionFromRedis(RedisSessionManager.java:388)
    com.radiadesign.catalina.session.RedisSessionManager.findSession(RedisSessionManager.java:330)
    org.apache.catalina.connector.Request.doGetSession(Request.java:2981)
    org.apache.catalina.connector.Request.getSessionInternal(Request.java:2599)
    com.radiadesign.catalina.session.RedisSessionHandlerValve.invoke(RedisSessionHandlerValve.java:28)
    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
    org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
    org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421)
    org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1074)
    org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)
    org.apache.tomcat.util.Net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1739)
    org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1698)
    java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    java.lang.Thread.run(Thread.java:745)

    问题原因看起来很清楚,就是这句: ERR Client sent AUTH, but no password is set

    它的意思就是redis服务器没有设置密码,但客户端向其发送了AUTH请求,于是把程序中所有jedis发送授权的地方都去掉,可是发现异常还是存在!!简直无语了

    最后想起在tomcat中还有同步session到redis的配置,这里还设置了password,而且即使是空“”也不行。把整个password干掉,重启,ok啦!

    <Valve className="com.radiadesign.catalina.session.RedisSessionHandlerValve" />
          <Manager className="com.radiadesign.catalina.session.RedisSessionManager"
                   host="172.11.22.33" password="" port="6379" database="5" maxInactiveInterval="60" />

    另外:关于redis的启动方式:

    1、指定配置文件 $: ./redis-server /usr/local/redis.conf

    2、不指定配置:$: ./redis-server &

    不指定配置文件启动时采用默认配置,无密码

    redis通过属性requirepass 设置访问密码,但没有设置该属性时,客户端向服务端发送AUTH请求,服务端就好返回异常:ERR Client sent AUTH, but no password is set

     
  • 相关阅读:
    POJ1064 Cable master(二分 浮点误差)
    Codeforces1113F. Sasha and Interesting Fact from Graph Theory(组合数学 计数 广义Cayley定理)
    Codeforces1100F. Ivan and Burgers(离线+线性基)
    Codeforces1097D. Makoto and a Blackboard(数论+dp+概率期望)
    Codeforces1099F. Cookies(线段树+dp+贪心+博弈)
    python-zx笔记4-文件操作
    python-zx笔记3-函数
    python-zx笔记2-help
    fiddler使用笔记1
    理解OAuth 2.0
  • 原文地址:https://www.cnblogs.com/kelly-one/p/7395884.html
走看看 - 开发者的网上家园