如何从Redis获取数据

时间:2018-06-14 09:25:42

标签: jmeter

我无法从远程Redis缓存中读取(只是获取,没有任何设置)变量值。 db包含JSON,我需要解析。 是否有一些简单的方法从远程Redis缓存中获取数据?

现在我收到一个错误:

2018-06-14 11:50:54,717 ERROR o.a.j.t.JMeterThread: Test failed!
redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool
    at redis.clients.util.Pool.getResource(Pool.java:40) ~[jedis-2.2.1.jar:?]
    at kg.apc.jmeter.config.redis.RedisDataSet.iterationStart(RedisDataSet.java:125) ~[jmeter-plugins-redis-0.2.jar:?]
    at org.apache.jmeter.control.GenericController.fireIterationStart(GenericController.java:393) ~[ApacheJMeter_core.jar:4.0 r1823414]
    at org.apache.jmeter.control.GenericController.fireIterEvents(GenericController.java:385) ~[ApacheJMeter_core.jar:4.0 r1823414]
    at org.apache.jmeter.control.GenericController.next(GenericController.java:158) ~[ApacheJMeter_core.jar:4.0 r1823414]
    at org.apache.jmeter.control.LoopController.next(LoopController.java:128) ~[ApacheJMeter_core.jar:4.0 r1823414]
    at org.apache.jmeter.threads.AbstractThreadGroup.next(AbstractThreadGroup.java:87) ~[ApacheJMeter_core.jar:4.0 r1823414]
    at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:248) [ApacheJMeter_core.jar:4.0 r1823414]
    at java.lang.Thread.run(Unknown Source) [?:?]
Caused by: redis.clients.jedis.exceptions.JedisConnectionException: java.net.SocketTimeoutException: Read timed out
    at redis.clients.jedis.Protocol.process(Protocol.java:86) ~[jedis-2.2.1.jar:?]
    at redis.clients.jedis.Protocol.read(Protocol.java:138) ~[jedis-2.2.1.jar:?]
    at redis.clients.jedis.Connection.getStatusCodeReply(Connection.java:165) ~[jedis-2.2.1.jar:?]
    at redis.clients.jedis.BinaryJedis.auth(BinaryJedis.java:2104) ~[jedis-2.2.1.jar:?]
    at redis.clients.jedis.JedisFactory.makeObject(JedisFactory.java:30) ~[jedis-2.2.1.jar:?]
    at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:1188) ~[commons-pool-1.6.jar:1.6]
    at redis.clients.util.Pool.getResource(Pool.java:38) ~[jedis-2.2.1.jar:?]
    ... 8 more
Caused by: java.net.SocketTimeoutException: Read timed out
    at java.net.SocketInputStream.socketRead0(Native Method) ~[?:?]
    at java.net.SocketInputStream.socketRead(Unknown Source) ~[?:?]
    at java.net.SocketInputStream.read(Unknown Source) ~[?:?]
    at java.net.SocketInputStream.read(Unknown Source) ~[?:?]
    at java.net.SocketInputStream.read(Unknown Source) ~[?:?]
    at redis.clients.util.RedisInputStream.fill(RedisInputStream.java:109) ~[jedis-2.2.1.jar:?]
    at redis.clients.util.RedisInputStream.readByte(RedisInputStream.java:45) ~[jedis-2.2.1.jar:?]
    at redis.clients.jedis.Protocol.process(Protocol.java:71) ~[jedis-2.2.1.jar:?]
    at redis.clients.jedis.Protocol.read(Protocol.java:138) ~[jedis-2.2.1.jar:?]
    at redis.clients.jedis.Connection.getStatusCodeReply(Connection.java:165) ~[jedis-2.2.1.jar:?]
    at redis.clients.jedis.BinaryJedis.auth(BinaryJedis.java:2104) ~[jedis-2.2.1.jar:?]
    at redis.clients.jedis.JedisFactory.makeObject(JedisFactory.java:30) ~[jedis-2.2.1.jar:?]
    at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:1188) ~[commons-pool-1.6.jar:1.6]
    at redis.clients.util.Pool.getResource(Pool.java:38) ~[jedis-2.2.1.jar:?]
    ... 8 more

0 个答案:

没有答案