w3resource

Redis Server: SHUTDOWN

Redis SHUTDOWN command

Redis SHUTDOWN command is used to stop all clients, perform a blocking SAVE if at least one save point is configured, flush all append only files if AOF is enabled and quit the server.

Here are some common uses and scenarios for the "SHUTDOWN" command:

  • Graceful Shutdown: Safely stops the Redis server, allowing it to save data and close connections properly.
  • Data Persistence: Optionally saves the dataset to disk before shutting down, ensuring data is preserved for recovery.
  • Maintenance: Facilitates planned maintenance by cleanly shutting down the server and ensuring all data is saved.
  • Configuration Changes: Allows for restarting the server with new configuration settings after a clean shutdown.

Syntax:

SHUTDOWN [NOSAVE] [SAVE]

Available since

1.0.0.

Return Value

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

Return Value Type

String

Example: Redis SHUTDOWN

redis 127.0.0.1:6379> SHUTDOWN

Previous: SAVE
Next: SLAVEOF



Become a Patron!

Follow us on Facebook and Twitter for latest update.

It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.

https://www.w3resource.com/redis/redis-server-shutdown.php