python與java中使用redis集羣

1.python使用java

from rediscluster import StrictRedisClusternode

redis_nodes = [{'host':'192.168.78.62','port':"6380"},{'host':'192.168.78.62','port':"6381" }]
redis_passwd = "xxxxx"python

Redis_Client = StrictRedisCluster(startup_nodes=redis_nodes,password=redis_passwd) redis

2.java使用import

private static JedisCluster jedisPoolDB = null;im

Set<HostAndPort> nodes = new LinkedHashSet<HostAndPort>();static

nodes.add(new HostAndPort(Config.REDIS_IP, Config.REDIS_PORT));word

jedisPoolDB = new JedisCluster(nodes, 10 * 1000, 10 * 1000, 3, Config.REDIS_PASSWORD, config);di

相關文章
相關標籤/搜索