A Management Node fails to start with the error "ERROR 2002: Can't connect to MySQL server." How do I resolve this?

ZSvirt was open-sourced from the ZStack ZSphere commercial project and has since developed independently. Some code, configuration, and documentation still retain historical ZStack/ZSphere names (such as environment variables, configuration items, dependencies, paths, and commands). These names are for compatibility only and do not affect the normal use of ZSvirt.

Symptom

The Management Node fails to start with the error: ERROR 2002: Can't connect to MySQL server.

Cause

The Management Node database is in an abnormal state with the error: service changed on disk.

Solution

  1. Log in to the Management Node and run the following command to reload the configuration file:

    systemctl daemon-reload
  2. Run the following command to restart the database service:

    systemctl restart mariadb
  3. Run the following command to start the Management Node:

    zstack-ctl start

On this page