我有一个使用spring-data-redis的后端进程。与retwis clone类似,它使用StringRedisTemplate。在我的Digital Ocean液滴运行约3-4小时后,它神秘地停止了持久的新键。我的日志表明我的redis持久性代码正在被调用,它在spring-data-redis / jedis层以某种方式停止工作,没有任何错误迹象。
到目前为止已完成的问题排查
我有足够的公羊。 Redis只用了6mb。
我重新启动了后端进程,所有内容都按预期工作,正在插入关键值。
我检查了redis-server.log。这与我的spring-data-redis / jedis失败的假设是一致的。条目在插入我的最后一个密钥的同时停止。 2015年9月8日的条目是它神秘失败的时候。第二天,08/10/2015的参赛作品是我重新开始的时候。
[2267] 09 Aug 19:20:51.094 * 1 changes in 300 seconds. Saving...
[2267] 09 Aug 19:20:51.096 * Background saving started by pid 6611
[6611] 09 Aug 19:20:51.348 * DB saved on disk
[6611] 09 Aug 19:20:51.350 * RDB: 4 MB of memory used by copy-on-write
[2267] 09 Aug 19:20:51.397 * Background saving terminated with success
[2267] 09 Aug 19:25:52.043 * 1 changes in 300 seconds. Saving...
[2267] 09 Aug 19:25:52.045 * Background saving started by pid 6706
[6706] 09 Aug 19:25:52.417 * DB saved on disk
[6706] 09 Aug 19:25:52.418 * RDB: 4 MB of memory used by copy-on-write
[2267] 09 Aug 19:25:52.451 * Background saving terminated with success
[2267] 10 Aug 05:01:38.204 * 1 changes in 300 seconds. Saving...
[2267] 10 Aug 05:01:38.206 * Background saving started by pid 12252
[12252] 10 Aug 05:01:38.647 * DB saved on disk
[12252] 10 Aug 05:01:38.648 * RDB: 6 MB of memory used by copy-on-write
[2267] 10 Aug 05:01:38.716 * Background saving terminated with success
[2267] 10 Aug 05:06:39.054 * 1 changes in 300 seconds. Saving...
[2267] 10 Aug 05:06:39.055 * Background saving started by pid 12263
[12263] 10 Aug 05:06:39.193 * DB saved on disk
[12263] 10 Aug 05:06:39.194 * RDB: 6 MB of memory used by copy-on-write
[2267] 10 Aug 05:06:39.258 * Background saving terminated with success
[2267] 10 Aug 05:11:40.082 * 1 changes in 300 seconds. Saving...
[2267] 10 Aug 05:11:40.084 * Background saving started by pid 12272
[12272] 10 Aug 05:11:40.342 * DB saved on disk
[12272] 10 Aug 05:11:40.344 * RDB: 6 MB of memory used by copy-on-write
[2267] 10 Aug 05:11:40.385 * Background saving terminated with success
我自己的应用程序日志没有例外。 spring-data-redis和jedis都没有记录器。所以他们不会抛出异常(因为我没有捕获任何异常)并且它们没有日志输出。显然,请求是spring-data-redis,spring-data-redis正在返回我的代码,没有例外。
有关问题排查的后续步骤?
spring-data-redis及其底层redis驱动程序" Jedis"中记录的数量非常少。我已经确实登录了2,看看这是否有助于/如果问题再次发生。
我也考虑过调试这个,但我认为此时只想切换到不同的驱动程序/项目。