2019-04-18 18:37:22,460 cluster-ClusterId{value='5cb85362c6faf10ce45f01cb', description='null'}-172.16.8.30:27017 INFO connection:71 - Opened connection [connectionId{localValue:1, serverValue:131}] to 172.16.8.30:27017
2019-04-18 18:37:22,463 cluster-ClusterId{value='5cb85362c6faf10ce45f01cb', description='null'}-172.16.8.30:27017 INFO cluster:71 - Monitor thread successfully connected to server with description ServerDescription{address=172.16.8.30:27017, type=STANDALONE, state=CONNECTED, ok=true, version=ServerVersion{versionList=[4, 0, 4]}, minWireVersion=0, maxWireVersion=7, maxDocumentSize=16777216, logicalSessionTimeoutMinutes=30, roundTripTimeNanos=2553018}
2019-04-18 18:37:22,464 cluster-ClusterId{value='5cb85362c6faf10ce45f01cb', description='null'}-172.16.8.30:27017 INFO cluster:71 - Discovered cluster type of STANDALONE
2019-04-18 18:37:22,698 localhost-startStop-1 INFO connection:71 - Opened connection [connectionId{localValue:2, serverValue:132}] to 172.16.8.30:27017
2019-04-18 18:37:23,785 main INFO connection:71 - Closed connection [connectionId{localValue:2, serverValue:132}] to 172.16.8.30:27017 because the pool has been closed.
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option PermSize=128M; support was removed in 8.0
今天这个原因是@Service忘记标注
Java HotSpot错误数据出错
Redis无法keys模糊查询的问题:
编码的问题 自动编辑RedisTample类
@Bean
public RedisTemplate<String, String> redisTemplate(RedisConnectionFactory factory) {
RedisTemplate<String, String> redisTemplate = new RedisTemplate<String, String>();
redisTemplate.setConnectionFactory(factory);
//key序列化方式;(不然会出现乱码;),但是如果方法上有Long等非String类型的话,会报类型转换错误;
//所以在没有自己定义key生成策略的时候,以下这个代码建议不要这么写,可以不配置或者自己实现ObjectRedisSerializer
//或者JdkSerializationRedisSerializer序列化方式;
RedisSerializer<String> redisSerializer = new StringRedisSerializer();//Long类型不可以会出现异常信息;
redisTemplate.setKeySerializer(redisSerializer);
redisTemplate.setHashKeySerializer(redisSerializer);
return redisTemplate;
}
今天使用springboot操作redis一直包序列化的问题,在同一台机器运行没有问题,在一台机器存String字符串另一台机器读取String的时候出错,这是需要使用StringRedisTemplate获取String