Graceful shutdown

You can configure the graceful shutdown as described in Graceful shutdown.

JournalNodes

As a default, JournalNodes have 15 minutes to shut down gracefully.

The JournalNode process receives a SIGTERM signal when Kubernetes wants to terminate the Pod. It logs the received signal as shown in the log below and initiate a graceful shutdown. After the graceful shutdown timeout runs out, and the process is still running, Kubernetes issues a SIGKILL signal.

This is the relevant code that gets executed in the JournalNodes as of HDFS version 3.3.4.

2023-10-10 13:37:41,525 ERROR server.JournalNode (LogAdapter.java:error(75)) - RECEIVED SIGNAL 15: SIGTERM
2023-10-10 13:37:41,526 INFO  server.JournalNode (LogAdapter.java:info(51)) - SHUTDOWN_MSG:
/************************************************************
SHUTDOWN_MSG: Shutting down JournalNode at hdfs-journalnode-default-0/10.244.0.38
************************************************************/

NameNodes

As a default, NameNodes have 15 minutes to shut down gracefully. They use the same mechanism described above.

This is the relevant code that gets executed in the NameNodes as of HDFS version 3.3.4.

DataNodes

As a default, DataNodes have 30 minutes to shut down gracefully. They use the same mechanism described above.

This is the relevant code that gets executed in the DataNodes as of HDFS version 3.3.4.