我有一个使用spring-data-redis的后端进程 . 与retwis clone类似,它使用StringRedisTemplate . 在我的Digital Ocean液滴运行约3-4小时后,它神秘地停止了持久的新键 . 我的日志表明我的redis持久性代码正在被调用,它在spring-data-redis / jedis层以某种方式停止工作,没有任何错误迹象 .

Troubleshooting done so far

  • 我有足够的公羊 . 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都没有 Logger . 所以他们不会抛出异常(因为我没有捕获任何异常)并且它们没有日志输出 . 显然,请求是spring-data-redis,spring-data-redis返回我的代码,没有例外 .

Next steps on troubleshooting?

spring-data-redis及其底层redis驱动程序“Jedis”中的日志记录量非常少 . 我已经确实登录了2,如果问题再次发生,将会看到是否有帮助 .

我也考虑过调试这个,但我认为此时只想切换到不同的驱动程序/项目 .