-
Notifications
You must be signed in to change notification settings - Fork 97
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
Proxy list is empty #10
Comments
proxy正确启动了吗?/zk/codis/db_test/proxy这个节点下有child吗? |
回复yangzhe1991:下面是有child的 |
你好,我也出现这个问题。修改Jodis后用jdk1.6编译的,报同样的错误。情况跟 @superkilly 相同。 |
对于这个问题,目前我们也碰到了
导致jodis判断proxy状态是否为在线状态时,为false,不再进行初始化操作。
第一个问题,等待专家解决,目前看到dashboard可以通过http api获取状态。 |
你这个json文件的内容是proxy目录下的么?感觉这个是给dashboard看的? |
codis 2.x 里面 proxy 注册的地址是 /zk/codis/db_xxx/proxy/yyy,jodis 监视的目录也是 /zk/codis/db_xxx/proxy/yyy,来获取 proxy 列表。 codis 3.x 里面,proxy 注册目录换成了 /codis3/xxx/proxy/yyy,同时也会写入 /zk/codis/db_xxx/proxy/yyy 以兼容 jodis。 其中 xxx 是 product name,yyy 是 proxy 名称。所以先确认一下 zk 下对应目录是不是有正确的数据? |
从Zookeeper中获取的proxy信息,完整如上,这个的确是Zookeeper中的数据 jodis可以从 /zk/codis/db_xxx/proxy/yyy中获取,这个还没有尝试过,我们都是从/codis3/xxx/proxy/yyy中获取的,回头我尝试下。 Thank you for your reply! |
@Ericj100 对 codis 3.x 而言,jodis 是可选参数,必须启动的时候指定才行。如果找不到 /zk/codis/db_xxx 的话应该是 proxy 启动参数不对造成的哦。 |
hi,everyone
jodis_addr必须设置
2.codis的proxy需要指定jodis Thank you for your reply and help! |
codis3中proxy的状态记录在路径/jodis/{PRODUCT_NAME}中。注意路径中最后不带"/"符号。 |
楼主还在吗 |
亲测有效。。。上面的解决办法都不对的。。。竟然在closed下面找到真正的解决办法 |
下面是代码:
JedisResourcePool jedisPool = RoundRobinJedisPool.create().
curatorClient("192.168.25.247:2181", 20000).
zkProxyDir("/zk/codis/db_test/proxy").build();
Jedis jedis = jedisPool.getResource();
jedis.set("foo", "bar");
String value = jedis.get("foo");
System.out.println(value);
下面是日志:
[2015-12-23 11:02:39_434] INFO org.apache.curator.framework.imps.CuratorFrameworkImpl [main.start:238] Starting
[2015-12-23 11:02:39_462] INFO org.apache.zookeeper.ZooKeeper [main.logEnv:100] Client environment:zookeeper.version=3.4.7-1713338, built on 11/09/2015 04:32 GMT
[2015-12-23 11:02:39_465] INFO org.apache.zookeeper.ZooKeeper [main.logEnv:100] Client environment:host.name=JQ0640.chinapnr.com
[2015-12-23 11:02:39_465] INFO org.apache.zookeeper.ZooKeeper [main.logEnv:100] Client environment:java.version=1.7.0_45
[2015-12-23 11:02:39_465] INFO org.apache.zookeeper.ZooKeeper [main.logEnv:100] Client environment:java.vendor=Oracle Corporation
[2015-12-23 11:02:39_465] INFO org.apache.zookeeper.ZooKeeper [main.logEnv:100] Client environment:java.home=C:\Program Files\Java\jdk1.7.0_45\jre
[2015-12-23 11:02:39_465] INFO org.apache.zookeeper.ZooKeeper [main.logEnv:100] Client environment:java.class.path=E:\JavaTestSpace\HuiFuExamPro\bin;E:\JavaTestSpace\HuiFuExamPro\lib\jodis-0.2.2.jar;E:\JavaTestSpace\HuiFuExamPro\lib\jedis-2.7.2.jar;E:\JavaTestSpace\HuiFuExamPro\lib\commons-pool2-2.4.jar;E:\JavaTestSpace\HuiFuExamPro\lib\slf4j-api-1.6.1.jar;E:\JavaTestSpace\HuiFuExamPro\lib\slf4j-log4j12-1.6.1.jar;E:\JavaTestSpace\HuiFuExamPro\lib\log4j-1.2.16.jar;E:\JavaTestSpace\HuiFuExamPro\lib\jackson-annotations-2.7.0-20151116.041133-14.jar;E:\JavaTestSpace\HuiFuExamPro\lib\jackson-core-2.7.0-20151126.183923-32.jar;E:\JavaTestSpace\HuiFuExamPro\lib\jackson-databind-2.7.0-20151125.063421-188.jar;E:\JavaTestSpace\HuiFuExamPro\lib\guava-18.0.jar;E:\JavaTestSpace\HuiFuExamPro\lib\cobertura-2.1.1.jar;E:\JavaTestSpace\HuiFuExamPro\lib\zookeeper-3.4.7.jar;E:\JavaTestSpace\HuiFuExamPro\lib\curator-client-2.5.0.jar;E:\JavaTestSpace\HuiFuExamPro\lib\curator-framework-2.5.0.jar;E:\JavaTestSpace\HuiFuExamPro\lib\curator-recipes-2.5.0.jar
[2015-12-23 11:02:39_465] INFO org.apache.zookeeper.ZooKeeper [main.logEnv:100] Client environment:java.library.path=C:\Program Files\Java\jdk1.7.0_45\bin;C:\windows\Sun\Java\bin;C:\windows\system32;C:\windows;D:\app\killy.zhang\product\11.2.0\client_1;C:\oracle\product\10.2.0\client_1\bin;D:\Program Files\Java\jdk1.6.0_22\bin;D:\Program Files\Java\jre6\bin;D:\Software\apache-maven-3.1.1/bin;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0;D:\Software\windows linux commands;D:\Program Files\TortoiseSVN\bin;D:\Program Files (x86)\WinSCP;D:\Program Files (x86)\Windows7Master;E:\技术研究\ANT\apache-ant-1.8.2\bin;C:\Program Files (x86)\Python27;.
[2015-12-23 11:02:39_466] INFO org.apache.zookeeper.ZooKeeper [main.logEnv:100] Client environment:java.io.tmpdir=C:\Users\KILLY~1.ZHA\AppData\Local\Temp
[2015-12-23 11:02:39_466] INFO org.apache.zookeeper.ZooKeeper [main.logEnv:100] Client environment:java.compiler=
[2015-12-23 11:02:39_466] INFO org.apache.zookeeper.ZooKeeper [main.logEnv:100] Client environment:os.name=Windows 7
[2015-12-23 11:02:39_466] INFO org.apache.zookeeper.ZooKeeper [main.logEnv:100] Client environment:os.arch=amd64
[2015-12-23 11:02:39_466] INFO org.apache.zookeeper.ZooKeeper [main.logEnv:100] Client environment:os.version=6.1
[2015-12-23 11:02:39_466] INFO org.apache.zookeeper.ZooKeeper [main.logEnv:100] Client environment:user.name=killy.zhang
[2015-12-23 11:02:39_466] INFO org.apache.zookeeper.ZooKeeper [main.logEnv:100] Client environment:user.home=C:\Users\killy.zhang
[2015-12-23 11:02:39_467] INFO org.apache.zookeeper.ZooKeeper [main.logEnv:100] Client environment:user.dir=E:\JavaTestSpace\HuiFuExamPro
[2015-12-23 11:02:39_470] INFO org.apache.zookeeper.ZooKeeper [main.:438] Initiating client connection, connectString=192.168.25.247:2181 sessionTimeout=20000 watcher=org.apache.curator.ConnectionState@1f449a28
[2015-12-23 11:02:39_526] INFO org.apache.zookeeper.ClientCnxn [main-SendThread(192.168.25.247:2181).logStartConnect:1032] Opening socket connection to server 192.168.25.247/192.168.25.247:2181. Will not attempt to authenticate using SASL (unknown error)
[2015-12-23 11:02:39_530] INFO org.apache.zookeeper.ClientCnxn [main-SendThread(192.168.25.247:2181).primeConnection:876] Socket connection established to 192.168.25.247/192.168.25.247:2181, initiating session
[2015-12-23 11:02:39_564] INFO org.apache.zookeeper.ClientCnxn [main-SendThread(192.168.25.247:2181).onConnected:1299] Session establishment complete on server 192.168.25.247/192.168.25.247:2181, sessionid = 0x151c4d1663c0037, negotiated timeout = 20000
[2015-12-23 11:02:39_568] INFO org.apache.curator.framework.state.ConnectionStateManager [main-EventThread.postState:194] State change: CONNECTED
log4j:WARN No appenders could be found for logger (com.wandoulabs.jodis.RoundRobinJedisPool).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Exception in thread "main" redis.clients.jedis.exceptions.JedisException: Proxy list empty
at com.wandoulabs.jodis.RoundRobinJedisPool.getResource(RoundRobinJedisPool.java:286)
at com.huifu.killy.codis.CodisExam.main(CodisExam.java:21)
Unable to get lock channel for E:\Users\psteitz\pool\tags\POOL_2_4_RC1\target\cobertura\cobertura.ser.lock: \Users\psteitz\pool\tags\POOL_2_4_RC1\target\cobertura\cobertura.ser.lock (系统找不到指定的路径。)
lock file could not be deleted
The text was updated successfully, but these errors were encountered: