Pulsar admin CLI

pulsar-admin 工具能让你管理 Pulsar 安装,包括集群、broker、命名空间、租户等等。

用法

  1. $ pulsar-admin command

Commands

  • broker-stats

  • brokers

  • clusters

  • functions

  • functions-worker

  • namespaces

  • ns-isolation-policy

  • sources

    For more information, see here

  • sinks

    For more information, see here

  • topics

  • tenants

  • resource-quotas

  • schemas

broker-stats

Operations to collect broker statistics

  1. $ pulsar-admin broker-stats subcommand

Subcommands

  • allocator-stats
  • topics(destinations)
  • mbeans
  • monitoring-metrics
  • load-report

allocator-stats

Dump allocator stats

用法

  1. $ pulsar-admin broker-stats allocator-stats allocator-name

topics(destinations)

Dump topic stats

用法

  1. $ pulsar-admin broker-stats topics options

选项

标记Description默认值
-i, —indentIndent JSON outputfalse

mbeans

Dump Mbean stats

用法

  1. $ pulsar-admin broker-stats mbeans options

选项

标记Description默认值
-i, —indentIndent JSON outputfalse

monitoring-metrics

Dump metrics for monitoring

用法

  1. $ pulsar-admin broker-stats monitoring-metrics options

选项

标记Description默认值
-i, —indentIndent JSON outputfalse

load-report

Dump broker load-report

用法

  1. $ pulsar-admin broker-stats load-report

brokers

Operations about brokers

  1. $ pulsar-admin brokers subcommand

Subcommands

  • list
  • namespaces
  • update-dynamic-config
  • list-dynamic-config
  • get-all-dynamic-config
  • get-internal-config
  • get-runtime-config
  • healthcheck

list

List active brokers of the cluster

用法

  1. $ pulsar-admin brokers list cluster-name

namespaces

List namespaces owned by the broker

用法

  1. $ pulsar-admin brokers namespaces cluster-name options

选项

标记Description默认值
—urlThe URL for the broker

update-dynamic-config

Update a broker’s dynamic service configuration

用法

  1. $ pulsar-admin brokers update-dynamic-config options

选项

标记Description默认值
—configService configuration parameter name
—valueValue for the configuration parameter value specified using the —config flag

list-dynamic-config

Get list of updatable configuration name

用法

  1. $ pulsar-admin brokers list-dynamic-config

delete-dynamic-config

删除 broker 的 dynamic-serviceConfiguration

用法

  1. $ pulsar-admin brokers delete-dynamic-config options

选项

标记Description默认值
—configService configuration parameter name

get-all-dynamic-config

Get all overridden dynamic-configuration values

用法

  1. $ pulsar-admin brokers get-all-dynamic-config

get-internal-config

Get internal configuration information

用法

  1. $ pulsar-admin brokers get-internal-config

get-runtime-config

Get runtime configuration values

用法

  1. $ pulsar-admin brokers get-runtime-config

healthcheck

Run a health check against the broker

用法

  1. $ pulsar-admin brokers healthcheck

clusters

Operations about clusters

用法

  1. $ pulsar-admin clusters subcommand

Subcommands

  • get
  • create
  • update
  • delete
  • list
  • update-peer-clusters
  • get-peer-clusters
  • get-failure-domain
  • create-failure-domain
  • update-failure-domain
  • delete-failure-domain
  • list-failure-domains

get

Get the configuration data for the specified cluster

用法

  1. $ pulsar-admin clusters get cluster-name

create

Provisions a new cluster. This operation requires Pulsar super-user privileges.

用法

  1. $ pulsar-admin clusters create cluster-name options

选项

标记Description默认值
—broker-urlThe URL for the broker service.
—broker-url-secureThe broker service URL for a secure connection
—urlservice-url
—url-secureservice-url for secure connection

update

Update the configuration for a cluster

用法

  1. $ pulsar-admin clusters update cluster-name options

选项

标记Description默认值
—broker-urlThe URL for the broker service.
—broker-url-secureThe broker service URL for a secure connection
—urlservice-url
—url-secureservice-url for secure connection

delete

Deletes an existing cluster

用法

  1. $ pulsar-admin clusters delete cluster-name

list

List the existing clusters

用法

  1. $ pulsar-admin clusters list

update-peer-clusters

Update peer cluster names

用法

  1. $ pulsar-admin clusters update-peer-clusters cluster-name options

选项

标记Description默认值
—peer-clustersComma separated peer cluster names (Pass empty string “” to delete list)

get-peer-clusters

Get list of peer clusters

用法

  1. $ pulsar-admin clusters get-peer-clusters

get-failure-domain

Get the configuration brokers of a failure domain

用法

  1. $ pulsar-admin clusters get-failure-domain cluster-name options

选项

标记Description默认值
—domain-nameThe 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)

用法

  1. $ pulsar-admin clusters create-failure-domain cluster-name options

选项

标记Description默认值
—broker-listComma separated broker list
—domain-nameThe 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)

用法

  1. $ pulsar-admin clusters update-failure-domain cluster-name options

选项

标记Description默认值
—broker-listComma separated broker list
—domain-nameThe failure domain name, which is a logical domain under a Pulsar cluster

delete-failure-domain

Delete an existing failure domain

用法

  1. $ pulsar-admin clusters delete-failure-domain cluster-name options

选项

标记Description默认值
—domain-nameThe failure domain name, which is a logical domain under a Pulsar cluster

list-failure-domains

List the existing failure domains for a cluster

用法

  1. $ pulsar-admin clusters list-failure-domains cluster-name

functions

A command-line interface for Pulsar Functions

用法

  1. $ pulsar-admin functions subcommand

Subcommands

  • localrun
  • create
  • delete
  • update
  • get
  • restart
  • stop
  • start
  • status
  • stats
  • list
  • querystate
  • putstate
  • trigger

localrun

Run the Pulsar Function locally (rather than deploying it to the Pulsar cluster)

用法

  1. $ pulsar-admin functions localrun options

选项

