修改本页

Redis 命令 客户端 文档 社区 下载 问题 支持 许可

SHUTDOWN [NOSAVE] [SAVE]

相关命令

始于1.0.0可用。

The command behavior is the following:

  • Stop all the clients.
  • Perform a blocking SAVE if at least one save point is configured.
  • Flush the Append Only File if AOF is enabled.
  • Quit the server.

If persistence is enabled this commands makes sure that Redis is switched off without the lost of any data. This is not guaranteed if the client uses simply SAVE and then QUIT because other clients may alter the DB data between the two commands.

Note: A Redis instance that is configured for not persisting on disk (no AOF configured, nor "save" directive) will not dump the RDB file on SHUTDOWN, as usually you don't want Redis instances used only for caching to block on when shutting down.

SAVE and NOSAVE modifiers

It is possible to specify an optional modifier to alter the behavior of the command. Specifically:

  • SHUTDOWN SAVE will force a DB saving operation even if no save points are configured.
  • SHUTDOWN NOSAVE will prevent a DB saving operation even if one or more save points are configured. (You can think at this variant as an hypothetical ABORT command that just stops the server).

返回值

Simple string reply on error. On success nothing is returned since the server quits and the connection is closed.

Comments powered by Disqus

This website is open source software developed by Citrusbyte.

The Redis logo was designed by Carlos Prioglio. See more credits.

Sponsored by Redis Support