/** * Created by ifkirin on 16-9-5. */import redis.clients.jedis.Jedis;public class TestRedis { public static void main(String[] args) { //连接本地的 Redis 服务 Jedis jedis = new Jedis("192.168.1.72"); jedis.set("name", "zp"); System.out.println(jedis.get("name")); System.out.println(jedis.hgetAll("default:agent_kpi:1000")); System.out.println("Connection to server sucessfully"); //查看服务是否运行 System.out.println("Server is running: "+jedis.ping()); }}