亚洲激情专区-91九色丨porny丨老师-久久久久久久女国产乱让韩-国产精品午夜小视频观看

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

redis持久化問題處理

發布時間:2020-02-20 12:59:44 來源:網絡 閱讀:4163 作者:yerikyu 欄目:系統運維

這個是最近在開發的過程中遇到的問題,因為需要頻繁使用redis作為中間查詢操作,突然故障了,服務中止,然后拋出異常

2020-01-09 09:34:17.848 ERROR 25703 --- [ XNIO-2 task-83] o.z.p.spring.web.advice.AdviceTrait      : Internal Server Error

org.springframework.data.redis.RedisSystemException: Error in execution; nested exception is io.lettuce.core.RedisCommandExecutionException: 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.

    at org.springframework.data.redis.connection.lettuce.LettuceExceptionConverter.convert(LettuceExceptionConverter.java:54)
    at org.springframework.data.redis.connection.lettuce.LettuceExceptionConverter.convert(LettuceExceptionConverter.java:52)
    at org.springframework.data.redis.connection.lettuce.LettuceExceptionConverter.convert(LettuceExceptionConverter.java:41)
    at org.springframework.data.redis.PassThroughExceptionTranslationStrategy.translate(PassThroughExceptionTranslationStrategy.java:44)
    at org.springframework.data.redis.FallbackExceptionTranslationStrategy.translate(FallbackExceptionTranslationStrategy.java:42)
    at org.springframework.data.redis.connection.lettuce.LettuceConnection.convertLettuceAccessException(LettuceConnection.java:257)
    at org.springframework.data.redis.connection.lettuce.LettuceHashCommands.convertLettuceAccessException(LettuceHashCommands.java:445)
    at org.springframework.data.redis.connection.lettuce.LettuceHashCommands.hSet(LettuceHashCommands.java:70)
    at org.springframework.data.redis.connection.DefaultedRedisConnection.hSet(DefaultedRedisConnection.java:827)
    at org.springframework.data.redis.connection.DefaultStringRedisConnection.hSet(DefaultStringRedisConnection.java:501)
    at org.springframework.data.redis.core.DefaultHashOperations.lambda$put$8(DefaultHashOperations.java:178)
    at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:224)
    at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:184)
    at org.springframework.data.redis.core.AbstractOperations.execute(AbstractOperations.java:95)
    at org.springframework.data.redis.core.DefaultHashOperations.put(DefaultHashOperations.java:177)
    at com.smpteam.aaaa.service.impl.RedisServiceImpl.setESSession(RedisServiceImpl.java:59)
    at com.smpteam.aaaa.service.impl.RedisServiceImpl$$FastClassBySpringCGLIB$$11b51629.invoke(<generated>)
    at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
    . . .
Caused by: io.lettuce.core.RedisCommandExecutionException: 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-cli登錄redis服務器檢查情況,發現ping不通
redis持久化問題處理
(error) 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問題

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快照導致不能持久化。本質上是內存不足導致的。因此需要進行相關的內存處理:

  1. 修改redis config
  2. 修改快照備份的目錄,即將快照重定向到其他目錄
  3. 修改主機內存配置

解決方案1

將stop-writes-on-bgsave-error設置為no,這個方式是直接關閉保存持久化快照

127.0.0.1:6379> config set stop-writes-on-bgsave-error no

這個在生產中可能會出現一些問題,這個然而這個方法治標不治本,他只是讓我們“忽略”他而已,使用之前需要確認bgsave失敗的原因,比如當redis用于緩存、會話的場景的時候,這么做是允許的
redis持久化問題處理

解決方案2

將備份的rdb文件,重定向到目錄

CONFIG SET dir /tmp/some/directory/other/than/var
CONFIG SET dbfilename temp.rdb

使用這個命令之后,需要確保bgsave_in_progress返回結果是0

解決方案3

在內核運行時動態地修改內核的運行參數

echo 'vm.overcommit_memory = 1' >> /etc/sysctl.conf
sysctl vm.overcommit_memory=1
向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

社旗县| 什邡市| 绥化市| 丹江口市| 宜章县| 宁化县| 阜南县| 伊春市| 永泰县| 嘉禾县| 赫章县| 黑龙江省| 慈利县| 武山县| 丹江口市| 紫阳县| 思茅市| 阿瓦提县| 溧水县| 响水县| 晋宁县| 剑河县| 张家界市| 泸溪县| 光泽县| 六安市| 朝阳县| 门源| 海门市| 元江| 融水| 临沭县| 晋州市| 江阴市| 巴楚县| 柯坪县| 新竹市| 文安县| 高唐县| 德庆县| 察隅县|