下载redis
打开服务端等准备条件
Java 代码 讲解
连接redis
// 定义list 放入 port host password
List<JedisShardInfo> list = new ArrayList<JedisShardInfo>();
list.add(new JedisShardInfo("localhost",6379,"123"));
ShardedJedis shardedJedis = new ShardedJedis(list);