redis 运维


redis 运维


1.连接redis集群

redis-cli -c -a xinleju -h 192.168.3.155 -p 6382

2.查看redis集群状态

   192.168.3.154:7381> cluster nodes

redis 运维
3 问题 redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool
从池子里拿连接,由于没有空闲连接,需要重新生成一个Jedis连接,但是连接被拒绝:

redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool
	at redis.clients.util.Pool.getResource(Pool.java:53)
	at redis.clients.jedis.JedisPool.getResource(JedisPool.java:226)
	at redis.clients.jedis.JedisSlotBasedConnectionHandler.getConnectionFromSlot(JedisSlotBasedConnectionHandler.java:66)
	at redis.clients.jedis.JedisClusterCommand.runWithRetries(JedisClusterCommand.java:116)
	at redis.clients.jedis.JedisClusterCommand.run(JedisClusterCommand.java:31)
	at redis.clients.jedis.JedisCluster.hgetAll(JedisCluster.java:514)
	at com.jzy.hio.redis.JedisUtil.fetchSession(JedisUtil.java:1083)

解决办法:一般这种需要检查Redis的域名配置是否正确,排查该段时间网络是否正常