Closed james-leo closed 7 years ago
@spinlock 不行,已经选用/jodis/codis-demo/yyyy 信息如下: { "addr": "172.16.100.50:19000", "admin": "172.16.100.50:11080", "start": "2017-01-19 10:19:32.607652349 +0800 HKT", "state": "online", "token": "abbddfe14ddce61f446c85503b6bb46b" }
java 客户端 codis 0.31
测试代码 JedisResourcePool jedisPool = RoundRobinJedisPool.create() .curatorClient("zkserver:2181", 30000).zkProxyDir("/jodis/xxx").build(); try (Jedis jedis = jedisPool.getResource()) { jedis.set("foo", "bar"); String value = jedis.get("foo"); System.out.println(value); }
@spinlock 测试代码给的是例子,真实代码就是改动IP,端口,zk目录
@spinlock 问题已解决,新建一个的项目,单独测试通过,其中zk路径选用/jodis/codis-demo,估计跟以前项目不同版本jar包应用问题
👍
参见Tutorial 中文 操作,版本为 release3.1, 所有codis服务一台,3个zookeeper进程组成伪集群在另一台, 出现了与#10一样的问题 zookeeper 路径 /codis3/codis-demo/proxy/yyyy 信息: { "id": 1, "token": "abbddfe14ddce61f446c85503b6bb46b", "start_time": "2017-01-19 10:19:32.607652349 +0800 HKT", "admin_addr": "172.16.100.50:11080", "proto_type": "tcp4", "proxy_addr": "172.16.100.50:19000", "jodis_path": "/jodis/codis-demo/proxy-abbddfe14ddce61f446c85503b6bb46b", "product_name": "codis-demo", "pid": 11950, "pwd": "/software/src/github.com/CodisLabs/codis", "sys": "Linux localhost.localdomain 3.10.0-229.el7.x86_64 #1 SMP Fri Mar 6 11:36:42 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux", "hostname": "localhost.localdomain", "datacenter": "" }
通过proxy端口进行压测正常,登录codis-server 查看也正常,就是使用JAVA 调用时报错