윈도우 사용자이면, vmware 기반 리눅스를 설치하고 redis 서버를 설치

 

$ wget http://redis.googlecode.com/files/redis-2.4.10.tar.gz

$ tar xzf redis-2.4.10.tar.gz

$ cd redis-2.4.10

$ make

$ src/redis-server

클라는 이클립스.

poom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.google.jedis</groupId>
  <artifactId>jtest</artifactId>
  <version>0.0.1-SNAPSHOT</version>
 
    <dependencies>
  <dependency>
    <groupId>redis.clients</groupId>
    <artifactId>jedis</artifactId>
    <version>2.0.0</version>
    <type>jar</type>
    <scope>compile</scope>
</dependency>
  </dependencies>
</project>

 

간단한 코드

public class BitSetTest {

    static Jedis jedis = new Jedis("192.168.159.133");

    public static void main(String[] args) {
        jedis.set("foo", "bar");
        String value = jedis.get("foo");
        System.out.println(value);
    }

}

 

테스트 결과

bar

Posted by '김용환'
,