NutzCN Logo
问答 redis集群怎么配置?
发布于 2570天前 作者 jueduiku070 1630 次浏览 复制 上一个帖子 下一个帖子
标签:

redis.host=119.23.144.5

redis.port=6379

redis.timeout=2000
redis.max_redir=10
redis.database=0
redis.maxTotal=100
redis.password=123456

redis集群模式设置 redis.mode=cluster

redis.mode=cluster

redis.mode=normal

redis.nodes=7005,7001,7002

org.nutz.ioc.IocException: IocBean[jedisClusterWrapper -> jedisCluster] throw Exception when creating
at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:149)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:210)
at org.nutz.ioc.val.ReferValue.get(ReferValue.java:24)
at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:75)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:210)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:239)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:146)
at org.nutz.integration.jedis.JedisAgent.getJedisClusterWrapper(JedisAgent.java:66)
at org.nutz.integration.jedis.JedisAgent.jedis(JedisAgent.java:50)
at org.nutz.plugins.cache.impl.lcache.LCacheManager.jedis(LCacheManager.java:51)
at org.nutz.plugins.cache.impl.lcache.LCacheManager.run(LCacheManager.java:77)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.nutz.lang.born.BorningException: Fail to born or cast to 'redis.clients.jedis.JedisCluster'
by args: [
@([7005:6379, 7001:6379, 7002:6379])
@(2000)
@(0)
@(10)
@(123456)
@(redis.clients.jedis.JedisPoolConfig@50157789)]
because:java.net.SocketException: Network is unreachable: connect
at org.nutz.lang.born.ConstructorBorning.born(ConstructorBorning.java:25)
at org.nutz.ioc.weaver.DefaultWeaver.born(DefaultWeaver.java:67)
at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:114)
... 11 more
Caused by: java.net.SocketException: Network is unreachable: connect
at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:85)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at redis.clients.jedis.Connection.connect(Connection.java:184)
at redis.clients.jedis.BinaryClient.connect(BinaryClient.java:93)
at redis.clients.jedis.Connection.sendCommand(Connection.java:126)
at redis.clients.jedis.Connection.sendCommand(Connection.java:117)
at redis.clients.jedis.BinaryClient.auth(BinaryClient.java:564)
at redis.clients.jedis.BinaryJedis.auth(BinaryJedis.java:2138)
at redis.clients.jedis.JedisClusterConnectionHandler.initializeSlotsCache(JedisClusterConnectionHandler.java:36)
at redis.clients.jedis.JedisClusterConnectionHandler.(JedisClusterConnectionHandler.java:17)
at redis.clients.jedis.JedisSlotBasedConnectionHandler.(JedisSlotBasedConnectionHandler.java:24)
at redis.clients.jedis.BinaryJedisCluster.(BinaryJedisCluster.java:54)
at redis.clients.jedis.JedisCluster.(JedisCluster.java:93)
at redis.clients.jedis.JedisCluster$FC$d185533e670083a6a8be10a9b0aed1f0.invoke(JedisCluster.java)
at org.nutz.lang.born.AbstractConstructorBorning.call(AbstractConstructorBorning.java:25)
at org.nutz.lang.born.ConstructorBorning.born(ConstructorBorning.java:19)
... 13 more

8 回复

用 "插入代码" 按钮重新贴一次

redis.host=119.23.144.5

redis.port=6379
redis.timeout=2000
redis.max_redir=10
redis.database=0
redis.maxTotal=100
redis.password=123456

redis集群模式设置 redis.mode=cluster
redis.mode=cluster

redis.mode=normal
redis.nodes=7005,7001,7002
org.nutz.ioc.IocException: IocBean[jedisClusterWrapper -> jedisCluster] throw Exception when creating
 at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:149)
 at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:210)
 at org.nutz.ioc.val.ReferValue.get(ReferValue.java:24)
 at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:75)
 at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:210)
 at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:239)
 at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:146)
 at org.nutz.integration.jedis.JedisAgent.getJedisClusterWrapper(JedisAgent.java:66)
 at org.nutz.integration.jedis.JedisAgent.jedis(JedisAgent.java:50)
 at org.nutz.plugins.cache.impl.lcache.LCacheManager.jedis(LCacheManager.java:51)
 at org.nutz.plugins.cache.impl.lcache.LCacheManager.run(LCacheManager.java:77)
 at java.lang.Thread.run(Thread.java:745)
Caused by: org.nutz.lang.born.BorningException: Fail to born or cast to 'redis.clients.jedis.JedisCluster'
 by args: [
@([7005:6379, 7001:6379, 7002:6379])
@(2000)
@(0)
@(10)
@(123456)
@(redis.clients.jedis.JedisPoolConfig@50157789)]
 because:java.net.SocketException: Network is unreachable: connect
 at org.nutz.lang.born.ConstructorBorning.born(ConstructorBorning.java:25)
 at org.nutz.ioc.weaver.DefaultWeaver.born(DefaultWeaver.java:67)
 at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:114)
 ... 11 more
