Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is possible connect on CODIS using Jedi? #655

Closed
thiagohora opened this issue Jan 14, 2016 · 9 comments
Closed

Is possible connect on CODIS using Jedi? #655

thiagohora opened this issue Jan 14, 2016 · 9 comments

Comments

@thiagohora
Copy link

I'm trying to connect to the CODIS using the Jedi driver but always get the following error:

Proxy:
./codis-proxy -c config/config.ini -L ./log/proxy.log --cpu=6 --addr=0.0.0.0:19000 --http-addr=0.0.0.0:11000

Java:
@bean
public JedisPool getJedis() {
return new JedisPool(new JedisPoolConfig(), "172.17.0.8", 2181, Protocol.DEFAULT_TIMEOUT);
}

Error:

org.springframework.data.redis.RedisConnectionFailureException: Cannot get Jedis connection; nested exception is redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool
at org.springframework.data.redis.connection.jedis.JedisConnectionFactory.fetchJedisConnector(JedisConnectionFactory.java:162) ~[spring-data-redis-1.6.2.RELEASE.jar:1.6.2.RELEASE]
at org.springframework.data.redis.connection.jedis.JedisConnectionFactory.getConnection(JedisConnectionFactory.java:251) ~[spring-data-redis-1.6.2.RELEASE.jar:1.6.2.RELEASE]
at org.springframework.data.redis.connection.jedis.JedisConnectionFactory.getConnection(JedisConnectionFactory.java:58) ~[spring-data-redis-1.6.2.RELEASE.jar:1.6.2.RELEASE]
at

@yangzhe1991
Copy link
Member

machine translation? You can feel free to speak English :)

@thiagohora thiagohora changed the title 连接上使用CODIS绝地武士? Is possible connect on CODIS using Jedi? Jan 14, 2016
@yangzhe1991
Copy link
Member

return new JedisPool(new JedisPoolConfig(), "172.17.0.8", 2181, Protocol.DEFAULT_TIMEOUT);

If you use jedis, host and port should be set to proxy's host and port, in your case is 19000 and proxy's ip

@thiagohora
Copy link
Author

Yes, I have tried it but don't work, gettinf the same error

@thiagohora
Copy link
Author

captura de tela de 2016-01-14 09 39 18

@yangzhe1991
Copy link
Member

usually jedis will print detail log when "Could not get a resource from the pool", is there any more logs?

@yangzhe1991
Copy link
Member

in your case, jedis's should be set to e39... 19000
You can use redis-cli to connect this host:port first to test whether there is network issue

@thiagohora
Copy link
Author

I tried now and worked, this using remote access with redis-cli running in the same machine of the application

@yangzhe1991
Copy link
Member

So you can use redis-cli to connect proxy but you can not connect it by JedisPool?
Is there more logs for "Cannot get Jedis connection"?

@thiagohora
Copy link
Author

Ooun Thanks, with I'm using docker my machine doesn't know the alias host provided of the codis, using IP run fine!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants