Pulsar admin CLI
Important
This page is deprecated and not updated anymore. For the latest and complete information about
Pulsar admin, including commands, flags, descriptions, and more, see Pulsar admin doc
The pulsar-admin tool enables you to manage Pulsar installations, including clusters, brokers, namespaces, tenants, and more.
Usage
$ pulsar-admin command
Commands
-
broker-stats -
brokers -
clusters -
functions -
functions-worker -
namespaces -
ns-isolation-policy -
sourcesFor more information, see here
-
sinksFor more information, see here
-
topics -
tenants -
resource-quotas -
schemas
broker-stats
Operations to collect broker statistics
$ pulsar-admin broker-stats subcommand
Subcommands
allocator-statstopics(destinations)mbeansmonitoring-metricsload-report
allocator-stats
Dump allocator stats
Usage
$ pulsar-admin broker-stats allocator-stats allocator-name
topics(destinations)
Dump topic stats
Usage
$ pulsar-admin broker-stats topics options
Options
| Flag | Description | Default |
|---|---|---|
-i, --indent | Indent JSON output | false |
mbeans
Dump Mbean stats
Usage
$ pulsar-admin broker-stats mbeans options
Options
| Flag | Description | Default |
|---|---|---|
-i, --indent | Indent JSON output | false |
monitoring-metrics
Dump metrics for monitoring
Usage
$ pulsar-admin broker-stats monitoring-metrics options
Options
| Flag | Description | Default |
|---|---|---|
-i, --indent | Indent JSON output | false |
load-report
Dump broker load-report
Usage
$ pulsar-admin broker-stats load-report
brokers
Operations about brokers
$ pulsar-admin brokers subcommand
Subcommands
listnamespacesupdate-dynamic-configlist-dynamic-configget-all-dynamic-configget-internal-configget-runtime-confighealthcheck
list
List active brokers of the cluster
Usage
$ pulsar-admin brokers list cluster-name
leader-broker
Get the information of the leader broker
Usage
$ pulsar-admin brokers leader-broker
namespaces
List namespaces owned by the broker
Usage
$ pulsar-admin brokers namespaces cluster-name options
Options
| Flag | Description | Default |
|---|---|---|
--url | The URL for the broker |
update-dynamic-config
Update a broker's dynamic service configuration
Usage
$ pulsar-admin brokers update-dynamic-config options
Options
| Flag | Description | Default |
|---|---|---|
--config | Service configuration parameter name | |
--value | Value for the configuration parameter value specified using the --config flag |
list-dynamic-config
Get list of updatable configuration name
Usage
$ pulsar-admin brokers list-dynamic-config
delete-dynamic-config
Delete dynamic-serviceConfiguration of broker
Usage
$ pulsar-admin brokers delete-dynamic-config options
Options
| Flag | Description | Default |
|---|---|---|
--config | Service configuration parameter name |
get-all-dynamic-config
Get all overridden dynamic-configuration values
Usage
$ pulsar-admin brokers get-all-dynamic-config
get-internal-config
Get internal configuration information
Usage
$ pulsar-admin brokers get-internal-config
get-runtime-config
Get runtime configuration values
Usage
$ pulsar-admin brokers get-runtime-config
healthcheck
Run a health check against the broker
Usage
$ pulsar-admin brokers healthcheck
clusters
Operations about clusters
Usage
$ pulsar-admin clusters subcommand
Subcommands
getcreateupdatedeletelistupdate-peer-clustersget-peer-clustersget-failure-domaincreate-failure-domainupdate-failure-domaindelete-failure-domainlist-failure-domains
get
Get the configuration data for the specified cluster
Usage
$ pulsar-admin clusters get cluster-name
create
Provisions a new cluster. This operation requires Pulsar super-user privileges.
Usage
$ pulsar-admin clusters create cluster-name options
Options
| Flag | Description | Default |
|---|---|---|
--broker-url | The URL for the broker service. | |
--broker-url-secure | The broker service URL for a secure connection | |
--url | service-url | |
--url-secure | service-url for secure connection |
update
Update the configuration for a cluster
Usage
$ pulsar-admin clusters update cluster-name options
Options
| Flag | Description | Default |
|---|---|---|
--broker-url | The URL for the broker service. | |
--broker-url-secure | The broker service URL for a secure connection | |
--url | service-url | |
--url-secure | service-url for secure connection |
delete
Deletes an existing cluster
Usage
$ pulsar-admin clusters delete cluster-name
list
List the existing clusters
Usage
$ pulsar-admin clusters list
update-peer-clusters
Update peer cluster names
Usage
$ pulsar-admin clusters update-peer-clusters cluster-name options
Options
| Flag | Description | Default |
|---|---|---|
--peer-clusters | Comma separated peer cluster names (Pass empty string "" to delete list) |
get-peer-clusters
Get list of peer clusters
Usage
$ pulsar-admin clusters get-peer-clusters
get-failure-domain
Get the configuration brokers of a failure domain
Usage
$ pulsar-admin clusters get-failure-domain cluster-name options
Options
| Flag | Description | Default |
|---|---|---|
--domain-name | The failure domain name, which is a logical domain under a Pulsar cluster |
create-failure-domain
Create a new failure domain for a cluster (updates it if already created)
Usage
$ pulsar-admin clusters create-failure-domain cluster-name options
Options
| Flag | Description | Default |
|---|---|---|
--broker-list | Comma separated broker list | |
--domain-name | The failure domain name, which is a logical domain under a Pulsar cluster |
update-failure-domain
Update failure domain for a cluster (creates a new one if not exist)
Usage
$ pulsar-admin clusters update-failure-domain cluster-name options
Options
| Flag | Description | Default |
|---|---|---|
--broker-list | Comma separated broker list | |
--domain-name | The failure domain name, which is a logical domain under a Pulsar cluster |
delete-failure-domain
Delete an existing failure domain
Usage
$ pulsar-admin clusters delete-failure-domain cluster-name options
Options
| Flag | Description | Default |
|---|---|---|
--domain-name | The failure domain name, which is a logical domain under a Pulsar cluster |
list-failure-domains
List the existing failure domains for a cluster
Usage
$ pulsar-admin clusters list-failure-domains cluster-name
functions
A command-line interface for Pulsar Functions
Usage
$ pulsar-admin functions subcommand
Subcommands
localruncreatedeleteupdategetrestartstopstartstatusstatslistquerystateputstatetrigger
localrun
Run the Pulsar Function locally (rather than deploying it to the Pulsar cluster)
Usage
$ pulsar-admin functions localrun options
Options
| Flag | Description | Default |
|---|---|---|
--cpu | The cpu in cores that need to be allocated per function instance(applicable only to docker runtime) | |
--ram | The ram in bytes that need to be allocated per function instance(applicable only to process/docker runtime) | |
--disk | The disk in bytes that need to be allocated per function instance(applicable only to docker runtime) | |
--auto-ack | Whether or not the framework will automatically acknowledge messages | |
--subs-name | Pulsar source subscription name if user wants a specific subscription-name for input-topic consumer | |
--broker-service-url | The URL of the Pulsar broker | |
--classname | The function's class name | |
--custom-serde-inputs | The map of input topics to SerDe class names (as a JSON string) | |
--custom-schema-inputs | The map of input topics to Schema class names (as a JSON string) | |
--client-auth-params | Client authentication param | |
--client-auth-plugin | Client authentication plugin using which function-process can connect to broker | |
--function-config-file | The path to a YAML config file specifying the function's configuration | |
--hostname-verification-enabled | Enable hostname verification | false |
--instance-id-offset | Start the instanceIds from this offset | 0 |
--inputs | The function's input topic or topics (multiple topics can be specified as a comma-separated list) | |
--log-topic | The topic to which the function's logs are produced | |
--jar | Path to the jar file for the function (if the function is written in Java). It also supports URL path [http/https/file (file protocol assumes that file already exists on worker host)/function (package URL from packages management service)] from which worker can download the package. | |
--name | The function's name | |
--namespace | The function's namespace | |
--output | The function's output topic (If none is specified, no output is written) | |
--output-serde-classname | The SerDe class to be used for messages output by the function | |
--parallelism | The function’s parallelism factor, i.e. the number of instances of the function to run | 1 |
--processing-guarantees | The processing guarantees (aka delivery semantics) applied to the function. Possible Values: [ATLEAST_ONCE, ATMOST_ONCE, EFFECTIVELY_ONCE] | ATLEAST_ONCE |
--py | Path to the main Python file/Python Wheel file for the function (if the function is written in Python). It also supports URL path [http/https/file (file protocol assumes that file already exists on worker host)/function (package URL from packages management service)] from which worker can download the package. | |
--go | Path to the main Go executable binary for the function (if the function is written in Go). It also supports URL path [http/https/file (file protocol assumes that file already exists on worker host)/function (package URL from packages management service)] from which worker can download the package. | |
--schema-type | The builtin schema type or custom schema class name to be used for messages output by the function | |
--sliding-interval-count | The number of messages after which the window slides | |
--sliding-interval-duration-ms | The time duration after which the window slides | |
--state-storage-service-url | The URL for the state storage service. By default, it it set to the service URL of the Apache BookKeeper. This service URL must be added manually when the Pulsar Function runs locally. | |
--tenant | The function’s tenant | |
--topics-pattern | The topic pattern to consume from list of topics under a namespace that match the pattern. [--input] and [--topic-pattern] are mutually exclusive. Add SerDe class name for a pattern in --custom-serde-inputs (supported for java fun only) | |
--user-config | User-defined config key/values | |
--window-length-count | The number of messages per window | |
--window-length-duration-ms | The time duration of the window in milliseconds | |
--dead-letter-topic | The topic where all messages which could not be processed successfully are sent | |
--fqfn | The Fully Qualified Function Name (FQFN) for the function | |
--max-message-retries | How many times should we try to process a message before giving up | |
--retain-ordering | Function consumes and processes messages in order | |
--retain-key-ordering | Function consumes and processes messages in key order | |
--timeout-ms | The message timeout in milliseconds | |
--tls-allow-insecure | Allow insecure tls connection | false |
--tls-trust-cert-path | The tls trust cert file path | |
--use-tls | Use tls connection | false |
--producer-config | The custom producer configuration (as a JSON string) |
create
Create a Pulsar Function in cluster mode (i.e. deploy it on a Pulsar cluster)
Usage
$ pulsar-admin functions create options
Options
| Flag | Description | Default |
|---|---|---|
--cpu | The cpu in cores that need to be allocated per function instance(applicable only to docker runtime) | |
--ram | The ram in bytes that need to be allocated per function instance(applicable only to process/docker runtime) | |
--disk | The disk in bytes that need to be allocated per function instance(applicable only to docker runtime) | |
--auto-ack | Whether or not the framework will automatically acknowledge messages | |
--subs-name | Pulsar source subscription name if user wants a specific subscription-name for input-topic consumer | |
--classname | The function's class name | |
--custom-serde-inputs | The map of input topics to SerDe class names (as a JSON string) | |
--custom-schema-inputs | The map of input topics to Schema class names (as a JSON string) | |
--function-config-file | The path to a YAML config file specifying the function's configuration | |
--inputs | The function's input topic or topics (multiple topics can be specified as a comma-separated list) | |
--log-topic | The topic to which the function's logs are produced | |
--jar | Path to the jar file for the function (if the function is written in Java). It also supports URL path [http/https/file (file protocol assumes that file already exists on worker host)/function (package URL from packages management service)] from which worker can download the package. | |
--name | The function's name | |
--namespace | The function’s namespace | |
--output | The function's output topic (If none is specified, no output is written) | |
--output-serde-classname | The SerDe class to be used for messages output by the function | |
--parallelism | The function’s parallelism factor, i.e. the number of instances of the function to run | 1 |
--processing-guarantees | The processing guarantees (aka delivery semantics) applied to the function. Possible Values: [ATLEAST_ONCE, ATMOST_ONCE, EFFECTIVELY_ONCE] | ATLEAST_ONCE |
--py | Path to the main Python file/Python Wheel file for the function (if the function is written in Python). It also supports URL path [http/https/file (file protocol assumes that file already exists on worker host)/function (package URL from packages management service)] from which worker can download the package. | |
--go | Path to the main Go executable binary for the function (if the function is written in Go). It also supports URL path [http/https/file (file protocol assumes that file already exists on worker host)/function (package URL from packages management service)] from which worker can download the package. | |
--schema-type | The builtin schema type or custom schema class name to be used for messages output by the function | |
--sliding-interval-count | The number of messages after which the window slides | |
--sliding-interval-duration-ms | The time duration after which the window slides | |
--tenant | The function’s tenant | |
--topics-pattern | The topic pattern to consume from list of topics under a namespace that match the pattern. [--input] and [--topic-pattern] are mutually exclusive. Add SerDe class name for a pattern in --custom-serde-inputs (supported for java fun only) | |
--user-config | User-defined config key/values | |
--window-length-count | The number of messages per window | |
--window-length-duration-ms | The time duration of the window in milliseconds | |
--dead-letter-topic | The topic where all messages which could not be processed | |
--fqfn | The Fully Qualified Function Name (FQFN) for the function | |
--max-message-retries | How many times should we try to process a message before giving up | |
--retain-ordering | Function consumes and processes messages in order | |
--retain-key-ordering | Function consumes and processes messages in key order | |
--timeout-ms | The message timeout in milliseconds | |
--producer-config | The custom producer configuration (as a JSON string) |
delete
Delete a Pulsar Function that's running on a Pulsar cluster
Usage
$ pulsar-admin functions delete options
Options
| Flag | Description | Default |
|---|---|---|
--fqfn | The Fully Qualified Function Name (FQFN) for the function | |
--name | The function's name | |
--namespace | The function's namespace | |
--tenant | The function's tenant |
update
Update a Pulsar Function that's been deployed to a Pulsar cluster
Usage
$ pulsar-admin functions update options
Options
| Flag | Description | Default |
|---|---|---|
--cpu | The cpu in cores that need to be allocated per function instance(applicable only to docker runtime) | |
--ram | The ram in bytes that need to be allocated per function instance(applicable only to process/docker runtime) | |
--disk | The disk in bytes that need to be allocated per function instance(applicable only to docker runtime) | |
--auto-ack | Whether or not the framework will automatically acknowledge messages | |
--subs-name | Pulsar source subscription name if user wants a specific subscription-name for input-topic consumer | |
--classname | The function's class name | |
--custom-serde-inputs | The map of input topics to SerDe class names (as a JSON string) | |
--custom-schema-inputs | The map of input topics to Schema class names (as a JSON string) | |
--function-config-file | The path to a YAML config file specifying the function's configuration | |
--inputs | The function's input topic or topics (multiple topics can be specified as a comma-separated list) | |
--log-topic | The topic to which the function's logs are produced | |
--jar | Path to the jar file for the function (if the function is written in Java). It also supports URL path [http/https/file (file protocol assumes that file already exists on worker host)/function (package URL from packages management service)] from which worker can download the package. | |
--name | The function's name | |
--namespace | The function’s namespace | |
--output | The function's output topic (If none is specified, no output is written) | |
--output-serde-classname | The SerDe class to be used for messages output by the function | |
--parallelism | The function’s parallelism factor, i.e. the number of instances of the function to run | 1 |
--processing-guarantees | The processing guarantees (aka delivery semantics) applied to the function. Possible Values: [ATLEAST_ONCE, ATMOST_ONCE, EFFECTIVELY_ONCE] | ATLEAST_ONCE |
--py | Path to the main Python file/Python Wheel file for the function (if the function is written in Python). It also supports URL path [http/https/file (file protocol assumes that file already exists on worker host)/function (package URL from packages management service)] from which worker can download the package. | |
--go | Path to the main Go executable binary for the function (if the function is written in Go). It also supports URL path [http/https/file (file protocol assumes that file already exists on worker host)/function (package URL from packages management service)] from which worker can download the package. | |
--schema-type | The builtin schema type or custom schema class name to be used for messages output by the function | |
--sliding-interval-count | The number of messages after which the window slides | |
--sliding-interval-duration-ms | The time duration after which the window slides | |
--tenant | The function’s tenant | |
--topics-pattern | The topic pattern to consume from list of topics under a namespace that match the pattern. [--input] and [--topic-pattern] are mutually exclusive. Add SerDe class name for a pattern in --custom-serde-inputs (supported for java fun only) | |
--user-config | User-defined config key/values | |
--window-length-count | The number of messages per window | |
--window-length-duration-ms | The time duration of the window in milliseconds | |
--dead-letter-topic | The topic where all messages which could not be processed | |
--fqfn | The Fully Qualified Function Name (FQFN) for the function | |
--max-message-retries | How many times should we try to process a message before giving up | |
--retain-ordering | Function consumes and processes messages in order | |
--retain-key-ordering | Function consumes and processes messages in key order | |
--timeout-ms | The message timeout in milliseconds | |
--producer-config | The custom producer configuration (as a JSON string) |
get
Fetch information about a Pulsar Function
Usage
$ pulsar-admin functions get options
Options
| Flag | Description | Default |
|---|---|---|
--fqfn | The Fully Qualified Function Name (FQFN) for the function | |
--name | The function's name | |
--namespace | The function's namespace | |
--tenant | The function's tenant |
restart
Restart function instance
Usage
$ pulsar-admin functions restart options
Options
| Flag | Description | Default |
|---|---|---|
--fqfn | The Fully Qualified Function Name (FQFN) for the function | |
--instance-id | The function instanceId (restart all instances if instance-id is not provided) | |
--name | The function's name | |
--namespace | The function's namespace | |
--tenant | The function's tenant |
stop
Stops function instance
Usage
$ pulsar-admin functions stop options
Options
| Flag | Description | Default |
|---|---|---|
--fqfn | The Fully Qualified Function Name (FQFN) for the function | |
--instance-id | The function instanceId (stop all instances if instance-id is not provided) | |
--name | The function's name | |
--namespace | The function's namespace | |
--tenant | The function's tenant |
start
Starts a stopped function instance
Usage
$ pulsar-admin functions start options
Options
| Flag | Description | Default |
|---|---|---|
--fqfn | The Fully Qualified Function Name (FQFN) for the function | |
--instance-id | The function instanceId (start all instances if instance-id is not provided) | |
--name | The function's name | |
--namespace | The function's namespace | |
--tenant | The function's tenant |
status
Check the current status of a Pulsar Function
Usage
$ pulsar-admin functions status options
Options
| Flag | Description | Default |
|---|---|---|
--fqfn | The Fully Qualified Function Name (FQFN) for the function | |
--instance-id | The function instanceId (Get-status of all instances if instance-id is not provided) | |
--name | The function's name | |
--namespace | The function's namespace | |
--tenant | The function's tenant |
stats
Get the current stats of a Pulsar Function
Usage
$ pulsar-admin functions stats options
Options
| Flag | Description | Default |
|---|---|---|
--fqfn | The Fully Qualified Function Name (FQFN) for the function | |
--instance-id | The function instanceId (Get-stats of all instances if instance-id is not provided) | |
--name | The function's name | |
--namespace | The function's namespace | |
--tenant | The function's tenant |
list
List all of the Pulsar Functions running under a specific tenant and namespace
Usage
$ pulsar-admin functions list options
Options
| Flag | Description | Default |
|---|---|---|
--namespace | The function's namespace | |
--tenant | The function's tenant |
querystate
Fetch the current state associated with a Pulsar Function running in cluster mode
Usage
$ pulsar-admin functions querystate options
Options
| Flag | Description | Default |
|---|---|---|
--fqfn | The Fully Qualified Function Name (FQFN) for the function | |
-k, --key | The key for the state you want to fetch | |
--name | The function's name | |
--namespace | The function's namespace | |
--tenant | The function's tenant | |
-w, --watch | Watch for changes in the value associated with a key for a Pulsar Function | false |