Quantcast
Channel: Active questions tagged redis+java - Stack Overflow
Viewing all articles
Browse latest Browse all 2204

Cannot connect to Redislabs redis server from Localhost

$
0
0

I have been trying to connect to my redis server hosted by redislabs from my localhost using Java.
The code is like this:

import com.lambdaworks.redis.RedisClient;import com.lambdaworks.redis.RedisConnection;import com.lambdaworks.redis.RedisURI;public class RedisTest {    public static void main(String[] args) {        RedisClient redisClient = new RedisClient(        RedisURI.create("redis://<password>@redis-xxxxx.xxxx.ap-south-1-1.ec2.cloud.redislabs.com:<port>"));        connection = redisClient.connect();    }}

Weird thing is that, this code works fine on my ec2 instance on aws hosted on elastic beanstalk. However my local machine throws an error

Exception in thread "main" com.lambdaworks.redis.RedisConnectionException: Unable to connect to redis-xxxxx.xxxx.ap-south-1-1.ec2.cloud.redislabs.com:<port>        at com.lambdaworks.redis.AbstractRedisClient.initializeChannel(AbstractRedisClient.java:214)        at com.lambdaworks.redis.RedisClient.connectAsync(RedisClient.java:322)        at com.lambdaworks.redis.RedisClient.connectAsync(RedisClient.java:303)        at com.lambdaworks.redis.RedisClient.connect(RedisClient.java:259)        at com.lambdaworks.redis.RedisClient.connect(RedisClient.java:238)        at com.lambdaworks.redis.RedisClient.connect(RedisClient.java:222)        at com.people.chat.Controllers.RedisController.<init>(RedisController.java:58)        .....

Even more weird is that this worked successfully from my local as well till a month back. I am aspecting that this has something to do with their recent redis update. However I am not sure, please let me know if any more info is required. Thanks

Tried searching on Google, no luck! Also tried to check if they have recently migrated their security groups/settings - still no luck!


Viewing all articles
Browse latest Browse all 2204

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>