Graceful shutdown

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

Masters

As a default, masters have 20 minutes to shut down gracefully.

The HBase master process will receive a SIGTERM signal when Kubernetes wants to terminate the Pod. After the graceful shutdown timeout runs out, and the process still didn’t exit, Kubernetes will issue a SIGKILL signal.

This is equivalent to executing the bin/hbase-daemon.sh stop master command, which internally executes kill <master-pid> (code), waits for a configurable period of time (defaults to 20 minutes), and finally executes kill -9 <master-pid> to SIGKILL the master (code).

However, there is no acknowledge message in the log indicating a graceful shutdown.

RegionServers

As a default, RegionServers have 60 minutes to shut down gracefully.

They use the same mechanism described above. In contrast to the Master servers, they will, however, acknowledge the graceful shutdown with a message in the logs:

2023-10-11 12:38:05,059 INFO  [shutdown-hook-0] regionserver.ShutdownHook: Shutdown hook starting; hbase.shutdown.hook=true; fsShutdownHook=org.apache.hadoop.fs.FileSystem$Cache$ClientFinalizer@5875de6a
2023-10-11 12:38:05,060 INFO  [shutdown-hook-0] regionserver.HRegionServer: ***** STOPPING region server 'test-hbase-regionserver-default-0.test-hbase-regionserver-default.kuttl-test-topical-parakeet.svc.cluster.local,16020,1697027870348' *****

RestServers

As a default, RestServers have 5 minutes to shut down gracefully.

They use the same mechanism described above. In contrast to the Master servers, they will, however, acknowledge the graceful shutdown with a message in the logs:

2023-10-11 12:40:42,309 INFO  [JettyShutdownThread] server.AbstractConnector: Stopped ServerConnector@62dae540{HTTP/1.1, (http/1.1)}{0.0.0.0:8080}
2023-10-11 12:40:42,309 INFO  [JettyShutdownThread] server.session: node0 Stopped scavenging
2023-10-11 12:40:42,316 INFO  [main] RESTServer: ***** STOPPING service 'RESTServer' *****