1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| @Bean public JedisCluster jedisCluster(JedisPoolConfig jedisPoolConfig) { Set<HostAndPort> nodeSet = new HashSet<>(); nodeSet.add(new HostAndPort("172.16.122.101", 6379)); nodeSet.add(new HostAndPort("172.16.122.101", 6380)); nodeSet.add(new HostAndPort("172.16.122.102", 6379)); nodeSet.add(new HostAndPort("172.16.122.102", 6380)); nodeSet.add(new HostAndPort("172.16.122.103", 6379)); nodeSet.add(new HostAndPort("172.16.122.103", 6380)); JedisCluster jedisCluster = new JedisCluster(nodeSet, 2000, jedisPoolConfig);
log.info("=====创建JedisCluster=====");
return jedisCluster; }
|