You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello everyone, I'm running the following code to fill a Redis server quickly:
public static void main(String[] args) {
Jedis jedis = new Jedis(args[0], Integer.parseInt(args[1]));
long fiveMega = 524288000; //500mb
long correspondentValue = 2097151; //Value to get 500mb being consumed
long memoryRequirement = Long.parseLong(args[2],10);
long value = (memoryRequirement * correspondentValue) / fiveMega;
Pipeline pipeline = jedis.pipelined();
for (long i = 0 ; i < value; i++) {
pipeline.sadd("key"+i, "value");
}
pipeline.sync();
}
However sometimes I get the connection exception bellow but other times it works and I can't understand why. The ports and everything are correct.
By the way, if there is another way to fill up a redis server quickly with junk data I would appreciate to see if there is no error! Thanks for the help!
exit status 1: Exception in thread "main" redis.clients.jedis.exceptions.JedisConnectionException: java.net.ConnectException: Connection refused (Connection refused)
at redis.clients.jedis.Connection.connect(Connection.java:148)
at redis.clients.jedis.BinaryClient.connect(BinaryClient.java:75)
at redis.clients.jedis.Connection.sendCommand(Connection.java:77)
at redis.clients.jedis.BinaryClient.sadd(BinaryClient.java:325)
at redis.clients.jedis.Client.sadd(Client.java:242)
at redis.clients.jedis.PipelineBase.sadd(PipelineBase.java:474)
at redis.clients.jedis.Pipeline.sadd(Pipeline.java:8)
at fillRedis.main(fillRedis.java:32)
Caused by: java.net.ConnectException: Connection refused (Connection refused)
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at redis.clients.jedis.Connection.connect(Connection.java:142)
... 7 more
The text was updated successfully, but these errors were encountered:
Hello everyone, I'm running the following code to fill a Redis server quickly:
However sometimes I get the connection exception bellow but other times it works and I can't understand why. The ports and everything are correct.
By the way, if there is another way to fill up a redis server quickly with junk data I would appreciate to see if there is no error! Thanks for the help!
exit status 1: Exception in thread "main" redis.clients.jedis.exceptions.JedisConnectionException: java.net.ConnectException: Connection refused (Connection refused)
at redis.clients.jedis.Connection.connect(Connection.java:148)
at redis.clients.jedis.BinaryClient.connect(BinaryClient.java:75)
at redis.clients.jedis.Connection.sendCommand(Connection.java:77)
at redis.clients.jedis.BinaryClient.sadd(BinaryClient.java:325)
at redis.clients.jedis.Client.sadd(Client.java:242)
at redis.clients.jedis.PipelineBase.sadd(PipelineBase.java:474)
at redis.clients.jedis.Pipeline.sadd(Pipeline.java:8)
at fillRedis.main(fillRedis.java:32)
Caused by: java.net.ConnectException: Connection refused (Connection refused)
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at redis.clients.jedis.Connection.connect(Connection.java:142)
... 7 more
The text was updated successfully, but these errors were encountered: