1进行redis配置,将绑定ip注释掉(#注销掉),守护线程改为yes,保护模式改为no,
2 查看线程
3 关闭防火墙 再次启动服务端,再启动客户端,并且测试
4 java代码里面的测试
这是pom配置
<!-- redis里面的jedis,有了jedis我们就能进行key value -->
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
<version>2.9.0</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
public static void main(String[] args) {
//linux系统开启后的ifconfig地址
Jedis jedis = new Jedis("192.168.8.157");
jedis.set("1", "bar");
log.info(jedis.get("1"));
//System.out.println(jedis.get("good"));
}
2017-09-12 09:54:06 [INFO ] [com.dayuanit.mall.controller.OrderController.main:83] |bar