标记Description默认值
—cpuThe cpu in cores that need to be allocated per function instance(applicable only to docker runtime)
—ramThe ram in bytes that need to be allocated per function instance(applicable only to process/docker runtime)
—diskThe disk in bytes that need to be allocated per function instance(applicable only to docker runtime)
—auto-ackWhether or not the framework will automatically acknowledge messages
—subs-namePulsar source subscription name if user wants a specific subscription-name for input-topic consumer
—broker-service-urlThe URL of the Pulsar broker
—classnameThe function’s class name
—custom-serde-inputsThe map of input topics to SerDe class names (as a JSON string)
—custom-schema-inputsThe map of input topics to Schema class names (as a JSON string)
—client-auth-paramsClient authentication param
—client-auth-pluginClient authentication plugin using which function-process can connect to broker
—function-config-fileThe path to a YAML config file specifying the function’s configuration
—hostname-verification-enabledEnable hostname verificationfalse
—instance-id-offsetStart the instanceIds from this offset0
—inputsThe function’s input topic or topics (multiple topics can be specified as a comma-separated list)
—log-topicThe topic to which the function’s logs are produced
—jarPath 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)] from which worker can download the package.
—nameThe function’s name
—namespaceThe function’s namespace
—outputThe function’s output topic (If none is specified, no output is written)
—output-serde-classnameThe SerDe class to be used for messages output by the function
—parallelismThe function’s parallelism factor, i.e. the number of instances of the function to run1
—processing-guaranteesThe processing guarantees (aka delivery semantics) applied to the function. Possible Values: [ATLEAST_ONCE, ATMOST_ONCE, EFFECTIVELY_ONCE]ATLEAST_ONCE
—pyPath to the main Python file/Python Wheel file for the function (if the function is written in Python)
—schema-typeThe builtin schema type or custom schema class name to be used for messages output by the function
—sliding-interval-countThe number of messages after which the window slides
—sliding-interval-duration-msThe time duration after which the window slides
—state-storage-service-urlThe 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.
—tenantThe function’s tenant
—topics-patternThe 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-configUser-defined config key/values
—window-length-countThe number of messages per window
—window-length-duration-msThe time duration of the window in milliseconds
—dead-letter-topicThe topic where all messages which could not be processed successfully are sent
—fqfnThe Fully Qualified Function Name (FQFN) for the function
—max-message-retriesHow many times should we try to process a message before giving up
—retain-orderingFunction consumes and processes messages in order
—timeout-msThe message timeout in milliseconds
—tls-allow-insecureAllow insecure tls connectionfalse
—tls-trust-cert-pathThe tls trust cert file path
—use-tlsUse tls connectionfalse

create

Create a Pulsar Function in cluster mode (i.e. deploy it on a Pulsar cluster)

用法

  1. $ pulsar-admin functions create options

选项

标记Description默认值
—cpuThe cpu in cores that need to be allocated per function instance(applicable only to docker runtime)
—ramThe ram in bytes that need to be allocated per function instance(applicable only to process/docker runtime)
—diskThe disk in bytes that need to be allocated per function instance(applicable only to docker runtime)
—auto-ackWhether or not the framework will automatically acknowledge messages
—subs-namePulsar source subscription name if user wants a specific subscription-name for input-topic consumer
—classnameThe function’s class name
—custom-serde-inputsThe map of input topics to SerDe class names (as a JSON string)
—custom-schema-inputsThe map of input topics to Schema class names (as a JSON string)
—function-config-fileThe path to a YAML config file specifying the function’s configuration
—inputsThe function’s input topic or topics (multiple topics can be specified as a comma-separated list)
—log-topicThe topic to which the function’s logs are produced
—jarPath 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)] from which worker can download the package.
—nameThe function’s name
—namespaceThe function’s namespace
—outputThe function’s output topic (If none is specified, no output is written)
—output-serde-classnameThe SerDe class to be used for messages output by the function
—parallelismThe function’s parallelism factor, i.e. the number of instances of the function to run1
—processing-guaranteesThe processing guarantees (aka delivery semantics) applied to the function. Possible Values: [ATLEAST_ONCE, ATMOST_ONCE, EFFECTIVELY_ONCE]ATLEAST_ONCE
—pyPath to the main Python file/Python Wheel file for the function (if the function is written in Python)
—schema-typeThe builtin schema type or custom schema class name to be used for messages output by the function
—sliding-interval-countThe number of messages after which the window slides
—sliding-interval-duration-msThe time duration after which the window slides
—tenantThe function’s tenant
—topics-patternThe 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-configUser-defined config key/values
—window-length-countThe number of messages per window
—window-length-duration-msThe time duration of the window in milliseconds
—dead-letter-topicThe topic where all messages which could not be processed
—fqfnThe Fully Qualified Function Name (FQFN) for the function
—max-message-retriesHow many times should we try to process a message before giving up
—retain-orderingFunction consumes and processes messages in order
—timeout-msThe message timeout in milliseconds

delete

Delete a Pulsar Function that’s running on a Pulsar cluster

用法

  1. $ pulsar-admin functions delete options

选项

标记Description默认值
—fqfnThe Fully Qualified Function Name (FQFN) for the function
—nameThe function’s name
—namespaceThe function’s namespace
—tenantThe function’s tenant

update

Update a Pulsar Function that’s been deployed to a Pulsar cluster

用法

  1. $ pulsar-admin functions update options

选项

标记Description默认值
—cpuThe cpu in cores that need to be allocated per function instance(applicable only to docker runtime)
—ramThe ram in bytes that need to be allocated per function instance(applicable only to process/docker runtime)
—diskThe disk in bytes that need to be allocated per function instance(applicable only to docker runtime)
—auto-ackWhether or not the framework will automatically acknowledge messages
—subs-namePulsar source subscription name if user wants a specific subscription-name for input-topic consumer
—classnameThe function’s class name
—custom-serde-inputsThe map of input topics to SerDe class names (as a JSON string)
—custom-schema-inputsThe map of input topics to Schema class names (as a JSON string)
—function-config-fileThe path to a YAML config file specifying the function’s configuration
—inputsThe function’s input topic or topics (multiple topics can be specified as a comma-separated list)
—log-topicThe topic to which the function’s logs are produced
—jarPath 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)] from which worker can download the package.
—nameThe function’s name
—namespaceThe function’s namespace
—outputThe function’s output topic (If none is specified, no output is written)
—output-serde-classnameThe SerDe class to be used for messages output by the function
—parallelismThe function’s parallelism factor, i.e. the number of instances of the function to run1
—processing-guaranteesThe processing guarantees (aka delivery semantics) applied to the function. Possible Values: [ATLEAST_ONCE, ATMOST_ONCE, EFFECTIVELY_ONCE]ATLEAST_ONCE
—pyPath to the main Python file/Python Wheel file for the function (if the function is written in Python)
—schema-typeThe builtin schema type or custom schema class name to be used for messages output by the function
—sliding-interval-countThe number of messages after which the window slides
—sliding-interval-duration-msThe time duration after which the window slides
—tenantThe function’s tenant
—topics-patternThe 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-configUser-defined config key/values
—window-length-countThe number of messages per window
—window-length-duration-msThe time duration of the window in milliseconds
—dead-letter-topicThe topic where all messages which could not be processed
—fqfnThe Fully Qualified Function Name (FQFN) for the function
—max-message-retriesHow many times should we try to process a message before giving up
—retain-orderingFunction consumes and processes messages in order
—timeout-msThe message timeout in milliseconds

get

Fetch information about a Pulsar Function

