Comments (17)
所以你19000端口上启动的是codis proxy?
curatorClient("xxx", 30000), xxx那里写的是zk的地址,不是codis proxy的地址
from jodis.
改成2181,但是报如下错误
[main-SendThread(127.0.0.1:2181)] INFO org.apache.zookeeper.ClientCnxn - Opening socket connection to server 127.0.0.1/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error)
[main-SendThread(127.0.0.1:2181)] INFO org.apache.zookeeper.ClientCnxn - Socket connection established to 127.0.0.1/127.0.0.1:2181, initiating session
[main-SendThread(127.0.0.1:2181)] INFO org.apache.zookeeper.ClientCnxn - Session establishment complete on server 127.0.0.1/127.0.0.1:2181, sessionid = 0x15b64c01d4c0007, negotiated timeout = 30000
[main-EventThread] INFO org.apache.curator.framework.state.ConnectionStateManager - State change: CONNECTED
Exception in thread "main" redis.clients.jedis.exceptions.JedisException: Proxy list empty
at io.codis.jodis.RoundRobinJedisPool.getResource(RoundRobinJedisPool.java:199)
at io.codis.jodis.TestMain.main(TestMain.java:12)
from jodis.
那个proxyDir传的对嘛?那个是codis proxy在zk上注册的路径
from jodis.
我也遇到这个问题 zk注册地址是 /codis3/codis-demo/proxy
JedisResourcePool jedisPool = RoundRobinJedisPool.create()
.curatorClient("x.x.x.x:2181", 30000).zkProxyDir("/codis3/codis-demo/proxy").build();
但是返回Exception in thread "main" redis.clients.jedis.exceptions.JedisException: Proxy list empty
ip地址是对的 我用zkCli可以连 也看到proxy下面有节点
from jodis.
这是parse节点内容出错了,把那个节点里的内容贴一下?
from jodis.
[zk: x.x.x.x:2181(CONNECTED) 18] get /codis3/codis-demo/proxy/proxy-310bb7d8889d16620478fb24717427df
{
"id": 1,
"token": "310bb7d8889d16620478fb24717427df",
"start_time": "2017-04-11 15:16:50.658110625 +0800 CST",
"admin_addr": "iZ23d155t9zZ:11080",
"proto_type": "tcp4",
"proxy_addr": "iZ23d155t9zZ:19000",
"product_name": "codis-demo",
"pid": 23313,
"pwd": "/alidata/codis/gopath/src/github.com/CodisLabs/codis",
"sys": "Linux iZ23d155t9zZ 2.6.32-642.11.1.el6.x86_64 #1 SMP Fri Nov 18 19:25:05 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux",
"hostname": "iZ23d155t9zZ",
"datacenter": ""
}
from jodis.
一直都是返回
Exception in thread "main" java.io.IOException: Proxy list empty
at com.wandoulabs.nedis.codis.RoundRobinNedisClientPool.acquire(RoundRobinNedisClientPool.java:229)
at com.wandoulabs.nedis.util.NedisUtils$Invoker.invoke(NedisUtils.java:220)
at com.sun.proxy.$Proxy5.set(Unknown Source)
from jodis.
@spinlock 这个应该是codis proxy没有打开jodis兼容导致的?
from jodis.
[zk: 127.0.0.1:2181(CONNECTED) 3] ls /codis3/codis-demo/proxy
[proxy-503d4bf48dce7b2672467e7825ed98e1]
JedisResourcePool jedisPool = RoundRobinJedisPool.create()
.curatorClient("127.0.0.1:2181", 30000).zkProxyDir("/codis3/codis-demo/proxy").build();
try (Jedis jedis = jedisPool.getResource()) {
jedis.set("foo", "bar");
String value = jedis.get("foo");
System.out.println(value);
}
在proxy.toml文件中
odis_name = "zookeeper"
jodis_addr = "127.0.0.1:2181"
jodis_timeout = "20s"
jodis_compatible = false
是这样设置的
但是运行结果是
] INFO org.apache.zookeeper.ZooKeeper - Initiating client connection, connectString=127.0.0.1:2181 sessionTimeout=30000 watcher=org.apache.curator.ConnectionState@49fc609f
[main-SendThread(127.0.0.1:2181)] INFO org.apache.zookeeper.ClientCnxn - Opening socket connection to server 127.0.0.1/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error)
[main-SendThread(127.0.0.1:2181)] INFO org.apache.zookeeper.ClientCnxn - Socket connection established to 127.0.0.1/127.0.0.1:2181, initiating session
[main-SendThread(127.0.0.1:2181)] INFO org.apache.zookeeper.ClientCnxn - Session establishment complete on server 127.0.0.1/127.0.0.1:2181, sessionid = 0x15b64c01d4c0017, negotiated timeout = 30000
[main-EventThread] INFO org.apache.curator.framework.state.ConnectionStateManager - State change: CONNECTED
Exception in thread "main" redis.clients.jedis.exceptions.JedisException: Proxy list empty
at io.codis.jodis.RoundRobinJedisPool.getResource(RoundRobinJedisPool.java:199)
at io.codis.jodis.TestMain.main(TestMain.java:12)
[zk: 127.0.0.1:2181(CONNECTED) 4] get /codis3/codis-demo/proxy/proxy-503d4bf48dce7b2672467e7825ed98e1
{
"id": 1,
"token": "503d4bf48dce7b2672467e7825ed98e1",
"start_time": "2017-04-13 12:10:36.81957486 +0800 CST",
"admin_addr": "192.168.3.109:11080",
"proto_type": "tcp4",
"proxy_addr": "192.168.3.109:19000",
"jodis_path": "/jodis/codis-demo/proxy-503d4bf48dce7b2672467e7825ed98e1",
"product_name": "codis-demo",
"pid": 1478,
"pwd": "/Users/wangyue/go/src/github.com/CodisLabs/codis",
"datacenter": ""
}
cZxid = 0x1d23
ctime = Thu Apr 13 12:11:14 CST 2017
mZxid = 0x1d24
mtime = Thu Apr 13 12:11:14 CST 2017
pZxid = 0x1d23
cversion = 0
dataVersion = 1
aclVersion = 0
ephemeralOwner = 0x0
dataLength = 650
numChildren = 0
[zk: 127.0.0.1:2181(CONNECTED) 5]
from jodis.
from jodis.
@spinlock 需要在/目录下建立zk或者jodis目录吗
在根目录下没有发现,只有这几个目录
Applications etc
Library home
Network installer.failurerequests
System net
Users opt
Volumes private
bin sbin
cores tmp
data usr
dev var
from jodis.
已经解决的确需要在根目录下建立/jodis/XX的目录 xx这里是codis-demo.才能发送,接收。
请在文档里详细写明,这个含糊有点问题,还有zookeeper的jar包与服务端要保持一致等。
from jodis.
@wy1981105 是在文件系统中建立目录还是zk下面建立啊 我问题依旧
from jodis.
在proxy.toml文件中
odis_name = "zookeeper"
jodis_addr = "127.0.0.1:2181"
jodis_timeout = "20s"
jodis_compatible = false 要设置
from jodis.
3q,已经解决。
from jodis.
from jodis.
创建了jodis目录,还是报.JedisException: Proxy list empty
[zk: localhost:2181(CONNECTED) 7] create /jodis/codis-demo/proxy "10.2.1.31:19000"
Created /jodis/codis-demo/proxy
from jodis.
Related Issues (20)
- 一个隐藏的异常处理风险 HOT 1
- jodis原子性问题 HOT 9
- redis.clients.jedis.exceptions.JedisException: Proxy list empty
- jodis整合spring session的问题 HOT 10
- codis jodis Extranet client Connection refused HOT 1
- 希望jodis引用guava版本升级到最新21.0 HOT 5
- 可以支持连接多个zookeeper吗? HOT 6
- 0.5.0版本是否不支持jdk1.7 HOT 1
- 0.3.0的jodis对应的后端是codis3集群,zk挂掉jodis是否能正常访问 HOT 1
- 是否支持IPV6 HOT 2
- Thread-safety problem in RoundRobinJedisPool HOT 9
- jedis连接池不断重连导致proxy session数不断增长 HOT 3
- No content to map due to end-of-input HOT 3
- jodis如何保证proxy下线时获取的client可用?(ZK通知有延迟、感知proxy下线需要时间) HOT 4
- Jodis连接codis报错:Caused by: redis.clients.jedis.exceptions.JedisConnectionException: java.net.UnknownHostException: iZwz977ogd6jecq7rowvtsZ
- No content to map due to end-of-input HOT 2
- 启动codis客户端初始化 异常 HOT 2
- 使用jodis压测比使用benchmark进行压测是qps低很多的问题
- 线上环境,偶尔Could not get a resource from the pool HOT 8
- jodis连接zookeeper报错 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jodis.