matrixorigin/mo_ctl_standalone

[Feature Request]: implement function `healthcheck`

aronchanisme opened this issue · 0 comments

Is there an existing issue for the feature request?

  • I have checked the existing issues.

Feature Description

Use mo_ctl healthcheck to perform a health check on current machine where mo-service is running.

Feature Implementation

Some considerations

  1. check if mo-service is running
  2. check if important ports are listening, such as 6001/9876(debug-port)/...
  3. check if mo-watchdog is enabled
  4. check if disk usage where MO_PATH belongs to is healthy
  5. check if mo is functioning, such as sql can be executed works fine as expected
mo_ctl sql "create database if not exists health_check_tmp_db;use health_check_tmp_db; create table health_check_tmp_db.t1(id int); insert into health_check_tmp_db.t1 values(1); select 
* from health_check_tmp_db.t1; drop database if exists health_check_tmp_db;"
  1. ...

Output healthcheck report at last, such as

no        check_item                          result
-----------------------------------------------------------
1        mo-service is running                succeeded
2        mo ports listening                   succeeded
3        mo-watchdog enabled                  succeeded
4        data disk usage is healthy           succeeded
5        mo works fine                        failed

Additional information

none