用法

  1. $ pulsar-admin functions get options

选项

标记Description默认值
—fqfnThe Fully Qualified Function Name (FQFN) for the function
—nameThe function’s name
—namespaceThe function’s namespace
—tenantThe function’s tenant

restart

Restart function instance

用法

  1. $ pulsar-admin functions restart options

选项

标记Description默认值
—fqfnThe Fully Qualified Function Name (FQFN) for the function
—instance-idThe function instanceId (restart all instances if instance-id is not provided)
—nameThe function’s name
—namespaceThe function’s namespace
—tenantThe function’s tenant

stop

Stops function instance

用法

  1. $ pulsar-admin functions stop options

选项

标记Description默认值
—fqfnThe Fully Qualified Function Name (FQFN) for the function
—instance-idThe function instanceId (stop all instances if instance-id is not provided)
—nameThe function’s name
—namespaceThe function’s namespace
—tenantThe function’s tenant

start

Starts a stopped function instance

用法

  1. $ pulsar-admin functions start options

选项

标记Description默认值
—fqfnThe Fully Qualified Function Name (FQFN) for the function
—instance-idThe function instanceId (start all instances if instance-id is not provided)
—nameThe function’s name
—namespaceThe function’s namespace
—tenantThe function’s tenant

status

Check the current status of a Pulsar Function

用法

  1. $ pulsar-admin functions status options

选项

标记Description默认值
—fqfnThe Fully Qualified Function Name (FQFN) for the function
—instance-idThe function instanceId (Get-status of all instances if instance-id is not provided)
—nameThe function’s name
—namespaceThe function’s namespace
—tenantThe function’s tenant

stats

Get the current stats of a Pulsar Function

用法

  1. $ pulsar-admin functions stats options

选项

标记Description默认值
—fqfnThe Fully Qualified Function Name (FQFN) for the function
—instance-idThe function instanceId (Get-stats of all instances if instance-id is not provided)
—nameThe function’s name
—namespaceThe function’s namespace
—tenantThe function’s tenant

list

List all of the Pulsar Functions running under a specific tenant and namespace

用法

  1. $ pulsar-admin functions list options

选项

标记Description默认值
—namespaceThe function’s namespace
—tenantThe function’s tenant

querystate

Fetch the current state associated with a Pulsar Function running in cluster mode

用法

  1. $ pulsar-admin functions querystate options

选项

标记Description默认值
—fqfnThe Fully Qualified Function Name (FQFN) for the function
-k, —keyThe key for the state you want to fetch
—nameThe function’s name
—namespaceThe function’s namespace
—tenantThe function’s tenant
-w, —watchWatch for changes in the value associated with a key for a Pulsar Functionfalse

putstate

将键/值对插入到与 Pulsar Function 相关联的状态

用法

  1. $ pulsar-admin functions putstate options

选项

标记Description默认值
—fqfnPulsar Function 的完全限定函数名称(FQFN)
—nameThe name of a Pulsar Function
—namespaceThe namespace of a Pulsar Function
—tenantThe tenant of a Pulsar Function
-s, —state需要被插入的 FunctionState

trigger

Triggers the specified Pulsar Function with a supplied value

用法

  1. $ pulsar-admin functions trigger options

选项

标记Description默认值
—fqfnThe Fully Qualified Function Name (FQFN) for the function
—nameThe function’s name
—namespaceThe function’s namespace
—tenantThe function’s tenant
—topicThe specific topic name that the function consumes from that you want to inject the data to
—trigger-fileThe path to the file that contains the data with which you’d like to trigger the function
—trigger-valueThe value with which you want to trigger the function

functions-worker

收集 function-worker 统计数据的操作

  1. $ pulsar-admin functions-worker subcommand

Subcommands

  • function-stats
  • get-cluster
  • get-cluster-leader
  • get-function-assignments
  • monitoring-metrics

function-stats

转储在此 broker 上运行的所有 function 的统计数据

用法

  1. $ pulsar-admin functions-worker function-stats

get-cluster

获取属于此集群的所有 worker

用法

  1. $ pulsar-admin functions-worker get-cluster

get-cluster-leader

获取 worker 集群的 leader

用法

  1. $ pulsar-admin functions-worker get-cluster-leader

get-function-assignments

获取 function 在 worker 集群中的分配情况

用法

  1. $ pulsar-admin functions-worker get-function-assignments

monitoring-metrics

转储用于监控的度量值

用法

  1. $ pulsar-admin functions-worker monitoring-metrics

namespaces

Operations for managing namespaces

  1. $ pulsar-admin namespaces subcommand

Subcommands

  • list
  • topics
  • policies
  • create
  • delete
  • set-deduplication
  • set-auto-topic-creation
  • remove-auto-topic-creation
  • set-auto-subscription-creation
  • remove-auto-subscription-creation
  • permissions
  • grant-permission
  • revoke-permission
  • grant-subscription-permission
  • revoke-subscription-permission
  • set-clusters
  • get-clusters
  • get-backlog-quotas
  • set-backlog-quota
  • remove-backlog-quota
  • get-persistence
  • set-persistence
  • get-message-ttl
  • set-message-ttl
  • remove-message-ttl
  • get-anti-affinity-group
  • set-anti-affinity-group
  • get-anti-affinity-namespaces
  • delete-anti-affinity-group
  • get-retention
  • set-retention
  • unload
  • split-bundle
  • set-dispatch-rate
  • get-dispatch-rate
  • set-replicator-dispatch-rate
  • get-replicator-dispatch-rate
  • set-subscribe-rate
  • get-subscribe-rate
  • set-subscription-dispatch-rate
  • get-subscription-dispatch-rate
  • clear-backlog
  • unsubscribe
  • set-encryption-required
  • set-delayed-delivery
  • get-delayed-delivery
  • set-subscription-auth-mode
  • get-max-producers-per-topic
  • set-max-producers-per-topic
  • get-max-consumers-per-topic
  • set-max-consumers-per-topic
  • get-max-consumers-per-subscription
  • set-max-consumers-per-subscription
  • get-max-unacked-messages-per-subscription
  • set-max-unacked-messages-per-subscription
  • get-max-unacked-messages-per-consumer
  • set-max-unacked-messages-per-consumer
  • get-compaction-threshold
  • set-compaction-threshold
  • get-offload-threshold
  • set-offload-threshold
  • get-offload-deletion-lag
  • set-offload-deletion-lag
  • clear-offload-deletion-lag
  • get-schema-autoupdate-strategy
  • set-schema-autoupdate-strategy
  • set-offload-policies
  • get-offload-policies

list

Get the namespaces for a tenant

用法

  1. $ pulsar-admin namespaces list tenant-name

topics

Get the list of topics for a namespace

用法

  1. $ pulsar-admin namespaces topics tenant/namespace

policies

Get the configuration policies of a namespace

用法

  1. $ pulsar-admin namespaces policies tenant/namespace

create

Create a new namespace

用法

  1. $ pulsar-admin namespaces create tenant/namespace options

选项

标记Description默认值
-b, —bundlesThe number of bundles to activate0
-c, —clustersList of clusters this namespace will be assigned

delete

Deletes a namespace. The namespace needs to be empty

用法

  1. $ pulsar-admin namespaces delete tenant/namespace

set-deduplication

Enable or disable message deduplication on a namespace

用法

  1. $ pulsar-admin namespaces set-deduplication tenant/namespace options

选项

标记Description默认值
—enable, -eEnable message deduplication on the specified namespacefalse
—disable, -dDisable message deduplication on the specified namespacefalse

set-auto-topic-creation

启用或禁用命名空间的 autoTopicCreation,覆盖 broker 设置

用法

  1. $ pulsar-admin namespaces set-auto-topic-creation tenant/namespace options

选项

标记Description默认值
—enable, -e在命名空间上启用 allowAutoTopicCreationfalse
—disable, -d禁用命名空间上的 allowAutoTopicCreationfalse
—type, -tType of topic to be auto-created. Possible values: (partitioned, non-partitioned)non-partitioned
—num-partitions, -n要自动创建的主题的默认分区数,仅适用于分区主题

remove-auto-topic-creation

移除对命名空间 autoTopicCreation 的覆盖

用法

  1. $ pulsar-admin namespaces remove-auto-topic-creation tenant/namespace

set-auto-subscription-creation

启用命名空间的 autoSubscriptionCreation,覆盖 broker 的设置

用法

  1. $ pulsar-admin namespaces set-auto-subscription-creation tenant/namespace options

选项

标记Description默认值
—enable, -e在命名空间上启用 allowAutoSubscriptionCreationfalse

remove-auto-subscription-creation

移除对命名空间 autoSubscriptionCreation 的覆盖

用法

  1. $ pulsar-admin namespaces remove-auto-subscription-creation tenant/namespace

permissions

Get the permissions on a namespace

用法

  1. $ pulsar-admin namespaces permissions tenant/namespace

grant-permission

Grant permissions on a namespace

用法

  1. $ pulsar-admin namespaces grant-permission tenant/namespace options

选项

标记Description默认值
—actionsActions to be granted (produce or consume)
—roleThe client role to which to grant the permissions

revoke-permission

Revoke permissions on a namespace

用法

  1. $ pulsar-admin namespaces revoke-permission tenant/namespace options

选项

标记Description默认值
—roleThe client role to which to revoke the permissions

grant-subscription-permission

Grant permissions to access subscription admin-api

用法

  1. $ pulsar-admin namespaces grant-subscription-permission tenant/namespace options

选项

标记Description默认值
—rolesThe client roles to which to grant the permissions (comma separated roles)
—subscriptionThe subscription name for which permission will be granted to roles

revoke-subscription-permission

Revoke permissions to access subscription admin-api

用法

  1. $ pulsar-admin namespaces revoke-subscription-permission tenant/namespace options

选项

标记Description默认值
—roleThe client role to which to revoke the permissions
—subscriptionThe subscription name for which permission will be revoked to roles

set-clusters

Set replication clusters for a namespace

用法

  1. $ pulsar-admin namespaces set-clusters tenant/namespace options

选项

标记Description默认值
-c, —clustersReplication clusters ID list (comma-separated values)

get-clusters

Get replication clusters for a namespace

用法

  1. $ pulsar-admin namespaces get-clusters tenant/namespace

get-backlog-quotas

Get the backlog quota policies for a namespace

用法

  1. $ pulsar-admin namespaces get-backlog-quotas tenant/namespace

set-backlog-quota

Set a backlog quota policy for a namespace

用法

  1. $ pulsar-admin namespaces set-backlog-quota tenant/namespace options

选项

标记Description默认值
-l, —limitThe backlog size limit (for example 10M or 16G)
-p, —policyThe retention policy to enforce when the limit is reached. The valid options are: producer_request_hold, producer_exception or consumer_backlog_eviction

示例

  1. $ pulsar-admin namespaces set-backlog-quota my-tenant/my-ns \
  2. --limit 2G \
  3. --policy producer_request_hold

remove-backlog-quota

Remove a backlog quota policy from a namespace

用法

  1. $ pulsar-admin namespaces remove-backlog-quota tenant/namespace

get-persistence

Get the persistence policies for a namespace

用法

  1. $ pulsar-admin namespaces get-persistence tenant/namespace

set-persistence

Set the persistence policies for a namespace

用法

  1. $ pulsar-admin namespaces set-persistence tenant/namespace options

选项

标记Description默认值
-a, —bookkeeper-ack-quorumThe number of acks (guaranteed copies) to wait for each entry0
-e, —bookkeeper-ensembleThe number of bookies to use for a topic0
-w, —bookkeeper-write-quorumHow many writes to make of each entry0
-r, —ml-mark-delete-max-rateThrottling rate of mark-delete operation (0 means no throttle)

get-message-ttl

Get the message TTL for a namespace

用法

  1. $ pulsar-admin namespaces get-message-ttl tenant/namespace

set-message-ttl

Set the message TTL for a namespace

用法

  1. $ pulsar-admin namespaces set-message-ttl tenant/namespace options

选项

标记Description默认值
-ttl, —messageTTLMessage TTL in seconds3600s

remove-message-ttl

Remove the message TTL for a namespace.

用法

  1. $ pulsar-admin namespaces remove-message-ttl tenant/namespace

get-anti-affinity-group

Get Anti-affinity group name for a namespace

用法

  1. $ pulsar-admin namespaces get-anti-affinity-group tenant/namespace

set-anti-affinity-group

Set Anti-affinity group name for a namespace

用法

  1. $ pulsar-admin namespaces set-anti-affinity-group tenant/namespace options

选项

标记Description默认值
-g, —groupAnti-affinity group name

get-anti-affinity-namespaces

Get Anti-affinity namespaces grouped with the given anti-affinity group name

用法

  1. $ pulsar-admin namespaces get-anti-affinity-namespaces options

选项

标记Description默认值
-c, —cluster集群名称
-g, —groupAnti-affinity group name
-p, —tenantTenant is only used for authorization. Client has to be admin of any of the tenant to access this api

delete-anti-affinity-group

Remove Anti-affinity group name for a namespace

用法

  1. $ pulsar-admin namespaces delete-anti-affinity-group tenant/namespace

get-retention

Get the retention policy for a namespace

用法

  1. $ pulsar-admin namespaces get-retention tenant/namespace

set-retention

Set the retention policy for a namespace

用法

  1. $ pulsar-admin namespaces set-retention tenant/namespace

选项

标记Description默认值
-s, —sizeThe retention size limits (for example 10M, 16G or 3T). 0 means no retention and -1 means infinite size retention
-t, —timeThe retention time in minutes, hours, days, or weeks. Examples: 100m, 13h, 2d, 5w. 0 means no retention and -1 means infinite time retention

unload

Unload a namespace or namespace bundle from the current serving broker.

用法

  1. $ pulsar-admin namespaces unload tenant/namespace options

选项

标记Description默认值
-b, —bundle{start-boundary}_{end-boundary} (e.g. 0x00000000_0xffffffff)

split-bundle

Split a namespace-bundle from the current serving broker

用法

  1. $ pulsar-admin namespaces split-bundle tenant/namespace options

选项

标记Description默认值
-b, —bundle{start-boundary}_{end-boundary} (e.g. 0x00000000_0xffffffff)
-u, —unloadUnload newly split bundles after splitting old bundlefalse

set-dispatch-rate

Set message-dispatch-rate for all topics of the namespace

用法

  1. $ pulsar-admin namespaces set-dispatch-rate tenant/namespace options

选项

标记Description默认值
-bd, —byte-dispatch-rateThe byte dispatch rate (default -1 will be overwrite if not passed)-1
-dt, —dispatch-rate-periodThe dispatch rate period in second type (default 1 second will be overwrite if not passed)1
-md, —msg-dispatch-rateThe message dispatch rate (default -1 will be overwrite if not passed)-1

get-dispatch-rate

Get configured message-dispatch-rate for all topics of the namespace (Disabled if value < 0)

用法

  1. $ pulsar-admin namespaces get-dispatch-rate tenant/namespace

set-replicator-dispatch-rate

Set replicator message-dispatch-rate for all topics of the namespace

用法

  1. $ pulsar-admin namespaces set-replicator-dispatch-rate tenant/namespace options

选项

标记Description默认值
-bd, —byte-dispatch-rateThe byte dispatch rate (default -1 will be overwrite if not passed)-1
-dt, —dispatch-rate-periodThe dispatch rate period in second type (default 1 second will be overwrite if not passed)1
-md, —msg-dispatch-rateThe message dispatch rate (default -1 will be overwrite if not passed)-1

get-replicator-dispatch-rate

Get replicator configured message-dispatch-rate for all topics of the namespace (Disabled if value < 0)

用法

  1. $ pulsar-admin namespaces get-replicator-dispatch-rate tenant/namespace

set-subscribe-rate

Set subscribe-rate per consumer for all topics of the namespace

用法

  1. $ pulsar-admin namespaces set-subscribe-rate tenant/namespace options

选项

标记Description默认值
-sr, —subscribe-rateThe subscribe rate (default -1 will be overwrite if not passed)-1
-st, —subscribe-rate-periodThe subscribe rate period in second type (default 30 second will be overwrite if not passed)30

get-subscribe-rate

Get configured subscribe-rate per consumer for all topics of the namespace

用法

  1. $ pulsar-admin namespaces get-subscribe-rate tenant/namespace

set-subscription-dispatch-rate

Set subscription message-dispatch-rate for all subscription of the namespace

用法

  1. $ pulsar-admin namespaces set-subscription-dispatch-rate tenant/namespace options

选项

标记Description默认值
-bd, —byte-dispatch-rateThe byte dispatch rate (default -1 will be overwrite if not passed)-1
-dt, —dispatch-rate-periodThe dispatch rate period in second type (default 1 second will be overwrite if not passed)1
-md, —sub-msg-dispatch-rateThe message dispatch rate (default -1 will be overwrite if not passed)-1

get-subscription-dispatch-rate

Get subscription configured message-dispatch-rate for all topics of the namespace (Disabled if value < 0)

用法

  1. $ pulsar-admin namespaces get-subscription-dispatch-rate tenant/namespace

clear-backlog

Clear the backlog for a namespace

用法

  1. $ pulsar-admin namespaces clear-backlog tenant/namespace options

选项

标记Description默认值
-b, —bundle{start-boundary}_{end-boundary} (e.g. 0x00000000_0xffffffff)
-force, —forceWhether to force a clear backlog without promptfalse
-s, —subThe subscription name

unsubscribe

Unsubscribe the given subscription on all destinations on a namespace

用法

  1. $ pulsar-admin namespaces unsubscribe tenant/namespace options

选项

标记Description默认值
-b, —bundle{start-boundary}_{end-boundary} (e.g. 0x00000000_0xffffffff)
-s, —subThe subscription name

set-encryption-required

Enable or disable message encryption required for a namespace

用法

  1. $ pulsar-admin namespaces set-encryption-required tenant/namespace options

选项

标记Description默认值
-d, —disableDisable message encryption requiredfalse
-e, —enableEnable message encryption requiredfalse

set-delayed-delivery

在命名空间设置延迟传递策略

用法

  1. $ pulsar-admin namespaces set-delayed-delivery tenant/namespace options

选项

标记Description默认值
-d, —disable禁用延迟传递消息false
-e, —enable启用延迟传递消息false
-t, —time延迟发送消息重试时的刻度时间1s

get-delayed-delivery

获取命名空间设置的延迟传递策略

用法

  1. $ pulsar-admin namespaces get-delayed-delivery-time tenant/namespace

选项

标记Description默认值
-t, —time延迟发送消息重试时的刻度时间1s

set-subscription-auth-mode

Set subscription auth mode on a namespace

用法

  1. $ pulsar-admin namespaces set-subscription-auth-mode tenant/namespace options

选项

标记Description默认值
-m, —subscription-auth-modeSubscription authorization mode for Pulsar policies. Valid options are: [None, Prefix]

get-max-producers-per-topic

Get maxProducersPerTopic for a namespace

用法

  1. $ pulsar-admin namespaces get-max-producers-per-topic tenant/namespace

set-max-producers-per-topic

Set maxProducersPerTopic for a namespace

用法

  1. $ pulsar-admin namespaces set-max-producers-per-topic tenant/namespace options

选项

标记Description默认值
-p, —max-producers-per-topicmaxProducersPerTopic for a namespace0

get-max-consumers-per-topic

Get maxConsumersPerTopic for a namespace

用法

  1. $ pulsar-admin namespaces get-max-consumers-per-topic tenant/namespace

set-max-consumers-per-topic

Set maxConsumersPerTopic for a namespace

用法

  1. $ pulsar-admin namespaces set-max-consumers-per-topic tenant/namespace options

选项

标记Description默认值
-c, —max-consumers-per-topicmaxConsumersPerTopic for a namespace0

get-max-consumers-per-subscription

Get maxConsumersPerSubscription for a namespace

用法

  1. $ pulsar-admin namespaces get-max-consumers-per-subscription tenant/namespace

set-max-consumers-per-subscription

Set maxConsumersPerSubscription for a namespace

用法

  1. $ pulsar-admin namespaces set-max-consumers-per-subscription tenant/namespace options

选项

标记Description默认值
-c, —max-consumers-per-subscriptionmaxConsumersPerSubscription for a namespace0

get-max-unacked-messages-per-subscription

获取命名空间的 maxUnackedMessagesPerSubscription

用法

  1. $ pulsar-admin namespaces get-max-unacked-messages-per-subscription tenant/namespace

set-max-unacked-messages-per-subscription

设置命名空间的 maxUnackedMessagesPerSubscription

用法

  1. $ pulsar-admin namespaces set-max-unacked-messages-per-subscription tenant/namespace options

选项

标记Description默认值
-c, —max-unacked-messages-per-subscription命名空间的 maxUnackedMessagesPerSubscription-1

get-max-unacked-messages-per-consumer

获取命名空间的 maxUnackedMessagesPerConsumer

用法

  1. $ pulsar-admin namespaces get-max-unacked-messages-per-consumer tenant/namespace

set-max-unacked-messages-per-consumer

设置命名空间的 maxUnackedMessagesPerConsumer

用法

  1. $ pulsar-admin namespaces set-max-unacked-messages-per-consumer tenant/namespace options

选项

标记Description默认值
-c, —max-unacked-messages-per-consumer命名空间的 maxUnackedMessagesPerConsumer-1

get-compaction-threshold

Get compactionThreshold for a namespace

用法

  1. $ pulsar-admin namespaces get-compaction-threshold tenant/namespace

set-compaction-threshold

Set compactionThreshold for a namespace

用法

  1. $ pulsar-admin namespaces set-compaction-threshold tenant/namespace options

选项

标记Description默认值
-t, —thresholdMaximum number of bytes in a topic backlog before compaction is triggered (eg: 10M, 16G, 3T). 0 disables automatic compaction0

get-offload-threshold

Get offloadThreshold for a namespace

用法

  1. $ pulsar-admin namespaces get-offload-threshold tenant/namespace

set-offload-threshold

Set offloadThreshold for a namespace

用法

  1. $ pulsar-admin namespaces set-offload-threshold tenant/namespace options

选项

标记Description默认值
-s, —sizeMaximum number of bytes stored in the pulsar cluster for a topic before data will start being automatically offloaded to longterm storage (eg: 10M, 16G, 3T, 100). Negative values disable automatic offload. 0 triggers offloading as soon as possible.-1

get-offload-deletion-lag

Get offloadDeletionLag, in minutes, for a namespace

用法

  1. $ pulsar-admin namespaces get-offload-deletion-lag tenant/namespace

set-offload-deletion-lag

Set offloadDeletionLag for a namespace

用法

  1. $ pulsar-admin namespaces set-offload-deletion-lag tenant/namespace options

选项

标记Description默认值
-l, —lagDuration to wait after offloading a ledger segment, before deleting the copy of that segment from cluster local storage. (eg: 10m, 5h, 3d, 2w).-1

clear-offload-deletion-lag

Clear offloadDeletionLag for a namespace

用法

  1. $ pulsar-admin namespaces clear-offload-deletion-lag tenant/namespace

get-schema-autoupdate-strategy

Get the schema auto-update strategy for a namespace

用法

  1. $ pulsar-admin namespaces get-schema-autoupdate-strategy tenant/namespace

set-schema-autoupdate-strategy

Set the schema auto-update strategy for a namespace

用法

  1. $ pulsar-admin namespaces set-schema-autoupdate-strategy tenant/namespace options

选项

标记Description默认值
-c, —compatibilityCompatibility level required for new schemas created via a Producer. Possible values (Full, Backward, Forward, None).Full
-d, —disabledDisable automatic schema updates.false

get-publish-rate

获取命名空间中每个主题的消息发布频率,单位是字节以及消息每秒。

用法

  1. $ pulsar-admin namespaces get-publish-rate tenant/namespace

set-publish-rate

设置命名空间中每个主题的消息发布频率

用法

  1. $ pulsar-admin namespaces set-publish-rate tenant/namespace options

选项

标记Description默认值
-m, —msg-publish-rate命名空间中每个主题每秒的消息数量阈值(-1 表示未设置,0 表示无限制)。-1
-b, —byte-publish-rate命名空间中每个主题每秒的字节数量阈值(-1 表示未设置,0 表示无限制)。-1

ns-isolation-policy

Operations for managing namespace isolation policies.

用法

  1. $ pulsar-admin ns-isolation-policy subcommand

Subcommands

  • set
  • get
  • list
  • delete
  • brokers
  • broker

set

Create/update a namespace isolation policy for a cluster. This operation requires Pulsar superuser privileges.

用法

  1. $ pulsar-admin ns-isolation-policy set cluster-name policy-name options

选项

标记Description默认值
—auto-failover-policy-paramsComma-separated name=value auto failover policy parameters[]
—auto-failover-policy-typeAuto failover policy type name. Currently available options: min_available.[]
—namespacesComma-separated namespaces regex list[]
—primaryComma-separated primary broker regex list[]
—secondaryComma-separated secondary broker regex list[]

get

Get the namespace isolation policy of a cluster. This operation requires Pulsar superuser privileges.

用法

  1. $ pulsar-admin ns-isolation-policy get cluster-name policy-name

list

List all namespace isolation policies of a cluster. This operation requires Pulsar superuser privileges.

用法

  1. $ pulsar-admin ns-isolation-policy list cluster-name

delete

Delete namespace isolation policy of a cluster. This operation requires superuser privileges.

用法

  1. $ pulsar-admin ns-isolation-policy delete

brokers

List all brokers with namespace-isolation policies attached to it. This operation requires Pulsar super-user privileges.

用法

  1. $ pulsar-admin ns-isolation-policy brokers cluster-name

broker

Get broker with namespace-isolation policies attached to it. This operation requires Pulsar super-user privileges.

用法

  1. $ pulsar-admin ns-isolation-policy broker cluster-name options

选项

标记Description默认值
—brokerBroker name to get namespace-isolation policies attached to it

topics

Operations for managing Pulsar topics (both persistent and non persistent)

用法

  1. $ pulsar-admin topics subcommand

Subcommands

  • compact
  • compaction-status
  • offload
  • offload-status
  • create-partitioned-topic
  • create-missed-partitions
  • delete-partitioned-topic
  • create
  • get-partitioned-topic-metadata
  • update-partitioned-topic
  • list-partitioned-topics
  • list
  • terminate
  • permissions
  • grant-permission
  • revoke-permission
  • lookup
  • bundle-range
  • delete
  • unload
  • create-subscription
  • subscriptions
  • unsubscribe
  • stats
  • stats-internal
  • info-internal
  • partitioned-stats
  • partitioned-stats-internal
  • skip
  • clear-backlog
  • expire-messages
  • expire-messages-all-subscriptions
  • peek-messages
  • reset-cursor
  • get-message-by-id
  • last-message-id

compact

Run compaction on the specified topic (persistent topics only)

用法

  1. $ pulsar-admin topics compact persistent://tenant/namespace/topic

compaction-status

Check the status of a topic compaction (persistent topics only)

用法

  1. $ pulsar-admin topics compaction-status persistent://tenant/namespace/topic

选项

标记Description默认值
-w, —wait-completeWait for compaction to completefalse

offload

Trigger offload of data from a topic to long-term storage (e.g. Amazon S3)

用法

  1. $ pulsar-admin topics offload persistent://tenant/namespace/topic options

选项

标记Description默认值
-s, —size-thresholdThe maximum amount of data to keep in BookKeeper for the specific topic

offload-status

Check the status of data offloading from a topic to long-term storage

用法

  1. $ pulsar-admin topics offload-status persistent://tenant/namespace/topic op

选项

标记Description默认值
-w, —wait-completeWait for compaction to completefalse

create-partitioned-topic

Create a partitioned topic. A partitioned topic must be created before producers can publish to it.

Note

By default, after 60 seconds of creation, topics are considered inactive and deleted automatically to prevent from generating trash data.

To disable this feature, set brokerDeleteInactiveTopicsEnabled to false.

To change the frequency of checking inactive topics, set brokerDeleteInactiveTopicsFrequencySeconds to your desired value.

For more information about these two parameters, see here.

用法

  1. $ pulsar-admin topics create-partitioned-topic {persistent|non-persistent}://tenant/namespace/topic options

选项

标记Description默认值
-p, —partitionsThe number of partitions for the topic0

create-missed-partitions

Try to create partitions for partitioned topic. The partitions of partition topic has to be created, can be used by repair partitions when topic auto creation is disabled

用法

  1. $ pulsar-admin topics create-missed-partitions persistent://tenant/namespace/topic

delete-partitioned-topic

Delete a partitioned topic. This will also delete all the partitions of the topic if they exist.

用法

  1. $ pulsar-admin topics delete-partitioned-topic {persistent|non-persistent}

create

Creates a non-partitioned topic. A non-partitioned topic must explicitly be created by the user if allowAutoTopicCreation or createIfMissing is disabled.

Note

By default, after 60 seconds of creation, topics are considered inactive and deleted automatically to prevent from generating trash data.

To disable this feature, set brokerDeleteInactiveTopicsEnabled to false.

To change the frequency of checking inactive topics, set brokerDeleteInactiveTopicsFrequencySeconds to your desired value.

For more information about these two parameters, see here.

用法

  1. $ pulsar-admin topics create {persistent|non-persistent}://tenant/namespace/topic

get-partitioned-topic-metadata

Get the partitioned topic metadata. If the topic is not created or is a non-partitioned topic, this will return an empty topic with zero partitions.

用法

  1. $ pulsar-admin topics get-partitioned-topic-metadata {persistent|non-persistent}://tenant/namespace/topic

update-partitioned-topic

Update existing non-global partitioned topic. New updating number of partitions must be greater than existing number of partitions.

用法

  1. $ pulsar-admin topics update-partitioned-topic {persistent|non-persistent}://tenant/namespace/topic options

选项

标记Description默认值
-p, —partitionsThe number of partitions for the topic0

list-partitioned-topics

获取命名空间下的分区主题列表。

用法

  1. $ pulsar-admin topics list-partitioned-topics tenant/namespace

list

Get the list of topics under a namespace

用法

  1. $ pulsar-admin topics list tenant/cluster/namespace

terminate

Terminate a topic (disallow further messages from being published on the topic)

用法

  1. $ pulsar-admin topics terminate {persistent|non-persistent}://tenant/namespace/topic

permissions

Get the permissions on a topic. Retrieve the effective permissions for a desination. These permissions are defined by the permissions set at the namespace level combined (union) with any eventual specific permissions set on the topic.

用法

  1. $ pulsar-admin topics permissions topic

grant-permission

Grant a new permission to a client role on a single topic

用法

  1. $ pulsar-admin topics grant-permission {persistent|non-persistent}://tenant/namespace/topic options

选项

标记Description默认值
—actionsActions to be granted (produce or consume)
—roleThe client role to which to grant the permissions

revoke-permission

Revoke permissions to a client role on a single topic. If the permission was not set at the topic level, but rather at the namespace level, this operation will return an error (HTTP status code 412).

用法

  1. $ pulsar-admin topics revoke-permission topic

lookup

Look up a topic from the current serving broker

用法

  1. $ pulsar-admin topics lookup topic

bundle-range

Get the namespace bundle which contains the given topic

用法

  1. $ pulsar-admin topics bundle-range topic

delete

Delete a topic. The topic cannot be deleted if there are any active subscriptions or producers connected to the topic.

用法

  1. $ pulsar-admin topics delete topic

unload

Unload a topic

用法

  1. $ pulsar-admin topics unload topic

create-subscription

在主题上创建新的订阅。

用法

  1. $ pulsar-admin topics create-subscription [options] persistent://tenant/namespace/topic

选项

标记Description默认值
-m, —messageIdmessageId where to create the subscription. It can be either ‘latest’, ‘earliest’ or (ledgerId:entryId)latest
-s, —subscriptionSubscription to reset position on

subscriptions

Get the list of subscriptions on the topic

用法

  1. $ pulsar-admin topics subscriptions topic

unsubscribe

Delete a durable subscriber from a topic

用法

  1. $ pulsar-admin topics unsubscribe topic options

选项

标记Description默认值
-s, —subscriptionThe subscription to delete
-f, —force断开和关闭所有消费者并强制删除订阅false

stats

Get the stats for the topic and its connected producers and consumers. All rates are computed over a 1-minute window and are relative to the last completed 1-minute period.

用法

  1. $ pulsar-admin topics stats topic

Note
The unit of storageSize and averageMsgSize is Byte.

stats-internal

Get the internal stats for the topic

用法

  1. $ pulsar-admin topics stats-internal topic

info-internal

Get the internal metadata info for the topic

用法

  1. $ pulsar-admin topics info-internal topic

partitioned-stats

Get the stats for the partitioned topic and its connected producers and consumers. All rates are computed over a 1-minute window and are relative to the last completed 1-minute period.

用法

  1. $ pulsar-admin topics partitioned-stats topic options

选项

标记Description默认值
—per-partitionGet per-partition statsfalse

partitioned-stats-internal

Get the internal stats for the partitioned topic and its connected producers and consumers. All the rates are computed over a 1 minute window and are relative the last completed 1 minute period.

