java访问redis

JedisPoolConfig config = new JedisPoolConfig();
        config.setMaxActive(100);
        config.setMaxIdle(20);
        config.setMaxWait(1000l);
        pool = new JedisPool(config, "192.168.3.21", 6379, 10*1000);


访问:
Jedis jedis = pool.getResource();
        HashSet<String> hSet = (HashSet<String>)jedis.smembers(word);
        pool.returnResource(jedis);

你可能感兴趣的:(redis)