redisのインストール(centOS 7)


redis   :
$ wget http://download.redis.io/releases/redis-3.0.1.tar.gz
$ tar xzf redis-3.0.1.tar.gz
$ cd redis-3.0.1
$ make
       
$ src/redis-server &

     (           )
firewall-cmd --zone=public --add-port=6379/tcp --permanent
firewall-cmd --reload 

      java jedis  
  jar jedis-2.6.1.jar

    
public class TestRedis {

	@Test
	public void test() {
			Jedis jedis = new Jedis("192.168.80.11", 6379);
			jedis.setex("test", 10, "  "); //   10   
			String value = jedis.get("test");
			System.out.println(value);
	}
	
	@Test
	public void testGet() {
			Jedis jedis = new Jedis("192.168.80.11", 6379);
			String value = jedis.get("test");
			System.out.println(value);
	}

}

起動スクリプトは後で書きます...