-
Notifications
You must be signed in to change notification settings - Fork 351
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
Comments
推荐在客户端代码里支持多个predixy地址,不想这么做的话就用lvs |
配置多个predixy地址的话,java端是用jedisCluster连接么?我连接时经常报这个错是什么原因呢?报错如下:redis.clients.jedis.exceptions.JedisDataException: ERR unknown command 'cluster' |
想起来了,是不能用jedisCluster做连接的,因为这个是针对集群的情况的,而predixy是无状态的,也没有集群的概念,所以jedisCluster会认为一直失败,所以报上面的错误。但是对于多predixy连接方式,及连接请求数控制还没有想到好的方案 |
之前用lvs已经测试过了,lvs因为多了一层网关,所以效率大大下降 |
对客户端做一层封装,比如最简单的方式,对每一个predixy创建一个jedis对象放到数组里,上层用的时候从数组里随机选择一个即可 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
redis有40台左右,不想配置那么多ip,准备通过predixy做中间连接,一台可能不够用,要准备两台以上,java连接怎么使用呢
The text was updated successfully, but these errors were encountered: