You need to enable JavaScript to run this app.
导航
DescribeFailoverLogs
最近更新时间:2024.03.11 16:27:27首次发布时间:2023.08.14 13:15:55

调用 DescribeFailoverLogs 接口查询 MySQL 实例的主备切换日志。

请求类型

同步请求。

请求参数

名称类型是否必选示例值描述
InstanceIdStringmysql-55aee4ba****实例 ID。
OffsetInteger0当前页查询偏移量,取值最小为 0。默认值为 0。
LimitInteger10每页记录数。最小值为 1,最大值不超过 100。默认值为 10。

返回参数

名称类型示例值描述
TotalInteger1总数。
FailoverQueryInfosArray of FailoverQueryInfoObject请参见返回示例实例主备切换日志列表。关于 FailoverQueryInfos 的详细信息,请参见数据结构

请求示例

POST /?Action=DescribeFailoverLogs&Version=2022-01-01 HTTP/1.1
Accept: application/json
Content-Type: application/json
Host: rds.volcengineapi.com
X-Date: 20180614T114308Z
Authorization: HMAC-SHA256 Credential=AKIAIAGMBG4SXSQQ****/20180614/cn-beijing/rds_mysql/request, SignedHeaders=accept;content-type;host;x-date, Signature=6a593bf5f59e7c1109fb205c739d1cff4c672fe2d251963f4d48c8701d16****

{
    "InstanceId":"mysql-d4942fd7****",
    "Offset": 1,
    "Limit": 10
}

返回示例

正常返回示例

{
    "ResponseMetadata": {
        "RequestId": "20230811152136EB5273F2DB960380D5E4",
        "Action": "DescribeFailoverLogs",
        "Version": "2022-01-01",
        "Service": "rds_mysql",
        "Region": "cn-beijing"
    },
    "Result": {
        "FailoverQueryInfos": [
            {
                "ChangeTime": "2024-02-07 11:22:14",
                "Details": "{\"old_master\":\"mysql-55aee4ba****-0\",\"new_master\":\"mysql-55aee4ba****-1\",\"switch_type\":\"TakeOver\",\"timestamp\":\"2024-02-07 11:22:14\",\"rt\":[{\"prepare_set_readonly\":\"4.997322ms\"},{\"prepare_catchup\":\"5.998187ms\"},{\"prepare_get_prob_info\":\"3.951µs\"},{\"reason\":\"RestartDBInstance\"},{\"reduceSlave\":\"22.640766ms\"},{\"promoteMaster\":\"3.02162ms\"},{\"updateZk\":\"27.17664ms\"},{\"node_ip\":\"33.140.27.152\"}],\"prob_info\":{\"mysql-55aee4ba****-0\":{\"custom_rpl_delay\":0,\"data_disk_state\":{\"disk_err\":\"\",\"timestamp\":\"2024-02-07T11:22:10.812925545+08:00\",\"write_latency\":0},\"disk_full\":false,\"enable_audit\":\"OFF\",\"enable_semi_master\":\"ON\",\"enable_semi_slave\":\"OFF\",\"exec_gtid_set\":[\"6a375ecc-c403-11ee-880e-52540bdb2ded:1-5367\",\"837c5109-c566-11ee-8477-52540bd6f48c:1-605\",\"ca8ce787-c101-11ee-8eb6-52540b7e945f:1-315459\"],\"global_read_only\":false,\"hb_status\":\"ok\",\"heart_beat_time\":\"2024-02-07T11:22:13+08:00\",\"is_db_conn_ok\":true,\"is_hb_start\":false,\"is_master\":true,\"keep_wait_timeout\":\"OFF\",\"last_errno\":\"\",\"last_error\":\"\",\"last_io_errno\":\"\",\"last_io_error\":\"\",\"last_sql_errno\":\"\",\"last_sql_error\":\"\",\"master_host\":\"\",\"master_log_file\":\"\",\"master_meta_data\":{\"gtid_set\":[\"6a375ecc-c403-11ee-880e-52540bdb2ded:1-5367\",\"837c5109-c566-11ee-8477-52540bd6f48c:1-604\",\"ca8ce787-c101-11ee-8eb6-52540b7e945f:1-315459\"],\"is_fault\":\"\",\"last_update_time\":\"2024-02-07T11:22:12.860905891+08:00\",\"master\":\"mysql-55aee4ba****-0\",\"max_gtid\":604,\"timestamp\":\"1707276132\",\"uuid\":\"837c5109-c566-11ee-8477-52540bd6f48c\",\"version\":1707275519},\"master_port\":0,\"name\":\"mysql-55aee4ba****-0\",\"prob_time\":\"2024-02-07T11:22:13.978694172+08:00\",\"readonly\":\"ON\",\"retrieve_gtid_set\":[\"\"],\"rpl_delay\":0,\"seconds_behind_master\":0,\"slave_io_running\":\"\",\"slave_io_state\":\"\",\"slave_sql_running\":\"\",\"slave_sql_running_state\":\"\",\"super_readonly\":\"OFF\",\"sync_maser_timeout\":0,\"uuid\":\"837c5109-c566-11ee-8477-52540bd6f48c\",\"wait_no_slave\":\"\",\"wait_point\":\"\",\"wait_slave_count\":0},\"mysql-55aee4ba****-1\":{\"custom_rpl_delay\":0,\"data_disk_state\":{\"disk_err\":\"\",\"timestamp\":\"2024-02-07T11:22:13.031205744+08:00\",\"write_latency\":0},\"disk_full\":false,\"enable_audit\":\"OFF\",\"enable_semi_master\":\"OFF\",\"enable_semi_slave\":\"ON\",\"exec_gtid_set\":[\"6a375ecc-c403-11ee-880e-52540bdb2ded:1-5367\",\"837c5109-c566-11ee-8477-52540bd6f48c:1-605\",\"ca8ce787-c101-11ee-8eb6-52540b7e945f:1-315459\"],\"global_read_only\":false,\"hb_status\":\"ok\",\"heart_beat_time\":\"2024-02-07T11:22:13+08:00\",\"is_db_conn_ok\":true,\"is_hb_start\":false,\"is_master\":false,\"keep_wait_timeout\":\"OFF\",\"last_errno\":\"0\",\"last_error\":\"\",\"last_io_errno\":\"0\",\"last_io_error\":\"\",\"last_sql_errno\":\"0\",\"last_sql_error\":\"\",\"master_host\":\"mysql-55aee4ba****-0.mysql-55aee4ba****.rds.svc.mysql-panel-aza-1.org\",\"master_log_file\":\"binlog.000003\",\"master_meta_data\":{\"gtid_set\":[\"6a375ecc-c403-11ee-880e-52540bdb2ded:1-5367\",\"837c5109-c566-11ee-8477-52540bd6f48c:1-604\",\"ca8ce787-c101-11ee-8eb6-52540b7e945f:1-315459\"],\"is_fault\":\"\",\"last_update_time\":\"2024-02-07T11:22:12.860865968+08:00\",\"master\":\"mysql-55aee4ba****-0\",\"max_gtid\":604,\"timestamp\":\"1707276132\",\"uuid\":\"837c5109-c566-11ee-8477-52540bd6f48c\",\"version\":1707275519}}",
                "HAChangeType": "TakeOver",
                "NewMaster": "mysql-55aee4ba****-1",
                "OldMaster": "mysql-55aee4ba****-0",
                "Reason": "实例重启"
            }
        ],
        "Total": 1
    }
}

错误码

更多详情,请参见错误码