Redis Shutdown 命令
Redis Shutdown 命令執(zhí)行以下操作:
- 停止所有客戶端
- 如果有至少一個(gè)保存點(diǎn)在等待,執(zhí)行 SAVE 命令
- 如果 AOF 選項(xiàng)被打開,更新 AOF 文件
- 關(guān)閉 redis 服務(wù)器(server)
語(yǔ)法
redis Shutdown 命令基本語(yǔ)法如下:
redis 127.0.0.1:6379> SHUTDOWN [NOSAVE] [SAVE]
可用版本
>= 1.0.0
返回值
執(zhí)行失敗時(shí)返回錯(cuò)誤。 執(zhí)行成功時(shí)不返回任何信息,服務(wù)器和客戶端的連接斷開,客戶端自動(dòng)退出。
實(shí)例
redis 127.0.0.1:6379> PING PONG redis 127.0.0.1:6379> SHUTDOWN $ $ redis Could not connect to Redis at: Connection refused not connected>
更多建議: