- Docs Home
- About TiDB
- Quick Start
- Develop
- Overview
- Quick Start
- Build a TiDB Cluster in TiDB Cloud (Developer Tier)
- CRUD SQL in TiDB
- Build a Simple CRUD App with TiDB
- Example Applications
- Connect to TiDB
- Design Database Schema
- Write Data
- Read Data
- Transaction
- Optimize
- Troubleshoot
- Reference
- Cloud Native Development Environment
- Third-party Support
- Deploy
- Software and Hardware Requirements
- Environment Configuration Checklist
- Plan Cluster Topology
- Install and Start
- Verify Cluster Status
- Test Cluster Performance
- Migrate
- Overview
- Migration Tools
- Migration Scenarios
- Migrate from Aurora
- Migrate MySQL of Small Datasets
- Migrate MySQL of Large Datasets
- Migrate and Merge MySQL Shards of Small Datasets
- Migrate and Merge MySQL Shards of Large Datasets
- Migrate from CSV Files
- Migrate from SQL Files
- Migrate from One TiDB Cluster to Another TiDB Cluster
- Migrate from TiDB to MySQL-compatible Databases
- Advanced Migration
- Integrate
- Overview
- Integration Scenarios
- Maintain
- Monitor and Alert
- Troubleshoot
- TiDB Troubleshooting Map
- Identify Slow Queries
- Analyze Slow Queries
- SQL Diagnostics
- Identify Expensive Queries Using Top SQL
- Identify Expensive Queries Using Logs
- Statement Summary Tables
- Troubleshoot Hotspot Issues
- Troubleshoot Increased Read and Write Latency
- Save and Restore the On-Site Information of a Cluster
- Troubleshoot Cluster Setup
- Troubleshoot High Disk I/O Usage
- Troubleshoot Lock Conflicts
- Troubleshoot TiFlash
- Troubleshoot Write Conflicts in Optimistic Transactions
- Troubleshoot Inconsistency Between Data and Indexes
- Performance Tuning
- Tuning Guide
- Configuration Tuning
- System Tuning
- Software Tuning
- SQL Tuning
- Overview
- Understanding the Query Execution Plan
- SQL Optimization Process
- Overview
- Logic Optimization
- Physical Optimization
- Prepare Execution Plan Cache
- Control Execution Plans
- Tutorials
- TiDB Tools
- Overview
- Use Cases
- Download
- TiUP
- Documentation Map
- Overview
- Terminology and Concepts
- Manage TiUP Components
- FAQ
- Troubleshooting Guide
- Command Reference
- Overview
- TiUP Commands
- TiUP Cluster Commands
- Overview
- tiup cluster audit
- tiup cluster check
- tiup cluster clean
- tiup cluster deploy
- tiup cluster destroy
- tiup cluster disable
- tiup cluster display
- tiup cluster edit-config
- tiup cluster enable
- tiup cluster help
- tiup cluster import
- tiup cluster list
- tiup cluster patch
- tiup cluster prune
- tiup cluster reload
- tiup cluster rename
- tiup cluster replay
- tiup cluster restart
- tiup cluster scale-in
- tiup cluster scale-out
- tiup cluster start
- tiup cluster stop
- tiup cluster template
- tiup cluster upgrade
- TiUP DM Commands
- Overview
- tiup dm audit
- tiup dm deploy
- tiup dm destroy
- tiup dm disable
- tiup dm display
- tiup dm edit-config
- tiup dm enable
- tiup dm help
- tiup dm import
- tiup dm list
- tiup dm patch
- tiup dm prune
- tiup dm reload
- tiup dm replay
- tiup dm restart
- tiup dm scale-in
- tiup dm scale-out
- tiup dm start
- tiup dm stop
- tiup dm template
- tiup dm upgrade
- TiDB Cluster Topology Reference
- DM Cluster Topology Reference
- Mirror Reference Guide
- TiUP Components
- PingCAP Clinic Diagnostic Service
- TiDB Operator
- Dumpling
- TiDB Lightning
- TiDB Data Migration
- About TiDB Data Migration
- Architecture
- Quick Start
- Deploy a DM cluster
- Tutorials
- Advanced Tutorials
- Maintain
- Cluster Upgrade
- Tools
- Performance Tuning
- Manage Data Sources
- Manage Tasks
- Export and Import Data Sources and Task Configurations of Clusters
- Handle Alerts
- Daily Check
- Reference
- Architecture
- Command Line
- Configuration Files
- OpenAPI
- Compatibility Catalog
- Secure
- Monitoring and Alerts
- Error Codes
- Glossary
- Example
- Troubleshoot
- Release Notes
- Backup & Restore (BR)
- Point-in-Time Recovery
- TiDB Binlog
- TiCDC
- Dumpling
- sync-diff-inspector
- TiSpark
- Reference
- Cluster Architecture
- Key Monitoring Metrics
- Secure
- Privileges
- SQL
- SQL Language Structure and Syntax
- SQL Statements
ADD COLUMN
ADD INDEX
ADMIN
ADMIN CANCEL DDL
ADMIN CHECKSUM TABLE
ADMIN CHECK [TABLE|INDEX]
ADMIN SHOW DDL [JOBS|QUERIES]
ADMIN SHOW TELEMETRY
ALTER DATABASE
ALTER INDEX
ALTER INSTANCE
ALTER PLACEMENT POLICY
ALTER TABLE
ALTER TABLE COMPACT
ALTER TABLE SET TIFLASH MODE
ALTER USER
ANALYZE TABLE
BACKUP
BATCH
BEGIN
CHANGE COLUMN
COMMIT
CHANGE DRAINER
CHANGE PUMP
CREATE [GLOBAL|SESSION] BINDING
CREATE DATABASE
CREATE INDEX
CREATE PLACEMENT POLICY
CREATE ROLE
CREATE SEQUENCE
CREATE TABLE LIKE
CREATE TABLE
CREATE USER
CREATE VIEW
DEALLOCATE
DELETE
DESC
DESCRIBE
DO
DROP [GLOBAL|SESSION] BINDING
DROP COLUMN
DROP DATABASE
DROP INDEX
DROP PLACEMENT POLICY
DROP ROLE
DROP SEQUENCE
DROP STATS
DROP TABLE
DROP USER
DROP VIEW
EXECUTE
EXPLAIN ANALYZE
EXPLAIN
FLASHBACK TABLE
FLUSH PRIVILEGES
FLUSH STATUS
FLUSH TABLES
GRANT <privileges>
GRANT <role>
INSERT
KILL [TIDB]
LOAD DATA
LOAD STATS
MODIFY COLUMN
PREPARE
RECOVER TABLE
RENAME INDEX
RENAME TABLE
REPLACE
RESTORE
REVOKE <privileges>
REVOKE <role>
ROLLBACK
SAVEPOINT
SELECT
SET DEFAULT ROLE
SET [NAMES|CHARACTER SET]
SET PASSWORD
SET ROLE
SET TRANSACTION
SET [GLOBAL|SESSION] <variable>
SHOW ANALYZE STATUS
SHOW [BACKUPS|RESTORES]
SHOW [GLOBAL|SESSION] BINDINGS
SHOW BUILTINS
SHOW CHARACTER SET
SHOW COLLATION
SHOW [FULL] COLUMNS FROM
SHOW CONFIG
SHOW CREATE PLACEMENT POLICY
SHOW CREATE SEQUENCE
SHOW CREATE TABLE
SHOW CREATE USER
SHOW DATABASES
SHOW DRAINER STATUS
SHOW ENGINES
SHOW ERRORS
SHOW [FULL] FIELDS FROM
SHOW GRANTS
SHOW INDEX [FROM|IN]
SHOW INDEXES [FROM|IN]
SHOW KEYS [FROM|IN]
SHOW MASTER STATUS
SHOW PLACEMENT
SHOW PLACEMENT FOR
SHOW PLACEMENT LABELS
SHOW PLUGINS
SHOW PRIVILEGES
SHOW [FULL] PROCESSSLIST
SHOW PROFILES
SHOW PUMP STATUS
SHOW SCHEMAS
SHOW STATS_HEALTHY
SHOW STATS_HISTOGRAMS
SHOW STATS_META
SHOW STATUS
SHOW TABLE NEXT_ROW_ID
SHOW TABLE REGIONS
SHOW TABLE STATUS
SHOW [FULL] TABLES
SHOW [GLOBAL|SESSION] VARIABLES
SHOW WARNINGS
SHUTDOWN
SPLIT REGION
START TRANSACTION
TABLE
TRACE
TRUNCATE
UPDATE
USE
WITH
- Data Types
- Functions and Operators
- Overview
- Type Conversion in Expression Evaluation
- Operators
- Control Flow Functions
- String Functions
- Numeric Functions and Operators
- Date and Time Functions
- Bit Functions and Operators
- Cast Functions and Operators
- Encryption and Compression Functions
- Locking Functions
- Information Functions
- JSON Functions
- Aggregate (GROUP BY) Functions
- Window Functions
- Miscellaneous Functions
- Precision Math
- Set Operations
- List of Expressions for Pushdown
- TiDB Specific Functions
- Clustered Indexes
- Constraints
- Generated Columns
- SQL Mode
- Table Attributes
- Transactions
- Garbage Collection (GC)
- Views
- Partitioning
- Temporary Tables
- Cached Tables
- Character Set and Collation
- Placement Rules in SQL
- System Tables
mysql
- INFORMATION_SCHEMA
- Overview
ANALYZE_STATUS
CLIENT_ERRORS_SUMMARY_BY_HOST
CLIENT_ERRORS_SUMMARY_BY_USER
CLIENT_ERRORS_SUMMARY_GLOBAL
CHARACTER_SETS
CLUSTER_CONFIG
CLUSTER_HARDWARE
CLUSTER_INFO
CLUSTER_LOAD
CLUSTER_LOG
CLUSTER_SYSTEMINFO
COLLATIONS
COLLATION_CHARACTER_SET_APPLICABILITY
COLUMNS
DATA_LOCK_WAITS
DDL_JOBS
DEADLOCKS
ENGINES
INSPECTION_RESULT
INSPECTION_RULES
INSPECTION_SUMMARY
KEY_COLUMN_USAGE
METRICS_SUMMARY
METRICS_TABLES
PARTITIONS
PLACEMENT_POLICIES
PROCESSLIST
REFERENTIAL_CONSTRAINTS
SCHEMATA
SEQUENCES
SESSION_VARIABLES
SLOW_QUERY
STATISTICS
TABLES
TABLE_CONSTRAINTS
TABLE_STORAGE_STATS
TIDB_HOT_REGIONS
TIDB_HOT_REGIONS_HISTORY
TIDB_INDEXES
TIDB_SERVERS_INFO
TIDB_TRX
TIFLASH_REPLICA
TIKV_REGION_PEERS
TIKV_REGION_STATUS
TIKV_STORE_STATUS
USER_PRIVILEGES
VARIABLES_INFO
VIEWS
METRICS_SCHEMA
- UI
- TiDB Dashboard
- Overview
- Maintain
- Access
- Overview Page
- Cluster Info Page
- Top SQL Page
- Key Visualizer Page
- Metrics Relation Graph
- SQL Statements Analysis
- Slow Queries Page
- Cluster Diagnostics
- Monitoring Page
- Search Logs Page
- Instance Profiling
- Session Management and Configuration
- FAQ
- CLI
- Command Line Flags
- Configuration File Parameters
- System Variables
- Storage Engines
- Telemetry
- Errors Codes
- Table Filter
- Schedule Replicas by Topology Labels
- FAQs
- Release Notes
- All Releases
- Release Timeline
- TiDB Versioning
- TiDB Installation Packages
- v6.2
- v6.1
- v6.0
- v5.4
- v5.3
- v5.2
- v5.1
- v5.0
- v4.0
- v3.1
- v3.0
- v2.1
- v2.0
- v1.0
- Glossary
TiCDC OpenAPI
TiCDC provides the OpenAPI feature for querying and operating the TiCDC cluster, which is similar to the feature of cdc cli
tool.
You can use the APIs to perform the following maintenance operations on the TiCDC cluster:
- Get the status information of a TiCDC node
- Check the health status of a TiCDC cluster
- Create a replication task
- Remove a replication task
- Update the replication configuration
- Query the replication task list
- Query a specific replication task
- Pause a replication task
- Resume a replication task
- Query the replication subtask list
- Query a specific replication subtask
- Query the TiCDC service process list
- Evict an owner node
- Manually trigger the load balancing of all tables in a replication task
- Manually schedule a table to another node
- Dynamically adjust the log level of the TiCDC server
The request body and returned value of all APIs are in JSON format. The following sections describe the specific usage of the APIs.
In the following examples, the listening IP address of the TiCDC server is 127.0.0.1
and the port is 8300
. You can bind a specified IP and port via --addr=ip:port
when starting the TiCDC server.
API error message template
After sending an API request, if an error occurs, the returned error message is in the following format:
{
"error_msg": "",
"error_code": ""
}
From the above JSON output, error_msg
describes the error message and error_code
is the corresponding error code.
Get the status information of a TiCDC node
This API is a synchronous interface. If the request is successful, the status information of the corresponding node is returned.
Request URI
GET /api/v1/status
Example
The following request gets the status information of the TiCDC node whose IP address is 127.0.0.1
and port number is 8300
.
curl -X GET http://127.0.0.1:8300/api/v1/status
{
"version": "v5.2.0-master-dirty",
"git_hash": "f191cd00c53fdf7a2b1c9308a355092f9bf8824e",
"id": "c6a43c16-0717-45af-afd6-8b3e01e44f5d",
"pid": 25432,
"is_owner": true
}
The fields of the above output are described as follows:
- version: The current TiCDC version number.
- git_hash: The Git hash value.
- id: The capture ID of the node.
- pid: The capture process PID of the node.
- is_owner: Indicates whether the node is an owner.
Check the health status of a TiCDC cluster
This API is a synchronous interface. If the cluster is healthy, 200 OK
is returned.
Request URI
GET /api/v1/health
Example
curl -X GET http://127.0.0.1:8300/api/v1/health
Create a replication task
This API is an asynchronous interface. If the request is successful, 202 Accepted
is returned. The returned result only means that the server agrees to run the command but does not guarantee that the command will be run successfully.
Request URI
POST /api/v1/changefeeds
Parameter description
Compared to the optional parameters for creating a replication task using the cli
command, the optional parameters for creating such task using the API are not as complete. This API supports the following parameters.
Parameters for the request body
Parameter name | Description |
---|---|
changefeed_id | STRING type. The ID of the replication task. (Optional) |
start_ts | UINT64 type. Specifies the start TSO of the changefeed. (Optional) |
target_ts | UINT64 type. Specifies the target TSO of the changefeed. (Optional) |
sink_uri | STRING type. The downstream address of the replication task. (Required) |
force_replicate | BOOLEAN type. Determines whether to forcibly replicate the tables without unique indexes. (Optional) |
ignore_ineligible_table | BOOLEAN type. Determines whether to ignore the tables that cannot be replicated. (Optional) |
filter_rules | STRING type array. The rules for table schema filtering. (Optional) |
ignore_txn_start_ts | UINT64 type array. Ignores the transaction of a specified start_ts. (Optional) |
mounter_worker_num | INT type. The mounter thread number. (Optional) |
sink_config | The configuration parameters of sink. (Optional) |
The meaning and format of changefeed_id
, start_ts
, target_ts
, and sink_uri
are the same as those described in the Use cdc cli
to create a replication task document. For the detailed description of these parameters, see this document. Note that when you specify the certificate path in sink_uri
, make sure you have uploaded the corresponding certificate to the corresponding TiCDC server.
Some other parameters in the above table are described further as follows.
force_replicate
: This parameter defaults to false
. When it is specified as true
, TiCDC tries to forcibly replicate tables that do not have a unique index.
ignore_ineligible_table
: This parameter defaults to false
. When it is specified as true
, TiCDC ignores tables that cannot be replicated.
filter_rules
: The rules for table schema filtering, such as filter_rules = ['foo*.*','bar*.*']
. For details, see the Table Filter document.
ignore_txn_start_ts
: When this parameter is specified, the specified start_ts is ignored. For example, ignore-txn-start-ts = [1, 2]
.
mounter_worker_num
: The thread number of mounter. Mounter is used to decode the data output from TiKV. The default value is 16
.
The configuration parameters of sink are as follows:
{
"dispatchers":[
{"matcher":["test1.*", "test2.*"], "dispatcher":"ts"},
{"matcher":["test3.*", "test4.*"], "dispatcher":"rowid"}
],
"protocal":"canal-json"
}
dispatchers
: For the sink of MQ type, you can use dispatchers to configure the event dispatcher. Four dispatchers are supported: default
, ts
, rowid
, and table
. The dispatcher rules are as follows:
default
: When multiple unique indexes (including the primary key) exist or the Old Value feature is enabled, events are dispatched in thetable
mode. When only one unique index (or the primary key) exists, events are dispatched in therowid
mode.ts
: Uses the commitTs of the row change to create the hash value and dispatch events.rowid
: Uses the name and value of the selected HandleKey column to create the hash value and dispatch events.table
: Uses the schema name of the table and the table name to create the hash value and dispatch events.
matcher
: The matching syntax of matcher is the same as the filter rule syntax.
protocol
: For the sink of MQ type, you can specify the protocol format of the message. Currently the following protocols are supported: canal-json
, open-protocol
, canal
, avro
, and maxwell
.
Example
The following request creates a replication task with an ID of test5
and a sink_uri
of blackhome://
.
curl -X POST -H "'Content-type':'application/json'" http://127.0.0.1:8300/api/v1/changefeeds -d '{"changefeed_id":"test5","sink_uri":"blackhole://"}'
If the request is successful, 202 Accepted
is returned. If the request fails, an error message and error code are returned.
Remove a replication task
This API is an asynchronous interface. If the request is successful, 202 Accepted
is returned. The returned result only means that the server agrees to run the command but does not guarantee that the command will be run successfully.
Request URI
DELETE /api/v1/changefeeds/{changefeed_id}
Parameter description
Path parameters
Parameter name | Description |
---|---|
changefeed_id | The ID of the replication task (changefeed) to be removed. |
Example
The following request removes the replication task with the ID test1
.
curl -X DELETE http://127.0.0.1:8300/api/v1/changefeeds/test1
If the request is successful, 202 Accepted
is returned. If the request fails, an error message and error code are returned.
Update the replication configuration
This API is an asynchronous interface. If the request is successful, 202 Accepted
is returned. The returned result only means that the server agrees to run the command but does not guarantee that the command will be run successfully.
To modify the changefeed configuration, follow the steps of pause the replication task -> modify the configuration -> resume the replication task
.
Request URI
PUT /api/v1/changefeeds/{changefeed_id}
Parameter description
Path parameters
Parameter name | Description |
---|---|
changefeed_id | The ID of the replication task (changefeed) to be updated. |
Parameters for the request body
Currently, only the following configuration can be modified via the API.
Parameter name | Description |
---|---|
target_ts | UINT64 type. Specifies the target TSO of the changefeed. (Optional) |
sink_uri | STRING type. The downstream address of the replication task. (Optional) |
filter_rules | STRING type array. The rules for table schema filtering. (Optional) |
ignore_txn_start_ts | UINT64 type array. Ignores the transaction of a specified start_ts. (Optional) |
mounter_worker_num | INT type. The mounter thread number. (Optional) |
sink_config | The configuration parameters of sink. (Optional) |
The meanings of the above parameters are the same as those in the Create a replication task section. See that section for details.
Example
The following request updates the mounter_worker_num
of the replication task with the ID test1
to 32
.
curl -X PUT -H "'Content-type':'application/json'" http://127.0.0.1:8300/api/v1/changefeeds/test1 -d '{"mounter_worker_num":32}'
If the request is successful, 202 Accepted
is returned. If the request fails, an error message and error code are returned.
Query the replication task list
This API is a synchronous interface. If the request is successful, the basic information of all nodes in the TiCDC cluster is returned.
Request URI
GET /api/v1/changefeeds
Parameter description
Query parameters
Parameter name | Description |
---|---|
state | When this parameter is specified, the replication status information only of this state is returned.(Optional) |
The value options for state
are all
, normal
, stopped
, error
, failed
, and finished
.
If this parameter is not specified, the basic information of replication tasks whose state is normal, stopped, or failed is returned by default.
Example
The following request queries the basic information of all replication tasks whose state is normal
.
curl -X GET http://127.0.0.1:8300/api/v1/changefeeds?state=normal
[
{
"id": "test1",
"state": "normal",
"checkpoint_tso": 426921294362574849,
"checkpoint_time": "2021-08-10 14:04:54.242",
"error": null
},
{
"id": "test2",
"state": "normal",
"checkpoint_tso": 426921294362574849,
"checkpoint_time": "2021-08-10 14:04:54.242",
"error": null
}
]
The fields in the returned result above are described as follows:
- id: The ID of the replication task.
- state: The current state of the replication task.
- checkpoint_tso: The TSO representation of the current checkpoint of the replication task.
- checkpoint_tso: The formatted time representation of the current checkpoint of the replication task.
- error: The error information of the replication task.
Query a specific replication task
This API is a synchronous interface. If the request is successful, the detailed information of the specified replication task is returned.
Request URI
GET /api/v1/changefeeds/{changefeed_id}
Parameter description
Path parameters
Parameter name | Description |
---|---|
changefeed_id | The ID of the replication task (changefeed) to be queried. |
Example
The following request queries the detailed information of the replication task with the ID test1
.
curl -X GET http://127.0.0.1:8300/api/v1/changefeeds/test1
{
"id": "test1",
"sink_uri": "blackhole://",
"create_time": "2021-08-10 11:41:30.642",
"start_ts": 426919038970232833,
"target_ts": 0,
"checkpoint_tso": 426921014615867393,
"checkpoint_time": "2021-08-10 13:47:07.093",
"sort_engine": "unified",
"state": "normal",
"error": null,
"error_history": null,
"creator_version": "",
"task_status": [
{
"capture_id": "d8924259-f52f-4dfb-97a9-c48d26395945",
"table_ids": [
63,
65
],
"table_operations": {}
}
]
}
Pause a replication task
This API is an asynchronous interface. If the request is successful, 202 Accepted
is returned. The returned result only means that the server agrees to run the command but does not guarantee that the command will be run successfully.
Request URI
POST /api/v1/changefeeds/{changefeed_id}/pause
Parameter description
Path parameters
Parameter name | Description |
---|---|
changefeed_id | The ID of the replication task (changefeed) to be paused. |
Example
The following request pauses the replication task with the ID test1
.
curl -X POST http://127.0.0.1:8300/api/v1/changefeeds/test1/pause
If the request is successful, 202 Accepted
is returned. If the request fails, an error message and error code are returned.
Resume a replication task
This API is an asynchronous interface. If the request is successful, 202 Accepted
is returned. The returned result only means that the server agrees to run the command but does not guarantee that the command will be run successfully.
Request URI
POST /api/v1/changefeeds/{changefeed_id}/resume
Parameter description
Path parameters
Parameter name | Description |
---|---|
changefeed_id | The ID of the replication task (changefeed) to be resumed. |
Example
The following request resumes the replication task with the ID test1
.
curl -X POST http://127.0.0.1:8300/api/v1/changefeeds/test1/resume
If the request is successful, 202 Accepted
is returned. If the request fails, an error message and error code are returned.
Query the replication subtask list
This API is a synchronous interface. If the request is successful, the basic information of all replication subtasks (processor
) is returned.
Request URI
GET /api/v1/processors
Example
curl -X GET http://127.0.0.1:8300/api/v1/processors
[
{
"changefeed_id": "test1",
"capture_id": "561c3784-77f0-4863-ad52-65a3436db6af"
}
]
Query a specific replication subtask
This API is a synchronous interface. If the request is successful, the detailed information of the specified replication subtask (processor
) is returned.
Request URI
GET /api/v1/processors/{changefeed_id}/{capture_id}
Parameter description
Path parameters
Parameter name | Description |
---|---|
changefeed_id | The changefeed ID of the replication subtask to be queried. |
capture_id | The capture ID of the replication subtask to be queried. |
Example
The following request queries the detailed information of a subtask whose changefeed_id
is test
and capture_id
is 561c3784-77f0-4863-ad52-65a3436db6af
. A subtask can be indentifed by changefeed_id
and capture_id
.
curl -X GET http://127.0.0.1:8300/api/v1/processors/test1/561c3784-77f0-4863-ad52-65a3436db6af
{
"checkpoint_ts": 426919123303006208,
"resolved_ts": 426919123369066496,
"table_ids": [
63,
65
],
"error": null
}
Query the TiCDC service process list
This API is a synchronous interface. If the request is successful, the basic information of all replication processes (capture
) is returned.
Request URI
GET /api/v1/captures
Example
curl -X GET http://127.0.0.1:8300/api/v1/captures
[
{
"id": "561c3784-77f0-4863-ad52-65a3436db6af",
"is_owner": true,
"address": "127.0.0.1:8300"
}
]
Evict an owner node
This API is an asynchronous interface. If the request is successful, 202 Accepted
is returned. The returned result only means that the server agrees to run the command but does not guarantee that the command will be run successfully.
Request URI
POST /api/v1/owner/resign
Example
The following request evicts the current owner node of TiCDC and triggers a new round of elections to generate a new owner node.
curl -X POST http://127.0.0.1:8300/api/v1/owner/resign
If the request is successful, 202 Accepted
is returned. If the request fails, an error message and error code are returned.
Manually trigger the load balancing of all tables in a replication task
This API is an asynchronous interface. If the request is successful, 202 Accepted
is returned. The returned result only means that the server agrees to run the command but does not guarantee that the command will be run successfully.
Request URI
POST /api/v1/changefeeds/{changefeed_id}/tables/rebalance_table
Parameter description
Path parameters
Parameter name | Description |
---|---|
changefeed_id | The ID of the replication task (changefeed) to be scheduled. |
Example
The following request triggers the load balancing of all tables in the changefeed with the ID test1
.
curl -X POST http://127.0.0.1:8300/api/v1/changefeeds/test1/tables/rebalance_table
If the request is successful, 202 Accepted
is returned. If the request fails, an error message and error code are returned.
Manually schedule a table to another node
This API is an asynchronous interface. If the request is successful, 202 Accepted
is returned. The returned result only means that the server agrees to run the command but does not guarantee that the command will be run successfully.
Request URI
POST /api/v1/changefeeds/{changefeed_id}/tables/move_table
Parameter description
Path parameters
Parameter name | Description |
---|---|
changefeed_id | The ID of the replication task (changefeed) to be scheduled. |
Parameters for the request body
Parameter name | Description |
---|---|
target_capture_id | The ID of the target capture. |
table_id | The ID of the table to be scheduled. |
Example
The following request schedules the table with the ID 49
in the changefeed with the ID test1
to the capture with the ID 6f19a6d9-0f8c-4dc9-b299-3ba7c0f216f5
.
curl -X POST -H "'Content-type':'application/json'" http://127.0.0.1:8300/api/v1/changefeeds/changefeed-test1/tables/move_table -d '{"capture_id":"6f19a6d9-0f8c-4dc9-b299-3ba7c0f216f5","table_id":49}'
If the request is successful, 202 Accepted
is returned. If the request fails, an error message and error code are returned.
Dynamically adjust the log level of the TiCDC server
This API is a synchronous interface. If the request is successful, 202 OK
is returned.
Request URI
POST /api/v1/log
Request parameters
Parameters for the request body
Parameter name | Description |
---|---|
log_level | The log level you want to set. |
log_level
supports the log levels provided by zap: "debug", "info", "warn", "error", "dpanic" , "panic", and "fatal".
Example
curl -X POST -H "'Content-type':'application/json'" http://127.0.0.1:8300/api/v1/log -d '{"log_level":"debug"}'
If the request is successful, 202 OK
is returned. If the request fails, an error message and error code are returned.
- API error message template
- Get the status information of a TiCDC node
- Check the health status of a TiCDC cluster
- Create a replication task
- Remove a replication task
- Update the replication configuration
- Query the replication task list
- Query a specific replication task
- Pause a replication task
- Resume a replication task
- Query the replication subtask list
- Query a specific replication subtask
- Query the TiCDC service process list
- Evict an owner node
- Manually trigger the load balancing of all tables in a replication task
- Manually schedule a table to another node
- Dynamically adjust the log level of the TiCDC server