Bringing a Resource In Service (restore)

Start the MySQL resource in the following order.

  1. Check the same items as in the monitoring process described later to confirm that MySQL is running. If it is determined that MySQL is running, the startup process ends successfully.
  1. Start MySQL using the following command.
    # /usr/bin/systemctl start <Service name>
    
  1. Check the same items as in the monitoring process described later to confirm that MySQL is running. If the check fails, it exits with an error.

Taking a Resource Out of Service (remove)

Obtain the information from the MySQL configuration file (my.cnf) specified when creating the resource to start monitoring the MySQL resource.

  1. Check the same items as in the monitoring process described later to confirm that MySQL is running. If it is determined that MySQL is running, stop MySQL with the following command. If the return value indicates that the stop command was successful, the stop process ends successfully.
    # mysqladimin -u <Username> --password=<Password> --socket=<Socket> shutdown
    

    Username : the [user] value in the [client] section of my.cnf
    Password : the [password] value in the [client] section of my.cnf
    Socket : the [socket] value in the [mysqld] section of my.cnf
  1. If the return value from step 1 indicates that the stop command failed, check whether the process does not exist based on the existence of the MySQL PID file as follows. If the check is successful, the stop process ends successfully.

    1. If the PID file exists, verify that there are no processes with the number listed in the MySQL PID file in the output of the ps command.

      PID file : the [pid-file] value in the [mysqld] section of my.cnf

    2. If the PID file does not exist, verify that there are no processes using the MySQL port number and socket in the output of the ps command.

      Port number : the [port] value in the [mysqld] section of my.cnf
      Socket : the [socket] value in the [mysqld] section of my.cnf
  1. Check the parent process using the ps command based on the process ID confirmed in step 2, issue SIGTERM to the parent process and wait for 5 seconds.
  1. If the parent process identified in step 3 exists in the ps command output, it is determined that the process is not yet stopped. Issue SIGKILL to the parent process and wait for 5 seconds.
  1. Issue SIGTERM to the process ID confirmed in step 2 and wait for 5 seconds. The process is terminated as a success or failure of the remove process depending on the success or failure of SIGTERM.

Monitoring (quickCheck)

Obtain the information from the MySQL configuration file (my.cnf) specified when creating the resource to start monitoring the MySQL resource.

  1. Refer to VARIABLES with the following command. If the reference is successful, the command exits successfully.
    # mysqladimin -u <Username> --password=<Password> --socket=<Socket> variables
    

    Username : the [user] value in the [client] section of my.cnf
    Password : the [password] value in the [client] section of my.cnf
    Socket : the [socket] value in the [mysqld] section of my.cnf
  1. If VARIABLES cannot be referenced in step 1, check that the process exists based on the existence of the MySQL PID file. If the check fails, the process exits with an error.

  1. If a PID file exists, verify that the output of the ps command contains a process with the number listed in the MySQL PID file.

    PID file : the [pid-file] value in the [mysqld] section of my.cnf

  1. If the PID file does not exist, verify that the output of the ps command contains the MySQL port number and the process using the socket.

    Port number : the [port] value in the [mysqld] section of my.cnf
    Socket : the [socket] value in the [mysqld] section of my.cnf

Recovery (recover)

  1. Perform the stop and start processes above in the described order to recover MySQL resources.

Feedback

Was this helpful?

Yes No
You indicated this topic was not helpful to you ...
Could you please leave a comment telling us why? Thank you!
Thanks for your feedback.

Post your comment on this topic.

Post Comment