The downloaded Windows version is a redis-2.0.2, decompress it to drive D:
D: \ redis-2.0.2
The directory contains the following files:
Redis-server.exe: Service Program
Redis-check-dump.exe: Local database check
Redis-check-aof.exe: Update log check
Redis-benchmark.exe: Performance test, used to simulate sending M sets/gets queries by N clients at the same time (similar to the Apache AB tool ).
Start the redis Service (the configuration file is specified in the conf file. If this parameter is not specified, the default configuration file is used ):
D: \ redis-2.0.2> redis-server.exe redis. conf
The cmd window must be open all the time. When it is closed, the redis service will be closed.
When the service is enabled, another window is opened to set the client:
D: \ redis-2.0.2> redis-cli.exe-H 202.117.16.20.- P 6379
Then you can start playing:
Slave --------------------------------------------------------------------------------------------------------------------------------
Redis provides clients in multiple languages, including Java, C ++, and python.
The Java package recommended on the official redis website is Jedis. Download Jedis and import the Jedis package to the Java project. The error is found because the org. Apache. commons package is missing,
Find this package online. After downloading and importing the package, there will be no error in Jedis.
You can start by using Jedis to operate redis:
package test;
import redis.clients.jedis.Jedis;
public class Client {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Jedis jj = new Jedis("localhost");
jj.set("key1", "I am value 1");
String ss = jj.get("key1");
System.out.println(ss);
}
}