SHUTDOWN Statement
The SHUTDOWN
statement performs a graceful shutdown of Impala Daemon. The
Impala daemon will notify other Impala daemons that it is shutting down, wait for a grace
period, then shut itself down once no more queries or fragments are executing on that
daemon. The --shutdown_grace_period_s
flag determines the duration of the
grace period in seconds.
Syntax:
:SHUTDOWN()
:SHUTDOWN([host_name[:port_number] )
:SHUTDOWN(deadline)
:SHUTDOWN([host_name[:port_number], deadline)
Usage notes:
All arguments are optional for SHUTDOWN
.
Argument | Type | Default | Description |
---|---|---|---|
host_name
|
STRING
|
The current impalad host to whom the
SHUTDOWN statement is submitted. |
Address of the |
port_number
|
INT
|
|
Specifies the port by which the impalad can be
contacted.
|
deadline
|
INT
|
The value of the ‑‑shutdown_deadline_s flag,
which defaults to 1 hour. |
deadline must be a non-negative
number, specified in seconds. The value, 0, for deadline specifies an immediate shutdown. |
Take the following points into consideration when running the SHUTDOWN
statement:
-
A client can shut down the
coordinator
impalad
that it is connected to via:SHUTDOWN()
. -
A client can remotely shut down any
impalad
via:SHUTDOWN('hostname')
. -
The shutdown time limit can be overridden to force a quicker or slower shutdown by
specifying a deadline. The default deadline is determined by the
--shutdown_deadline_s
flag, which defaults to 1 hour. - Executors can be shut down without disrupting running queries. Short-running queries will finish, and long-running queries will continue until the deadline is reached.
- If queries are submitted to a coordinator after shutdown of that coordinator has started, they will fail.
- Long running queries or other issues, such as stuck fragments, will slow down but not prevent eventual shutdown.
Security considerations:
The ALL
privilege is required on the server.
Cancellation: Cannot be cancelled.
Examples:
:SHUTDOWN(); -- Shut down the current impalad with the default deadline.
:SHUTDOWN('hostname'); -- Shut down impalad running on hostname with the default deadline.
:SHUTDOWN(\"hostname:1234\"); -- Shut down impalad running on host at port 1234 with the default deadline.
:SHUTDOWN(10); - Shut down the current impalad after 10 seconds.
:SHUTDOWN('hostname', 10); - Shut down impalad running on hostname when all queries running on hostname finish, or after 10 seconds.
:SHUTDOWN('hostname:11', 10 * 60); -- Shut down impalad running on hostname at port 11 when all queries running on hostname finish, or after 600 seconds.
:SHUTDOWN(0); -- Perform an immdediate shutdown of the current impalad.
Added in: Impala 3.1