Giter Site home page Giter Site logo

Comments (17)

Apache9 avatar Apache9 commented on August 23, 2024

所以你19000端口上启动的是codis proxy?

curatorClient("xxx", 30000), xxx那里写的是zk的地址,不是codis proxy的地址

from jodis.

wy1981105 avatar wy1981105 commented on August 23, 2024

改成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.

Apache9 avatar Apache9 commented on August 23, 2024

那个proxyDir传的对嘛?那个是codis proxy在zk上注册的路径

from jodis.

echokk11 avatar echokk11 commented on August 23, 2024

我也遇到这个问题 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.

Apache9 avatar Apache9 commented on August 23, 2024

这是parse节点内容出错了,把那个节点里的内容贴一下?

from jodis.

echokk11 avatar echokk11 commented on August 23, 2024

[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.

echokk11 avatar echokk11 commented on August 23, 2024

一直都是返回
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.

Apache9 avatar Apache9 commented on August 23, 2024

@spinlock 这个应该是codis proxy没有打开jodis兼容导致的?

from jodis.

wy1981105 avatar wy1981105 commented on August 23, 2024

@Apache9

[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.

spinlock avatar spinlock commented on August 23, 2024

from jodis.

wy1981105 avatar wy1981105 commented on August 23, 2024

@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.

wy1981105 avatar wy1981105 commented on August 23, 2024

已经解决的确需要在根目录下建立/jodis/XX的目录 xx这里是codis-demo.才能发送,接收。
请在文档里详细写明,这个含糊有点问题,还有zookeeper的jar包与服务端要保持一致等。

from jodis.

echokk11 avatar echokk11 commented on August 23, 2024

@wy1981105 是在文件系统中建立目录还是zk下面建立啊 我问题依旧

from jodis.

wy1981105 avatar wy1981105 commented on August 23, 2024

在proxy.toml文件中
odis_name = "zookeeper"
jodis_addr = "127.0.0.1:2181"
jodis_timeout = "20s"
jodis_compatible = false 要设置

from jodis.

echokk11 avatar echokk11 commented on August 23, 2024

3q,已经解决。

from jodis.

spinlock avatar spinlock commented on August 23, 2024

from jodis.

jxdw avatar jxdw commented on August 23, 2024

创建了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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.