Redis: key-value 数据库

一、启动redis

二、查看redis服务是否启动

ps aux | grep redis

lifei            21372   0.0  0.0  4322452    768   ??  S    日04下午   1:09.08 ./src/redis-server 127.0.0.1:6379 
lifei            36177   0.0  0.0  4286488    844 s001  S+    7:23上午   0:00.01 grep redis

三、关闭redis服务

四、遇到的问题

问题一:MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk.

参考: https://www.jianshu.com/p/3aaf21dd34d6

Redis问题
MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk. Commands that may modify the data set are disabled. Please check Redis logs for details about the error.
Redis被配置为保存数据库快照,但它目前不能持久化到硬盘。用来修改集合数据的命令不能用。请查看Redis日志的详细错误信息。


原因
强制关闭Redis快照导致不能持久化。


解决方案
将stop-writes-on-bgsave-error设置为no
127.0.0.1:6379> config set stop-writes-on-bgsave-error no

问题二:org.springframework.data.redis.serializer.SerializationException: Cannot deserialize;

解决:

      要为domain添加 序列化id。如:

public class Product implements Serializable {

    private static final long serialVersionUID = -2685226830321909895L;

......
}

猜你喜欢

转载自blog.csdn.net/hefrankeleyn/article/details/89172024
今日推荐