Caused by: java.net.SocketException: Network is unreachable: connect
 at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)
 at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:85)
 at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
 at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
 at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
 at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
 at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
 at java.net.Socket.connect(Socket.java:589)
 at redis.clients.jedis.Connection.connect(Connection.java:184)
 at redis.clients.jedis.BinaryClient.connect(BinaryClient.java:93)
 at redis.clients.jedis.Connection.sendCommand(Connection.java:126)
 at redis.clients.jedis.Connection.sendCommand(Connection.java:117)
 at redis.clients.jedis.BinaryClient.auth(BinaryClient.java:564)
 at redis.clients.jedis.BinaryJedis.auth(BinaryJedis.java:2138)
 at redis.clients.jedis.JedisClusterConnectionHandler.initializeSlotsCache(JedisClusterConnectionHandler.java:36)
 at redis.clients.jedis.JedisClusterConnectionHandler.(JedisClusterConnectionHandler.java:17)
 at redis.clients.jedis.JedisSlotBasedConnectionHandler.(JedisSlotBasedConnectionHandler.java:24)
 at redis.clients.jedis.BinaryJedisCluster.(BinaryJedisCluster.java:54)
 at redis.clients.jedis.JedisCluster.(JedisCluster.java:93)
 at redis.clients.jedis.JedisCluster$FC$d185533e670083a6a8be10a9b0aed1f0.invoke(JedisCluster.java)
 at org.nutz.lang.born.AbstractConstructorBorning.call(AbstractConstructorBorning.java:25)
 at org.nutz.lang.born.ConstructorBorning.born(ConstructorBorning.java:19)
 ... 13 more

Caused by: java.net.SocketException: Network is unreachable: connect

防火墙的样子

redis.nodes=127.0.0.1:7005,127.0.0.1:7001,127.0.0.1:7002

这样?

org.nutz.ioc.IocException: IocBean[jedisClusterWrapper -> jedisCluster] throw Exception when creating
	at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:149)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:210)
	at org.nutz.ioc.val.ReferValue.get(ReferValue.java:24)
	at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:75)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:210)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:239)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:146)
	at org.nutz.integration.jedis.JedisAgent.getJedisClusterWrapper(JedisAgent.java:66)
	at org.nutz.integration.jedis.JedisAgent.jedis(JedisAgent.java:50)
	at org.nutz.plugins.cache.impl.lcache.LCacheManager.jedis(LCacheManager.java:51)
	at org.nutz.plugins.cache.impl.lcache.LCacheManager.run(LCacheManager.java:77)
	at java.lang.Thread.run(Thread.java:745)
Caused by: org.nutz.lang.born.BorningException: Fail to born or cast to 'redis.clients.jedis.JedisCluster'
 by args: [
@([119.23.144.5:7005, 119.23.144.5:7001, 119.23.144.5:7002])
@(2000)
@(0)
@(10)
@(123456)
@(redis.clients.jedis.JedisPoolConfig@76f77cd9)]
 because:redis.clients.jedis.exceptions.JedisDataException: ERR Client sent AUTH, but no password is set
	at org.nutz.lang.born.ConstructorBorning.born(ConstructorBorning.java:25)
	at org.nutz.ioc.weaver.DefaultWeaver.born(DefaultWeaver.java:67)
	at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:114)
	... 11 more
Caused by: redis.clients.jedis.exceptions.JedisDataException: ERR Client sent AUTH, but no password is set
	at redis.clients.jedis.Protocol.processError(Protocol.java:127)
	at redis.clients.jedis.Protocol.process(Protocol.java:161)
	at redis.clients.jedis.Protocol.read(Protocol.java:215)
	at redis.clients.jedis.Connection.readProtocolWithCheckingBroken(Connection.java:340)
	at redis.clients.jedis.Connection.getStatusCodeReply(Connection.java:239)
	at redis.clients.jedis.BinaryClient.connect(BinaryClient.java:96)
	at redis.clients.jedis.Connection.sendCommand(Connection.java:126)
	at redis.clients.jedis.Connection.sendCommand(Connection.java:117)
	at redis.clients.jedis.BinaryClient.auth(BinaryClient.java:564)
	at redis.clients.jedis.BinaryJedis.auth(BinaryJedis.java:2138)
	at redis.clients.jedis.JedisClusterConnectionHandler.initializeSlotsCache(JedisClusterConnectionHandler.java:36)
	at redis.clients.jedis.JedisClusterConnectionHandler.<init>(JedisClusterConnectionHandler.java:17)
	at redis.clients.jedis.JedisSlotBasedConnectionHandler.<init>(JedisSlotBasedConnectionHandler.java:24)
	at redis.clients.jedis.BinaryJedisCluster.<init>(BinaryJedisCluster.java:54)
	at redis.clients.jedis.JedisCluster.<init>(JedisCluster.java:93)
	at redis.clients.jedis.JedisCluster$FC$d185533e670083a6a8be10a9b0aed1f0.invoke(JedisCluster.java)
	at org.nutz.lang.born.AbstractConstructorBorning.call(AbstractConstructorBorning.java:25)
	at org.nutz.lang.born.ConstructorBorning.born(ConstructorBorning.java:19)
	... 13 more

把密码注释掉

#redis.password=123456

可以了 ~~谢谢!!~

添加回复
请先登陆
回到顶部