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

predixy可否使用多台,类似于集群? #62

Open
wyp678 opened this issue Nov 2, 2018 · 5 comments
Open

predixy可否使用多台,类似于集群? #62

wyp678 opened this issue Nov 2, 2018 · 5 comments

Comments

@wyp678
Copy link

wyp678 commented Nov 2, 2018

redis有40台左右,不想配置那么多ip,准备通过predixy做中间连接,一台可能不够用,要准备两台以上,java连接怎么使用呢

@fortrue
Copy link
Member

fortrue commented Nov 3, 2018

推荐在客户端代码里支持多个predixy地址,不想这么做的话就用lvs

@wyp678
Copy link
Author

wyp678 commented Nov 5, 2018

配置多个predixy地址的话,java端是用jedisCluster连接么?我连接时经常报这个错是什么原因呢?报错如下:redis.clients.jedis.exceptions.JedisDataException: ERR unknown command 'cluster'

@wyp678
Copy link
Author

wyp678 commented Nov 5, 2018

想起来了,是不能用jedisCluster做连接的,因为这个是针对集群的情况的,而predixy是无状态的,也没有集群的概念,所以jedisCluster会认为一直失败,所以报上面的错误。但是对于多predixy连接方式,及连接请求数控制还没有想到好的方案

@wyp678
Copy link
Author

wyp678 commented Nov 5, 2018

之前用lvs已经测试过了,lvs因为多了一层网关,所以效率大大下降

@fortrue
Copy link
Member

fortrue commented Nov 5, 2018

对客户端做一层封装,比如最简单的方式,对每一个predixy创建一个jedis对象放到数组里,上层用的时候从数组里随机选择一个即可

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