用法

  1. $ pulsar-admin topics partitioned-stats-internal topic

skip

Skip some messages for the subscription

用法

  1. $ pulsar-admin topics skip topic options

选项

标记Description默认值
-n, —countThe number of messages to skip0
-s, —subscriptionThe subscription on which to skip messages

clear-backlog

清除订阅的积压(跳过所有消息)

用法

  1. $ pulsar-admin topics clear-backlog topic options

选项

标记Description默认值
-s, —subscriptionThe subscription to clear

expire-messages

Expire messages that are older than the given expiry time (in seconds) for the subscription.

用法

  1. $ pulsar-admin topics expire-messages topic options

选项

标记Description默认值
-t, —expireTimeExpire messages older than the time (in seconds)0
-s, —subscriptionThe subscription to skip messages on

expire-messages-all-subscriptions

Expire messages older than the given expiry time (in seconds) for all subscriptions

用法

  1. $ pulsar-admin topics expire-messages-all-subscriptions topic options

选项

标记Description默认值
-t, —expireTimeExpire messages older than the time (in seconds)0

peek-messages

Peek some messages for the subscription.

用法

  1. $ pulsar-admin topics peek-messages topic options

选项

标记Description默认值
-n, —countThe number of messages0
-s, —subscriptionSubscription to get messages from

reset-cursor

重置订阅的位置到离时间戳或 messageID 最近的位置。

用法

  1. $ pulsar-admin topics reset-cursor topic options

选项

标记Description默认值
-s, —subscriptionSubscription to reset position on
-t, —timeThe time in minutes to reset back to (or minutes, hours, days, weeks, etc.). Examples: 100m, 3h, 2d, 5w.
-m, —messageIdThe messageId to reset back to (ledgerId:entryId).

last-message-id

获取主题最后提交的消息 id。

用法

  1. $ pulsar-admin topics last-message-id persistent://tenant/namespace/topic

get-message-by-id

通过 ledger id 和 entry id 获取消息

用法

  1. $ pulsar-admin topics get-message-by-id topic options

选项

标记Description默认值
-l, —ledgerIdledger id0
-e, —entryIdentry id0

tenants

Operations for managing tenants

用法

  1. $ pulsar-admin tenants subcommand

Subcommands

  • list
  • get
  • create
  • update
  • delete

list

List the existing tenants

用法

  1. $ pulsar-admin tenants list

get

Gets the configuration of a tenant

用法

  1. $ pulsar-admin tenants get tenant-name

create

Creates a new tenant

用法

  1. $ pulsar-admin tenants create tenant-name options

选项

标记Description默认值
-r, —admin-rolesComma-separated admin roles
-c, —allowed-clustersComma-separated allowed clusters

update

Updates a tenant

用法

  1. $ pulsar-admin tenants update tenant-name options

选项

标记Description默认值
-r, —admin-rolesComma-separated admin roles
-c, —allowed-clustersComma-separated allowed clusters

delete

Deletes an existing tenant

用法

  1. $ pulsar-admin tenants delete tenant-name

resource-quotas

Operations for managing resource quotas

用法

  1. $ pulsar-admin resource-quotas subcommand

Subcommands

  • get
  • set
  • reset-namespace-bundle-quota

get

Get the resource quota for a specified namespace bundle, or default quota if no namespace/bundle is specified.

用法

  1. $ pulsar-admin resource-quotas get options

选项

标记Description默认值
-b, —bundleA bundle of the form {start-boundary}_{end_boundary}. This must be specified together with -n/—namespace.
-n, —namespaceThe namespace

set

Set the resource quota for the specified namespace bundle, or default quota if no namespace/bundle is specified.

用法

  1. $ pulsar-admin resource-quotas set options

选项

标记Description默认值
-bi, —bandwidthInThe expected inbound bandwidth (in bytes/second)0
-bo, —bandwidthOutExpected outbound bandwidth (in bytes/second)0
-b, —bundleA bundle of the form {start-boundary}_{end_boundary}. This must be specified together with -n/—namespace.
-d, —dynamicAllow to be dynamically re-calculated (or not)false
-mem, —memoryExpectred memory usage (in megabytes)0
-mi, —msgRateInExpected incoming messages per second0
-mo, —msgRateOutExpected outgoing messages per second0
-n, —namespaceThe namespace as tenant/namespace, for example my-tenant/my-ns. Must be specified together with -b/—bundle.

reset-namespace-bundle-quota

Reset the specifed namespace bundle’s resource quota to a default value.

用法

  1. $ pulsar-admin resource-quotas reset-namespace-bundle-quota options

选项

标记Description默认值
-b, —bundleA bundle of the form {start-boundary}_{end_boundary}. This must be specified together with -n/—namespace.
-n, —namespaceThe namespace

schemas

Operations related to Schemas associated with Pulsar topics.

用法

  1. $ pulsar-admin schemas subcommand

Subcommands

  • upload
  • delete
  • get
  • extract

upload

Upload the schema definition for a topic

用法

  1. $ pulsar-admin schemas upload persistent://tenant/namespace/topic options

选项

标记Description默认值
—filenameThe path to the schema definition file. An example schema file is available under conf directory.

delete

Delete the schema definition associated with a topic

用法

  1. $ pulsar-admin schemas delete persistent://tenant/namespace/topic

get

Retrieve the schema definition assoicated with a topic (at a given version if version is supplied).

用法

  1. $ pulsar-admin schemas get persistent://tenant/namespace/topic options

选项

标记Description默认值
—versionThe version of the schema definition to retrive for a topic.

extract

Provide the schema definition for a topic via Java class name contained in a JAR file

用法

  1. $ pulsar-admin schemas extract persistent://tenant/namespace/topic options

选项

标记Description默认值
-c, —classnameThe Java class name
-j, —jarA path to the JAR file which contains the above Java class
-t, —typeThe type of the schema (avro or json)

get-offload-policies

获取命名空间的卸载策略

用法

  1. $ pulsar-admin namespaces get-offload-policies tenant/namespace

set-offload-policies

设置命名空间的卸载策略

用法

  1. $ pulsar-admin namespaces set-offload-policies tenant/namespace

选项

标记Description默认值
-d, —driver用于卸载旧数据到长期存储的驱动程序,(可能值: S3, aws-s3, google-cloud-storage)
-r, —region长期储存区
-b, —bucket将被卸载的 ledger 放入的 Bucket
-e, —endpoint可连接的替代端点
-mbs, —maxBlockSize最大块大小64MB
-rbs, —readBufferSize读缓冲大小1MB
-oat, —offloadAfterThreshold到阈值大小后卸载,(例如 1M、5M)
-oae, —offloadAfterElapsed以毫秒为单位的时间过去后卸载(或分钟、小时、天、星期,比如:100m, 3h, 2d, 52)。