How to safely stop TiDB?

  • If a load balancer is running (recommended): Stop the load balancer and execute the SQL statement SHUTDOWN. Then TiDB waits for a period as specified by graceful-wait-before-shutdown until all sessions are terminated. Then TiDB stops running.

  • If no load balancer is running: Execute the SHUTDOWN statement. Then TiDB components are gracefully stopped.