CREATE WORKER
Creates a worker.
Syntax
CREATE WORKER [ IF NOT EXISTS ] <worker_name>
[ WITH <option_name> = <option_value> [ , <option_name> = <option_value> ... ] ]
Parameters
Options
TiDB Cloud Lake accepts a single WITH clause followed by a comma-separated option list. Common worker options include:
WITHappears at most once.- Options are separated by commas.
- Option names are normalized to lowercase before the request is sent.
option_valuecan be written as a string literal, bare identifier, unsigned integer, or boolean.CREATE WORKERdoes not support aTAGclause.
Examples
Create a worker without options:
CREATE WORKER read_env;
Create a worker with IF NOT EXISTS:
CREATE WORKER IF NOT EXISTS read_env;
Create a worker with custom options:
CREATE WORKER IF NOT EXISTS read_env
WITH size = 'small',
auto_suspend = '300',
auto_resume = 'true',
max_cluster_count = '3',
min_cluster_count = '1';
Related Topics
- ALTER WORKER - Modify worker tags, options, or state
- SHOW WORKERS - List workers and their metadata
- DROP WORKER - Remove a worker