Show Meta Info Action

Request

GET /api/show_meta_info

Description

用于显示一些元数据信息

Path parameters

Query parameters

  • action

    指定要获取的元数据信息类型。目前支持如下:

    • SHOW_DB_SIZE

      获取指定数据库的数据量大小,单位为字节。

    • SHOW_HA

      获取 FE 元数据日志的回放情况,以及可选举组的情况。

Request body

Response

  • SHOW_DB_SIZE

    1. {
    2. "msg": "success",
    3. "code": 0,
    4. "data": {
    5. "default_cluster:information_schema": 0,
    6. "default_cluster:db1": 381
    7. },
    8. "count": 0
    9. }
  • SHOW_HA

    1. {
    2. "msg": "success",
    3. "code": 0,
    4. "data": {
    5. "can_read": "true",
    6. "role": "MASTER",
    7. "is_ready": "true",
    8. "last_checkpoint_version": "1492",
    9. "last_checkpoint_time": "1596465109000",
    10. "current_journal_id": "1595",
    11. "electable_nodes": "",
    12. "observer_nodes": "",
    13. "master": "10.81.85.89"
    14. },
    15. "count": 0
    16. }

Examples

  1. 查看集群各个数据库的数据量大小

    1. GET /api/show_meta_info?action=show_db_size
    2. Response:
    3. {
    4. "msg": "success",
    5. "code": 0,
    6. "data": {
    7. "default_cluster:information_schema": 0,
    8. "default_cluster:db1": 381
    9. },
    10. "count": 0
    11. }
  2. 查看FE选举组情况

    1. GET /api/show_meta_info?action=show_ha
    2. Response:
    3. {
    4. "msg": "success",
    5. "code": 0,
    6. "data": {
    7. "can_read": "true",
    8. "role": "MASTER",
    9. "is_ready": "true",
    10. "last_checkpoint_version": "1492",
    11. "last_checkpoint_time": "1596465109000",
    12. "current_journal_id": "1595",
    13. "electable_nodes": "",
    14. "observer_nodes": "",
    15. "master": "10.81.85.89"
    16. },
    17. "count": 0
    18. }