[Feature Request]: implement function `healthcheck`
aronchanisme opened this issue · 0 comments
aronchanisme commented
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
- check if mo-service is running
- check if important ports are listening, such as 6001/9876(debug-port)/...
- check if mo-watchdog is enabled
- check if disk usage where MO_PATH belongs to is healthy
- 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;"
- ...
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