Pulsar configuration
Pulsar 配置可以通过 Pulsar 安装 目录下的 conf
文件夹里的一系列配置文件进行管理。
BookKeeper
BookKeeper 是一个冗余的日志存储系统,Pulsar 用它来持久化存储所有消息。
配置项 | Description | 默认值 |
---|---|---|
bookiePort | bookie 服务器监听的端口。 | 3181 |
allowLoopback | 是否允许 bookie 使用 loopback 接口作为它的主要接口(例如,用于确立身份的接口)。 默认情况下,loopback 接口不允许作为主接口。 使用 loopback 接口作为主接口通常意味着配置错误。 例如,在某些 VPS 设置中,通常不会配置主机名或使主机名解析为 127.0.0.1 。 如果情况如此,那么集群中的所有 bookie 都会将其身份设置为 127.0.0.1:3181 并且只有一个能成功加入集群。 对于像这样配置的 VPS,你应该显性地设置监听接口。 | false |
listeningInterface | The network interface on which the bookie listens. If not set, the bookie will listen on all interfaces. | eth0 |
advertisedAddress | 配置一个特定的主机名或IP地址,用于将bookie发布给客户端。 如果没有设置,则bookie会根据设置终端的llisteningInterface 以及useHostNameAsBookieID 发布自己的IP地址或主机名。 | N/A |
allowMultipleDirsUnderSameDiskPartition | 设置bookie允许/禁止同一个文件系统磁盘分区中存在多个ledger/index/journal目录。 | false |
minUsableSizeForIndexFileCreation | Bookie以只读模式启动并重放日志时,供bookie在索引目录中创建索引文件的最小安全可用大小(以字节为单位)。 | 1073741824 |
journalDirectory | BookKeeper 输出 write-ahead 日志(WAL)的目录 | data/bookkeeper/journal |
journalDirectories | 用于BookKeeper输出WAL日志的目录。 Multi directories are available, being separated by , . For example: journalDirectories=/tmp/bk-journal1,/tmp/bk-journal2 . If journalDirectories is set, bookies will skip journalDirectory and use this setting directory. | /tmp/bk-journal |
ledgerDirectories | BookKeeper 输出 ledger 快照的目录。 这里可以定义多个目录来存储以逗号分隔的快照,比如 ledgerDirectories=/tmp/bk1-data,/tmp/bk2-data 。 最理想的情况是,ledger 目录和日志目录都是在不同的设备中,这减少了随机读写和顺序写入之间的争执。 可以用单个磁盘运行,但性能将显著降低。 | data/bookkeeper/ledgers |
ledgerManagerType | 用于管理 ledger 如何存储与管理,以及垃圾收集的 ledger 管理器类型。 查看 BookKeeper Internals 获取更多信息。 | hierarchical |
zkLedgersRootPath | The root ZooKeeper path used to store ledger metadata. This parameter is used by the ZooKeeper-based ledger manager as a root znode to store all ledgers. | /ledgers |
ledgerStorageClass | Ledger 存储实现类 | org.apache.bookkeeper.bookie.storage.ldb.DbLedgerStorage |
entryLogFilePreallocationEnabled | 启用或禁用条目日志记录器预分配 | true |
logSizeLimit | Max file size of the entry logger, in bytes. A new entry log file will be created when the old one reaches the file size limitation. | 2147483648 |
minorCompactionThreshold | 次级压缩的阈值。 其剩余大小百分比低于此阈值的条目日志文件将在次级压缩中被压缩。 如果设置为零,次级压缩将被禁用。 | 0.2 |
minorCompactionInterval | Time interval to run minor compaction, in seconds. 如果设置为零,次级压缩将被禁用。 Note: should be greater than gcWaitTime. | 3600 |
majorCompactionThreshold | 首级压缩的阈值。 其剩余大小百分比低于此阈值的条目日志文件将在首级压缩中被压缩。 剩余大小百分比仍高于阈值的条目日志文件永远不会被压缩。 如果设置为零,次级压缩将被禁用。 | 0.5 |
majorCompactionInterval | The time interval to run major compaction, in seconds. If set to less than zero, the major compaction is disabled. Note: should be greater than gcWaitTime. | 86400 |
readOnlyModeEnabled | If readOnlyModeEnabled=true , then on all full ledger disks, bookie will be converted to read-only mode and serve only read requests. 否则 bookie 将被关闭。 | true |
forceReadOnlyBookie | Whether the bookie is force started in read only mode. | false |
persistBookieStatusEnabled | Persist the bookie status locally on the disks. So the bookies can keep their status upon restarts. | false |
compactionMaxOutstandingRequests | 设置压缩过程中无需刷写的最大条目数。 在压缩时,条目被写入条目日志,新的偏移被缓存在内存中。 一旦条目日志被刷写,索引将被新的偏移量更新。 此参数控制在强制刷写之前添加到条目日志的条目数量。 此参数的值越狱高意味着将有更多内存用于偏移量。 每个偏移量由三个 long 型组成。 此参数不应被修改,除非你完全了解其后果。 | 100000 |
compactionRate | 压缩过程中读取条目的频率,以每秒添加数为单位。 | 1000 |
isThrottleByBytes | 以字节或条目为单位进行阈值压缩 | false |
compactionRateByEntries | 压缩过程中读取条目的频率,以每秒添加数为单位。 | 1000 |
compactionRateByBytes | Set the rate at which compaction will readd entries. The unit is bytes added per second. | 1000000 |
journalMaxSizeMB | Max file size of journal file, in megabytes. A new journal file will be created when the old one reaches the file size limitation. | 2048 |
journalMaxBackups | The max number of old journal filse to keep. Keeping a number of old journal files would help data recovery in special cases. | 5 |
journalPreAllocSizeMB | 每次在日志中预分配的空间大小。 | 16 |
journalWriteBufferSizeKB | 日志使用的写缓冲区大小。 | 64 |
journalRemoveFromPageCache | 强制写入后,页是否应从页缓存中删除。 | true |
journalAdaptiveGroupWrites | 是否将日志的强制写入进行分组,这能优化分组提交获得更高吞吐量。 | true |
journalMaxGroupWaitMSec | 实现分组写入日志的最大延迟。 | 1 |
journalAlignmentSize | 所有日志的写入和提交应与给定的大小对齐 | 4096 |
journalBufferedWritesThreshold | 要实现分组的最大写入缓存 | 524288 |
journalFlushWhenQueueEmpty | 是否在日志队列为空时刷写日志 | false |
numJournalCallbackThreads | 处理日志回调的线程数 | 8 |
openLedgerRereplicationGracePeriod | The grace period, in milliseconds, that the replication worker waits before fencing and replicating a ledger fragment that’s still being written to upon bookie failure. | 30000 |
rereplicationEntryBatchSize | 重复制时在 fragment 中保存的最大条目数 | 100 |
autoRecoveryDaemonEnabled | Whether the bookie itself can start auto-recovery service. | true |
lostBookieRecoveryDelay | How long to wait, in seconds, before starting auto recovery of a lost bookie. | 0 |
gcWaitTime | 触发下一次垃圾收集的时间间隔(毫秒)。 由于垃圾收集工作在后台进行,过于频繁的垃圾收集工作将降低性能。 如果磁盘容量足够,最好用更大的 gc 时间间隔。 | 900000 |
gcOverreplicatedLedgerWaitTime | 触发下一次垃圾收集器收集过度复制的 ledger 的时间间隔(毫秒)。 这种情况不应经常发生,因为我们从 zookeeper 的 bookie 上读取所有 ledger 的元数据。 | 86400000 |
flushInterval | 刷新 ledger 索引页到磁盘的间隔,以毫秒计。 刷新索引文件会引入大量随机磁盘 I/O。 如果在不同的设备上将日志目录和 ledger 目录分开,刷写就不会影响性能。 但是,如果在同一设备上放置日志目录和 ledger 目录,性能会在频繁刷写的情况下大幅下降。 你可以考虑增加刷写间隔来获得更好的性能,但你需要在 bookie 服务器失败重启后花更多时间。 | 60000 |
bookieDeathWatchInterval | 查看 bookie 是否已死亡的时间间隔,以毫秒为单位 | 1000 |
allowStorageExpansion | Allow the bookie storage to expand. Newly added ledger and index dirs must be empty. | false |
zkServers | A list of one of more servers on which zookeeper is running. The server list can be comma separated values, for example: zkServers=zk1:2181,zk2:2181,zk3:2181. | localhost:2181 |
zkTimeout | ZooKeeper 客户端会话超时时间,以毫秒为单位。Bookie 服务器如果收到 SESSION_EXPIRED,将退出,因为它从 ZooKeeper 进行分区超过了会话超时时间。JVM 垃圾收集和磁盘 I/O 会导致 SESSION_EXPIRED。 增加这个值可以帮助避免这个问题 | 30000 |
zkRetryBackoffStartMs | The start time that the Zookeeper client backoff retries in milliseconds. | 1000 |
zkRetryBackoffMaxMs | The maximum time that the Zookeeper client backoff retries in milliseconds. | 10000 |
zkEnableSecurity | Set ACLs on every node written on ZooKeeper, allowing users to read and write BookKeeper metadata stored on ZooKeeper. In order to make ACLs work you need to setup ZooKeeper JAAS authentication. All the bookies and Client need to share the same user, and this is usually done using Kerberos authentication. See ZooKeeper documentation. | false |
httpServerEnabled | The flag enables/disables starting the admin http server. | false |
httpServerPort | The http server port to listen on. By default, the value is 8080. Use 8000 as the port to keep it consistent with prometheus stats provider. | 8000 |
httpServerClass | The http server class. | org.apache.bookkeeper.http.vertx.VertxHttpServer |
serverTcpNoDelay | 此设置用于启用/禁用 Nagle 的算法,该算法能通过减少通过网络发送的数据包数量来提高 TCP/IP 网络效率。 如果你正在发送许多小消息,这样在单个 IP 数据包中就可以放入不止一个消息,设置 server.tcpnodelay 为 false 来启用 Nagle 算法可以提供更好的性能。 | true |
serverSockKeepalive | This setting is used to send keep-alive messages on connection-oriented sockets. | true |
serverTcpLinger | The socket linger timeout on close. When enabled, a close or shutdown will not return until all queued messages for the socket have been successfully sent or the linger timeout has been reached. Otherwise, the call returns immediately and the closing is done in the background. | 0 |
byteBufAllocatorSizeMax | The maximum buf size of the received ByteBuf allocator. | 1048576 |
nettyMaxFrameSizeBytes | The maximum netty frame size in bytes. Any message received larger than this will be rejected. | 5253120 |
openFileLimit | 在 bookie 服务器上可以打开 ledger 索引文件的最大数量。如果 ledger 索引文件数量达到这个限制,bookie 服务器会开始将一些 ledger 从内存交换到磁盘。 过于频繁的交换会影响性能。 你可以根据你的要求调整这个数字以获得性能提升。 | 0 |
pageSize | Size of a index page in ledger cache, in bytes A larger index page can improve performance writing page to disk, which is efficient when you have small number of ledgers and these ledgers have similar number of entries. 如果你有大量的 ledger,而每个 ledger 都有较少的条目,较小的索引页面将会提高内存使用率。 | 8192 |
pageLimit | 在 ledger 缓存中提供多少索引页面。如果索引页面数量达到此限制,bookie 服务器会开始将一些 ledger 从内存交换到磁盘。 当你发现交换变得更频繁时,可以增加这个值。 但请确认 pageLimit*page 的大小不应超过 JVM 最大内存限制,否则你将会得到 OutOfMemoryException。 In general, incrementing pageLimit, using smaller index page would gain better performance in lager number of ledgers with fewer entries case If pageLimit is -1, bookie server will use 1/3 of JVM memory to compute the limitation of number of index pages. | 0 |
readOnlyModeEnabled | 如果所有已配置的 ledger 目录已满,则只支持客户的读取请求。 如果 “readOnlyModeEnabled=true” 那么当所有的 ledger 磁盘满时,bookie 会被转换为只读模式并只处理读请求。 否则 bookie 将被关闭。 默认情况下,这会被禁用。 | true |
diskUsageThreshold | 对于每个 ledger 目录,可使用的最大磁盘空间。 默认值为 0.95f。 比如,最多只能使用 95% 的磁盘,此后不会将任何内容写入该分区。 If all ledger dir partitions are full, then bookie will turn to readonly mode if ‘readOnlyModeEnabled=true’ is set, else it will shutdown. 有效值应在 0 和 1 之间(不包含端点)。 | 0.95 |
diskCheckInterval | 磁盘检查间隔,以毫秒为单位,检查 ledger 目录使用情况的时间间隔。 | 10000 |
auditorPeriodicCheckInterval | 审查者对集群内所有 ledger 进行核对的时间间隔。 默认情况下,每周运行一次。 间隔以秒为单位。 要完全禁用定期检查,请将此设置为 0。 请注意,定期检查会给集群带来额外的负荷,因此每天的运行次数不应超过一次。 | 604800 |
sortedLedgerStorageEnabled | Whether sorted-ledger storage is enabled. | ture |
auditorPeriodicBookieCheckInterval | 审查者 bookie 检查的时间间隔。 审查者 bookie 检查,检查 ledger 的元数据来查看哪些 bookie 应该包含各个 ledger 的条目。 如果本应包含条目的 bookie 不可用,包含该条目的 ledger 会被标记去做恢复。 设置为 0 会禁用定期检查。 当 bookie 失效时,bookie 检查仍然会进行。 间隔以秒为单位。 | 86400 |
numAddWorkerThreads | The number of threads that should handle write requests. if zero, the writes would be handled by netty threads directly. | 0 |
numReadWorkerThreads | The number of threads that should handle read requests. if zero, the reads would be handled by netty threads directly. | 8 |
numHighPriorityWorkerThreads | The umber of threads that should be used for high priority requests (i.e. recovery reads and adds, and fencing). | 8 |
maxPendingReadRequestsPerThread | 如果启用了读 worker 线程,限制待处理请求的数量,以避免执行器队列无止境增长。 | 2500 |
maxPendingAddRequestsPerThread | The limited number of pending requests, which is used to avoid the executor queue to grow indefinitely when add workers threads are enabled. | 10000 |
isForceGCAllowWhenNoSpace | Whether force compaction is allowed when the disk is full or almost full. Forcing GC could get some space back, but could also fill up the disk space more quickly. This is because new log files are created before GC, while old garbage log files are deleted after GC. | false |
verifyMetadataOnGC | True if the bookie should double check readMetadata prior to GC. | false |
flushEntrylogBytes | Entry log flush interval in bytes. Flushing in smaller chunks but more frequently reduces spikes in disk I/O. Flushing too frequently may also affect performance negatively. | 268435456 |
readBufferSizeBytes | 用作 BufferedReadChannel 容量的字节数量。 | 4096 |
writeBufferSizeBytes | 用作写缓存容量的字节数 | 65536 |
useHostNameAsBookieID | Whether the bookie should use its hostname to register with the coordination service (e.g.: zookeeper service). When false, bookie will use its ip address for the registration. | false |
allowEphemeralPorts | Whether the bookie is allowed to use an ephemeral port (port 0) as its server port. By default, an ephemeral port is not allowed. Using an ephemeral port as the service port usually indicates a configuration error. However, in unit tests, using an ephemeral port will address port conflict problems and allow running tests in parallel. | false |
enableLocalTransport | Whether the bookie is allowed to listen for the BookKeeper clients executed on the local JVM. | false |
disableServerSocketBind | Whether the bookie is allowed to disable bind on network interfaces. This bookie will be available only to BookKeeper clients executed on the local JVM. | false |
skipListArenaChunkSize | The number of bytes that we should use as chunk allocation for org.apache.bookkeeper.bookie.SkipListArena . | 4194304 |
skipListArenaMaxAllocSize | The maximum size that we should allocate from the skiplist arena. Allocations larger than this should be allocated directly by the VM to avoid fragmentation. | 131072 |
bookieAuthProviderFactoryClass | The factory class name of the bookie authentication provider. If this is null, then there is no authentication. | null |
statsProviderClass | org.apache.bookkeeper.stats.prometheus.PrometheusMetricsProvider | |
prometheusStatsHttpPort | 8000 | |
dbStorage_writeCacheMaxSizeMb | Size of Write Cache. Memory is allocated from JVM direct memory. Write cache is used to buffer entries before flushing into the entry log. For good performance, it should be big enough to hold a substantial amount of entries in the flush interval. | 25% 的直接内存 |
dbStorage_readAheadCacheMaxSizeMb | Size of Read cache. Memory is allocated from JVM direct memory. This read cache is pre-filled doing read-ahead whenever a cache miss happens. By default, it is allocated to 25% of the available direct memory. | N/A |
dbStorage_readAheadCacheBatchSize | 当读缓存 miss 发生后预装填的条目数量 | 1000 |
dbStorage_rocksDB_blockCacheSize | Size of RocksDB block-cache. For best performance, this cache should be big enough to hold a significant portion of the index database which can reach ~2GB in some cases. By default, it uses 10% of direct memory. | N/A |
dbStorage_rocksDB_writeBufferSizeMB | 64 | |
dbStorage_rocksDB_sstSizeInMB | 64 | |
dbStorage_rocksDB_blockSize | 65536 | |
dbStorage_rocksDB_bloomFilterBitsPerKey | 10 | |
dbStorage_rocksDB_numLevels | -1 | |
dbStorage_rocksDB_numFilesInLevel0 | 4 | |
dbStorage_rocksDB_maxSizeInLevel1MB | 256 |
Broker
Pulsar broker 负责处理从生产者发出消息、向消费者派发消息、在集群间复制数据等。
<th>
Description
</th>
<th>
默认值
</th>
<td>
Specify multiple advertised listeners for the broker.<br><br>The format is <code><listener_name>:pulsar://<host>:<port></code>.<br><br>If there are multiple listeners, separate them with commas.<br><br><strong x-id="1">Note</strong>: do not use this configuration with <code>advertisedAddress</code> and <code>brokerServicePort</code>. If the value of this configuration is empty, the broker uses <code>advertisedAddress</code> and <code>brokerServicePort</code>
</td>
<td>
/
</td>
配置项 |
---|
advertisedListeners |
internalListenerName|Specify the internal listener name for the broker.
Note: the listener name must be contained in advertisedListeners
.
If the value of this configuration is empty, the broker uses the first listener as the internal listener.|/| |authenticateOriginalAuthData| If this flag is set to true
, the broker authenticates the original Auth data; else it just accepts the originalPrincipal and authorizes it (if required). |false| |enablePersistentTopics| Whether persistent topics are enabled on the broker |true| |enableNonPersistentTopics| Whether non-persistent topics are enabled on the broker |true| |functionsWorkerEnabled| Whether the Pulsar Functions worker service is enabled in the broker |false| |exposePublisherStats|Whether to enable topic level metrics.|true| |statsUpdateFrequencyInSecs||60| |statsUpdateInitialDelayInSecs||60| |zookeeperServers| Zookeeper quorum connection string || |zooKeeperCacheExpirySeconds|ZooKeeper cache expiry time in seconds|300 |configurationStoreServers| Configuration store connection string (as a comma-separated list) || |brokerServicePort| Broker data port |6650| |brokerServicePortTls| Broker data port for TLS |6651| |webServicePort| Port to use to server HTTP request |8080| |webServicePortTls| Port to use to server HTTPS request |8443| |webSocketServiceEnabled| Enable the WebSocket API service in broker |false| |webSocketNumIoThreads|The number of IO threads in Pulsar Client used in WebSocket proxy.|8| |webSocketConnectionsPerBroker|The number of connections per Broker in Pulsar Client used in WebSocket proxy.|8| |webSocketSessionIdleTimeoutMillis|Time in milliseconds that idle WebSocket session times out.|300000| |webSocketMaxTextFrameSize|The maximum size of a text message during parsing in WebSocket proxy.|1048576| |exposeTopicLevelMetricsInPrometheus|Whether to enable topic level metrics.|true| |exposeConsumerLevelMetricsInPrometheus|Whether to enable consumer level metrics.|false| |jvmGCMetricsLoggerClassName|Classname of Pluggable JVM GC metrics logger that can log GC specific metrics.|N/A| |bindAddress| Hostname or IP address the service binds on, default is 0.0.0.0. |0.0.0.0| |advertisedAddress| Hostname or IP address the service advertises to the outside world. If not set, the value of InetAddress.getLocalHost().getHostName()
is used. || |clusterName| Name of the cluster to which this broker belongs to || |brokerDeduplicationEnabled| Sets the default behavior for message deduplication in the broker. If enabled, the broker will reject messages that were already stored in the topic. This setting can be overridden on a per-namespace basis. |false| |brokerDeduplicationMaxNumberOfProducers| The maximum number of producers for which information will be stored for deduplication purposes. |10000| |brokerDeduplicationEntriesInterval| The number of entries after which a deduplication informational snapshot is taken. A larger interval will lead to fewer snapshots being taken, though this would also lengthen the topic recovery time (the time required for entries published after the snapshot to be replayed). |1000| |brokerDeduplicationProducerInactivityTimeoutMinutes| The time of inactivity (in minutes) after which the broker will discard deduplication information related to a disconnected producer. |360| |dispatchThrottlingRatePerReplicatorInMsg| The default messages per second dispatch throttling-limit for every replicator in replication. The value of 0
means disabling replication message dispatch-throttling| 0 | |dispatchThrottlingRatePerReplicatorInByte| The default bytes per second dispatch throttling-limit for every replicator in replication. The value of 0
means disabling replication message-byte dispatch-throttling| 0 | |zooKeeperSessionTimeoutMillis| Zookeeper session timeout in milliseconds |30000| |brokerShutdownTimeoutMs| Time to wait for broker graceful shutdown. After this time elapses, the process will be killed |60000| |skipBrokerShutdownOnOOM| Flag to skip broker shutdown when broker handles Out of memory error. |false| |backlogQuotaCheckEnabled| Enable backlog quota check. Enforces action on topic when the quota is reached |true| |backlogQuotaCheckIntervalInSeconds| How often to check for topics that have reached the quota |60| |backlogQuotaDefaultLimitGB| The default per-topic backlog quota limit. Being less than 0 means no limitation. By default, it is -1. | -1 | |backlogQuotaDefaultRetentionPolicy|The defaulted backlog quota retention policy. By Default, it is producer_request_hold
.
- ‘producer_request_hold’ Policy which holds producer’s send request until the resource becomes available (or holding times out)
- ‘producer_exception’ Policy which throws
javax.jms.ResourceAllocationException
to the producer - ‘consumer_backlog_eviction’ Policy which evicts the oldest message from the slowest consumer’s backlog
|producer_request_hold| |allowAutoTopicCreation| Enable topic auto creation if a new producer or consumer connected |true| |allowAutoTopicCreationType| The type of topic that is allowed to be automatically created.(partitioned/non-partitioned) |non-partitioned| |allowAutoSubscriptionCreation| Enable subscription auto creation if a new consumer connected |true| |defaultNumPartitions| The number of partitioned topics that is allowed to be automatically created if
allowAutoTopicCreationType
is partitioned |1| |brokerDeleteInactiveTopicsEnabled| Enable the deletion of inactive topics |true| |brokerDeleteInactiveTopicsFrequencySeconds| How often to check for inactive topics |60| | brokerDeleteInactiveTopicsMode | Set the mode to delete inactive topics.-delete_when_no_subscriptions
: 删除没有订阅或活动生产者的主题。 delete_when_subscriptions_caught_up
: delete the topic whose subscriptions have no backlogs and which has no active producers or consumers. |delete_when_no_subscriptions
| | brokerDeleteInactiveTopicsMaxInactiveDurationSeconds | Set the maximum duration for inactive topics. If it is not specified, thebrokerDeleteInactiveTopicsFrequencySeconds
parameter is adopted. | N/A | |messageExpiryCheckIntervalInMinutes| How frequently to proactively check and purge expired messages |5| |brokerServiceCompactionMonitorIntervalInSeconds| Interval between checks to see if topics with compaction policies need to be compacted |60| |delayedDeliveryEnabled|Whether to enable the delayed delivery for messages. If disabled, messages will be immediately delivered and there will be no tracking overhead.|true| |delayedDeliveryTickTimeMillis|Control the tick time for retrying on delayed delivery, which affecte the accuracy of the delivery time compared to the scheduled time. By default, it is 1 second.|1000| |activeConsumerFailoverDelayTimeMillis| How long to delay rewinding cursor and dispatching messages when active consumer is changed. |1000| |clientLibraryVersionCheckEnabled| 启用客户端库版本最低要求检查 |false| |clientLibraryVersionCheckAllowUnversioned| 允许无版本信息的客户端库 |true| |statusFilePath| broker 响应发现服务健康检查时用于决定 rotation 状态的文件路径 || |preferLaterVersions| 如果为 true,(且启用了 ModularLoadManagerImpl),载入管理器会尝试仅使用运行最新软件版本的 broker(来最小化对 bundle 的影响) |false| |maxNumPartitionsPerPartitionedTopic| 每个分区主题的最大分区数。 Use 0 or negative number to disable the check|0| |tlsEnabled|Deprecated - UsewebServicePortTls
andbrokerServicePortTls
instead. |false| |tlsCertificateFilePath| Path for the TLS certificate file || |tlsKeyFilePath| Path for the TLS private key file || |tlsTrustCertsFilePath| Path for the trusted TLS certificate file. This cert is used to verify that any certs presented by connecting clients are signed by a certificate authority. If this verification fails, then the certs are untrusted and the connections are dropped. || |tlsAllowInsecureConnection| Accept untrusted TLS certificate from client. If it is set totrue
, a client with a cert which cannot be verified with the ‘tlsTrustCertsFilePath’ cert will be allowed to connect to the server, though the cert will not be used for client authentication. |false| |tlsProtocols|Specify the tls protocols the broker will use to negotiate during TLS Handshake. Multiple values can be specified, separated by commas. Example:-TLSv1.2
,TLSv1.1
,TLSv1
|| |tlsCiphers|Specify the tls cipher the broker will use to negotiate during TLS Handshake. Multiple values can be specified, separated by commas. Example:-TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
|| |tlsEnabledWithKeyStore| Enable TLS with KeyStore type configuration in broker |false| |tlsProvider| TLS Provider for KeyStore type || |tlsKeyStoreType| LS KeyStore type configuration in broker: JKS, PKCS12 |JKS| |tlsKeyStore| TLS KeyStore path in broker || |tlsKeyStorePassword| TLS KeyStore password for broker || |brokerClientTlsEnabledWithKeyStore| Whether internal client use KeyStore type to authenticate with Pulsar brokers |false| |brokerClientSslProvider| The TLS Provider used by internal client to authenticate with other Pulsar brokers || |brokerClientTlsTrustStoreType| TLS TrustStore type configuration for internal client: JKS, PKCS12, used by the internal client to authenticate with Pulsar brokers |JKS| |brokerClientTlsTrustStore| TLS TrustStore path for internal client, used by the internal client to authenticate with Pulsar brokers || |brokerClientTlsTrustStorePassword| TLS TrustStore password for internal client, used by the internal client to authenticate with Pulsar brokers || |brokerClientTlsCiphers| Specify the tls cipher the internal client will use to negotiate during TLS Handshake. (一个逗号分隔的密码列表) 例如:[TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256]|| |brokerClientTlsProtocols| 指定 TLS 握手期间 broker 使用的 tls 协议。 (逗号分隔的协议名称列表)。 例如:[TLSv1.2, TLSv1.1, TLSv1] || |ttlDurationDefaultInSeconds| 命名空间的默认 ttl(当命名空间策略中未配置 ttl 时)。 |0| |tokenSecretKey| 配置用于验证认证令牌的密钥。 The key can be specified like:tokenSecretKey=data:;base64,xxxxxxxxx
ortokenSecretKey=file:///my/secret.key
|| |tokenPublicKey| Configure the public key to be used to validate auth tokens. The key can be specified like:tokenPublicKey=data:;base64,xxxxxxxxx
ortokenPublicKey=file:///my/secret.key
|| |tokenPublicAlg| Configure the algorithm to be used to validate auth tokens. 这可以是Java JWT 支持的任意一种非对称算法 (https://github.com/jwtk/jjwt#signature-algorithms-keys) |RS256| |tokenAuthClaim| Specify which of the token’s claims will be used as the authentication “principal” or “role”. 如果这里留空,则默认的”sub” claim 会被使用 || |tokenAudienceClaim| 令牌受众的 “claim” 名称,比如”aud”会用于从令牌获取受众。 If not set, audience will not be verified. || |tokenAudience| 该 broker 的令牌受众。 The fieldtokenAudienceClaim
of a valid token, need contains this. || |maxUnackedMessagesPerConsumer| 消费者在共享订阅上接收消息时允许的未确认消息最大数量。 Broker will stop sending messages to consumer once, this limit reaches until consumer starts acknowledging messages back. 使用 0 值,禁用 unackeMessage 限制检查,消费者可以不受任何限制地接收消息 |50000| |maxUnackedMessagesPersubscription| 每个共享订阅允许的未确认消息的最大数量。 Broker will stop dispatching messages to all consumers of the subscription once this limit reaches until consumer starts acknowledging messages back and unack count reaches to limit/2. 使用 0 值,禁用 unackedMessage-limit 检查且调度器可以不受任何限制地发送消息 |200000| |subscriptionRedeliveryTrackerEnabled| 启用订阅消息重送跟踪 |true| subscriptionExpirationTimeMinutes | 删除上次消费后非活动订阅的时间。Setting this configuration to a value greater than 0 deletes inactive subscriptions automatically.
Setting this configuration to 0 does not delete inactive subscriptions automatically.Since this configuration takes effect on all topics, if there is even one topic whose subscriptions should not be deleted automatically, you need to set it to 0.
Instead, you can set a subscription expiration time for each namespace using thepulsar-admin namespaces set-subscription-expiration-time options
command. | 0 | |maxConcurrentLookupRequest| Max number of concurrent lookup request broker allows to throttle heavy incoming lookup traffic |50000| |maxConcurrentTopicLoadRequest| Max number of concurrent topic loading request broker allows to control number of zk-operations |5000| |authenticationEnabled| Enable authentication |false| |authenticationProviders| Autentication provider name list, which is comma separated list of class names || | authenticationRefreshCheckSeconds | Interval of time for checking for expired authentication credentials | 60 | |authorizationEnabled| Enforce authorization |false| |superUserRoles| Role names that are treated as “super-user”, meaning they will be able to do all admin operations and publish/consume from all topics || |brokerClientAuthenticationPlugin| Authentication settings of the broker itself. 当 broker 连接到其它 broker 时使用,不管是相同集群还是其它集群中的 || |brokerClientAuthenticationParameters||| |athenzDomainNames| 用于认证的受支持的 Athenz 提供者域名(逗号分隔) || |exposePreciseBacklogInPrometheus| 暴露出精确的积压统计信息,设置为 false 来使用 published counter 和 consumed counter 来进行计算,这样更高效但可能会有误差。 |false| |schemaRegistryStorageClassName|The schema storage implementation used by this broker.|org.apache.pulsar.broker.service.schema.BookkeeperSchemaStorageFactory| |isSchemaValidationEnforced|Enforce schema validation on following cases: if a producer without a schema attempts to produce to a topic with schema, the producer will be failed to connect. PLEASE be carefully on using this, since non-java clients don’t support schema. If this setting is enabled, then non-java clients fail to produce.|false| |offloadersDirectory|The directory for all the offloader implementations.|./offloaders| |bookkeeperMetadataServiceUri| Metadata service uri that bookkeeper is used for loading corresponding metadata driver and resolving its metadata service location. This value can be fetched usingbookkeeper shell whatisinstanceid
command in BookKeeper cluster. 例如: zk+hierarchical://localhost:2181/ledgers。 The metadata service uri list can also be semicolon separated values like below: zk+hierarchical://zk1:2181;zk2:2181;zk3:2181/ledgers || |bookkeeperClientAuthenticationPlugin| Authentication plugin to use when connecting to bookies || |bookkeeperClientAuthenticationParametersName| BookKeeper auth plugin implementatation specifics parameters name and values || |bookkeeperClientAuthenticationParameters||| |bookkeeperClientTimeoutInSeconds| Timeout for BK add / read operations |30| |bookkeeperClientSpeculativeReadTimeoutInMillis| Speculative reads are initiated if a read request doesn’t complete within a certain time Using a value of 0, is disabling the speculative reads |0| |bookkeeperNumberOfChannelsPerBookie| Number of channels per bookie |16| |bookkeeperClientHealthCheckEnabled| Enable bookies health check. Bookies that have more than the configured number of failure within the interval will be quarantined for some time. 在此期间,这些 bookies 上不会创建新的 ledger |true| |bookkeeperClientHealthCheckIntervalSeconds||60| |bookkeeperClientHealthCheckErrorThresholdPerInterval||5| |bookkeeperClientHealthCheckQuarantineTimeInSeconds ||1800| |bookkeeperClientRackawarePolicyEnabled| 启用 rack-aware bookie 选择政策。 当生成新的 bookie ensemble 时 BK 会从不同的 rack 中选取 bookie |true| |bookkeeperClientRegionawarePolicyEnabled| 启用 region-aware bookie 选择政策。 BK will chose bookies from different regions and racks when forming a new bookie ensemble. If enabled, the value of bookkeeperClientRackawarePolicyEnabled is ignored |false| |bookkeeperClientMinNumRacksPerWriteQuorum| Minimum number of racks per write quorum. BK rack-aware bookie selection policy will try to get bookies from at least ‘bookkeeperClientMinNumRacksPerWriteQuorum’ racks for a write quorum. |2| |bookkeeperClientEnforceMinNumRacksPerWriteQuorum| Enforces rack-aware bookie selection policy to pick bookies from ‘bookkeeperClientMinNumRacksPerWriteQuorum’ racks for a writeQuorum. If BK can’t find bookie then it would throw BKNotEnoughBookiesException instead of picking random one. |false| |bookkeeperClientReorderReadSequenceEnabled| Enable/disable reordering read sequence on reading entries. |false| |bookkeeperClientIsolationGroups| 通过指定一个要选择的 bookie 组列表来启用 bookie 隔离。 指定组外的任何 bookie 都不会被 broker 使用 || |bookkeeperClientSecondaryIsolationGroups| 当 bookkeeperClientIsolationGroups 没有足够多的可用 bookie 时启用 bookie 的 secondary-isolation 组。 || |bookkeeperClientMinAvailableBookiesInIsolationGroups| bookkeeperClientIsolationGroups 中应可用的最少 bookie 数,否则 broker 会将 bookkeeperClientSecondaryIsolationGroups 的 bookie 囊括在隔离列表中。 || |bookkeeperClientGetBookieInfoIntervalSeconds| 设置定期查询 bookie 信息的间隔 |86400| |bookkeeperClientGetBookieInfoRetryIntervalSeconds| 设置当查询 bookie 信息失败后的重试间隔 |60| |bookkeeperEnableStickyReads | 启用/禁用 使对一个 ledger 的读请求变得与单个 broker 粘滞(sticky)。 If this flag is enabled, the client will use one single bookie (by preference) to read all entries for a ledger. | true | |managedLedgerDefaultEnsembleSize| 当创建一个 ledger 时使用的 bookie 数量 |2| |managedLedgerDefaultWriteQuorum| 每个消息存储的拷贝数量 |2| |managedLedgerDefaultAckQuorum| 得到保证的拷贝数量 (写操作完成前需要等待的 ack) |2| |managedLedgerCacheSizeMB| 在托管的 ledger 中用于缓存数据负载的内存大小。 This memory is allocated from JVM direct memory and it’s shared across all the topics running in the same broker. 默认地,使用可用的直接内存的 1/5 || |managedLedgerCacheCopyEntries| 当插入缓存时是否应该创建条目负载的拷贝 | false| |managedLedgerCacheEvictionWatermark| 当驱逐触发时降低缓存等级的阈值 |0.9| |managedLedgerCacheEvictionFrequency| 为托管的 ledger 缓存配置缓存驱逐频率 (驱逐/秒) | 100.0 | |managedLedgerCacheEvictionTimeThresholdMillis| 所有在缓存中停留超过配置时长的条目会被驱逐 | 1000 | |managedLedgerCursorBackloggedThreshold| 设置当游标应被当作“积压的” 且应被设置为非活动的阈值 (以条目数为单位)。 | 1000| |managedLedgerDefaultMarkDeleteRateLimit| Rate limit the amount of writes per second generated by consumer acking the messages |1.0| |managedLedgerMaxEntriesPerLedger| The max number of entries to append to a ledger before triggering a rollover. A ledger rollover is triggered on these conditions:- Either the max rollover time has been reached
- or the max entries have been written to the ledger and at least min-time has passed
|50000| |managedLedgerMinLedgerRolloverTimeMinutes| Minimum time between ledger rollover for a topic |10| |managedLedgerMaxLedgerRolloverTimeMinutes| Maximum time before forcing a ledger rollover for a topic |240| |managedLedgerCursorMaxEntriesPerLedger| Max number of entries to append to a cursor ledger |50000| |managedLedgerCursorRolloverTimeInSeconds| Max time before triggering a rollover on a cursor ledger |14400| |managedLedgerMaxUnackedRangesToPersist| Max number of “acknowledgment holes” that are going to be persistently stored. When acknowledging out of order, a consumer will leave holes that are supposed to be quickly filled by acking all the messages. The information of which messages are acknowledged is persisted by compressing in “ranges” of messages that were acknowledged. After the max number of ranges is reached, the information will only be tracked in memory and messages will be redelivered in case of crashes. |1000| |autoSkipNonRecoverableData| Skip reading non-recoverable/unreadable data-ledger under managed-ledger’s list.It helps when data-ledgers gets corrupted at bookkeeper and managed-cursor is stuck at that ledger. |false| |loadBalancerEnabled| Enable load balancer |true| |loadBalancerPlacementStrategy| Strategy to assign a new bundle weightedRandomSelection || |loadBalancerReportUpdateThresholdPercentage| Percentage of change to trigger load report update |10| |loadBalancerReportUpdateMaxIntervalMinutes| maximum interval to update load report |15| |loadBalancerHostUsageCheckIntervalMinutes| Frequency of report to collect |1| |loadBalancerSheddingIntervalMinutes| Load shedding interval. Broker periodically checks whether some traffic should be offload from some over-loaded broker to other under-loaded brokers |30| |loadBalancerSheddingGracePeriodMinutes| Prevent the same topics to be shed and moved to other broker more that once within this timeframe |30| |loadBalancerBrokerMaxTopics| Usage threshold to allocate max number of topics to broker |50000| |loadBalancerBrokerUnderloadedThresholdPercentage| Usage threshold to determine a broker as under-loaded |1| |loadBalancerBrokerOverloadedThresholdPercentage| Usage threshold to determine a broker as over-loaded |85| |loadBalancerResourceQuotaUpdateIntervalMinutes| Interval to update namespace bundle resource quotat |15| |loadBalancerBrokerComfortLoadLevelPercentage| Usage threshold to determine a broker is having just right level of load |65| |loadBalancerAutoBundleSplitEnabled| enable/disable namespace bundle auto split |false| |loadBalancerNamespaceBundleMaxTopics| maximum topics in a bundle, otherwise bundle split will be triggered |1000| |loadBalancerNamespaceBundleMaxSessions| maximum sessions (producers + consumers) in a bundle, otherwise bundle split will be triggered |1000| |loadBalancerNamespaceBundleMaxMsgRate| maximum msgRate (in + out) in a bundle, otherwise bundle split will be triggered |1000| |loadBalancerNamespaceBundleMaxBandwidthMbytes| maximum bandwidth (in + out) in a bundle, otherwise bundle split will be triggered |100| |loadBalancerNamespaceMaximumBundles| maximum number of bundles in a namespace |128| |replicationMetricsEnabled| Enable replication metrics |true| |replicationConnectionsPerBroker| Max number of connections to open for each broker in a remote cluster More connections host-to-host lead to better throughput over high-latency links. |16| |replicationProducerQueueSize| Replicator producer queue size |1000| |replicatorPrefix| Replicator prefix used for replicator producer name and cursor name pulsar.repl|| |replicationTlsEnabled| Enable TLS when talking with other clusters to replicate messages |false| |brokerServicePurgeInactiveFrequencyInSeconds|Deprecated. Use
brokerDeleteInactiveTopicsFrequencySeconds
.|60| |transactionCoordinatorEnabled|Whether to enable transaction coordinator in broker.|true| |transactionMetadataStoreProviderClassName| |org.apache.pulsar.transaction.coordinator.impl.InMemTransactionMetadataStoreProvider| |defaultRetentionTimeInMinutes| Default message retention time |0| |defaultRetentionSizeInMB| Default retention size |0| |keepAliveIntervalSeconds| How often to check whether the connections are still alive |30| |bootstrapNamespaces| The bootstrap name. | N/A | |loadManagerClassName| Name of load manager to use |org.apache.pulsar.broker.loadbalance.impl.SimpleLoadManagerImpl| |supportedNamespaceBundleSplitAlgorithms| Supported algorithms name for namespace bundle split |[range_equally_divide,topic_count_equally_divide]| |defaultNamespaceBundleSplitAlgorithm| Default algorithm name for namespace bundle split |range_equally_divide| |managedLedgerOffloadDriver| The directory for all the offloader implementationsoffloadersDirectory=./offloaders
. Driver to use to offload old data to long term storage (Possible values: S3, aws-s3, google-cloud-storage). When using google-cloud-storage, Make sure both Google Cloud Storage and Google Cloud Storage JSON API are enabled for the project (check from Developers Console -> Api&auth -> APIs). || |managedLedgerOffloadMaxThreads| Maximum number of thread pool threads for ledger offloading |2| |managedLedgerOffloadPrefetchRounds|The maximum prefetch rounds for ledger reading for offloading.|1| |managedLedgerUnackedRangesOpenCacheSetEnabled| Use Open Range-Set to cache unacknowledged messages |true| |managedLedgerOffloadDeletionLagMs|Delay between a ledger being successfully offloaded to long term storage and the ledger being deleted from bookkeeper | 14400000| |managedLedgerOffloadAutoTriggerSizeThresholdBytes|The number of bytes before triggering automatic offload to long term storage |-1 (disabled)| |s3ManagedLedgerOffloadRegion| For Amazon S3 ledger offload, AWS region || |s3ManagedLedgerOffloadBucket| For Amazon S3 ledger offload, Bucket to place offloaded ledger into || |s3ManagedLedgerOffloadServiceEndpoint| For Amazon S3 ledger offload, Alternative endpoint to connect to (useful for testing) || |s3ManagedLedgerOffloadMaxBlockSizeInBytes| For Amazon S3 ledger offload, Max block size in bytes. (64MB by default, 5MB minimum) |67108864| |s3ManagedLedgerOffloadReadBufferSizeInBytes| For Amazon S3 ledger offload, Read buffer size in bytes (1MB by default) |1048576| |gcsManagedLedgerOffloadRegion|For Google Cloud Storage ledger offload, region where offload bucket is located. Go to this page for more details: https://cloud.google.com/storage/docs/bucket-locations .|N/A| |gcsManagedLedgerOffloadBucket|For Google Cloud Storage ledger offload, Bucket to place offloaded ledger into.|N/A| |gcsManagedLedgerOffloadMaxBlockSizeInBytes|For Google Cloud Storage ledger offload, the maximum block size in bytes. (64MB by default, 5MB minimum)|67108864| |gcsManagedLedgerOffloadReadBufferSizeInBytes|For Google Cloud Storage ledger offload, Read buffer size in bytes. (1MB by default)|1048576| |gcsManagedLedgerOffloadServiceAccountKeyFile|For Google Cloud Storage, path to json file containing service account credentials. For more details, see the “Service Accounts” section of https://support.google.com/googleapi/answer/6158849 .|N/A| |fileSystemProfilePath|For File System Storage, file system profile path.|../conf/filesystem_offload_core_site.xml| |fileSystemURI|For File System Storage, file system uri.|N/A| |s3ManagedLedgerOffloadRole| For Amazon S3 ledger offload, provide a role to assume before writing to s3 || |s3ManagedLedgerOffloadRoleSessionName| For Amazon S3 ledger offload, provide a role session name when using a role |pulsar-s3-offload| | acknowledgmentAtBatchIndexLevelEnabled | Enable or disable the batch index acknowledgement. | false | |enableReplicatedSubscriptions|Whether to enable tracking of replicated subscriptions state across clusters.|true| |replicatedSubscriptionsSnapshotFrequencyMillis|The frequency of snapshots for replicated subscriptions tracking.|1000| |replicatedSubscriptionsSnapshotTimeoutSeconds|The timeout for building a consistent snapshot for tracking replicated subscriptions state.|30| |replicatedSubscriptionsSnapshotMaxCachedPerSubscription|The maximum number of snapshot to be cached per subscription.|10| |maxMessagePublishBufferSizeInMB|The maximum memory size for broker handling messages sent from producers. If the processing message size exceeds this value, broker stops reading data from the connection. The processing messages means messages are sent to broker but broker have not sent response to the client. Usually the message are waiting to be written to bookies. It’s shared across all the topics running in the same broker. The value-1
disables the memory limitation. By default, it is 50% of direct memory.|N/A| |messagePublishBufferCheckIntervalInMillis|Interval between checks to see if message publish buffer size exceeds the maximum. Use0
or negative number to disable the max publish buffer limiting.|100| |retentionCheckIntervalInSeconds|Check between intervals to see if consumed ledgers need to be trimmed. Use 0 or negative number to disable the check.|120| | maxMessageSize | Set the maximum size of a message. | 5242880 | | preciseTopicPublishRateLimiterEnable | Enable precise topic publish rate limiting. | false | | lazyCursorRecovery | Whether to recover cursors lazily when trying to recover a managed ledger backing a persistent topic. It can improve write availability of topics. The caveat is now when recovered ledger is ready to write we’re not sure if all old consumers’ last mark delete position(ack position) can be recovered or not. So user can make the trade off or have custom logic in application to checkpoint consumer state.| false |Client
The
pulsar-client
CLI tool can be used to publish messages to Pulsar and consume messages from Pulsar topics. This tool can be used in lieu of a client library.配置项 Description 默认值 webServiceUrl 群集的 web URL。 http://localhost:8080/ brokerServiceUrl 集群的Pulsar 协议地址。 pulsar://localhost:6650/ authPlugin 身份认证插件。 authParams 群集的身份认证参数, 逗号分隔的字符串。 useTls 是否在群集中强制执行 TLS 验证。 false tlsAllowInsecureConnection Allow TLS connections to servers whose certificate cannot be verified to have been signed by a trusted certificate authority. false tlsEnableHostnameVerification Whether the server hostname must match the common name of the certificate that is used by the server. false tlsTrustCertsFilePath useKeyStoreTls Enable TLS with KeyStore type configuration in the broker. false tlsTrustStoreType TLS TrustStore type configuration. - JKS
- PKCS12
JKS tlsTrustStore TLS TrustStore path. tlsTrustStorePassword TLS TrustStore password. 服务发现
配置项 Description 默认值 zookeeperServers Zookeeper quorum connection string (comma-separated) zooKeeperCacheExpirySeconds ZooKeeper 缓存过期时间(秒) 300 configurationStoreServers 配置存储连接字符串(以逗号分隔的列表) zookeeperSessionTimeoutMs ZooKeeper session timeout 30000 servicePort Port to use to server binary-proto request 6650 servicePortTls Port to use to server binary-proto-tls request 6651 webServicePort Port that discovery service listen on 8080 webServicePortTls Port to use to server HTTPS request 8443 bindOnLocalhost Control whether to bind directly on localhost rather than on normal hostname false authenticationEnabled Enable authentication false authenticationProviders Authentication provider name list, which is comma separated list of class names (comma-separated) authorizationEnabled Enforce authorization false superUserRoles Role names that are treated as “super-user”, meaning they will be able to do all admin operations and publish/consume from all topics (comma-separated) tlsEnabled Enable TLS false tlsCertificateFilePath TLS证书文件的路径 tlsKeyFilePath TLS私钥文件的路径 Log4j
配置项 默认值 pulsar.root.logger WARN,CONSOLE pulsar.log.dir logs pulsar.log.file pulsar.log log4j.rootLogger ${pulsar.root.logger} log4j.appender.CONSOLE org.apache.log4j.ConsoleAppender log4j.appender.CONSOLE.Threshold DEBUG log4j.appender.CONSOLE.layout org.apache.log4j.PatternLayout log4j.appender.CONSOLE.layout.ConversionPattern %d{ISO8601} - %-5p - [%t:%C{1}@%L] - %m%n log4j.appender.ROLLINGFILE org.apache.log4j.DailyRollingFileAppender log4j.appender.ROLLINGFILE.Threshold DEBUG log4j.appender.ROLLINGFILE.File ${pulsar.log.dir}/${pulsar.log.file} log4j.appender.ROLLINGFILE.layout org.apache.log4j.PatternLayout log4j.appender.ROLLINGFILE.layout.ConversionPattern %d{ISO8601} - %-5p [%t:%C{1}@%L] - %m%n log4j.appender.TRACEFILE org.apache.log4j.FileAppender log4j.appender.TRACEFILE.Threshold TRACE log4j.appender.TRACEFILE.File pulsar-trace.log log4j.appender.TRACEFILE.layout org.apache.log4j.PatternLayout log4j.appender.TRACEFILE.layout.ConversionPattern %d{ISO8601} - %-5p [%t:%C{1}@%L][%x] - %m%n 注意:log4j2.appender 中的“topic”是可配置的。 - 如果你想要将所有日志追加到单个主题,请设置相同的主题名称。 - 如果你想要将日志追加到不同的主题,你可以设置不同的主题名称。
Log4j shell
配置项 默认值 bookkeeper.root.logger ERROR,CONSOLE log4j.rootLogger ${bookkeeper.root.logger} log4j.appender.CONSOLE org.apache.log4j.ConsoleAppender log4j.appender.CONSOLE.Threshold DEBUG log4j.appender.CONSOLE.layout org.apache.log4j.PatternLayout log4j.appender.CONSOLE.layout.ConversionPattern %d{ABSOLUTE} %-5p %m%n log4j.logger.org.apache.zookeeper ERROR log4j.logger.org.apache.bookkeeper ERROR log4j.logger.org.apache.bookkeeper.bookie.BookieShell INFO Standalone
<th>
Description
</th>
<th>
默认值
</th>
<td>
If this flag is set to <code>true</code>, the broker authenticates the original Auth data; else it just accepts the originalPrincipal and authorizes it (if required).
</td>
<td>
false
</td>
<td>
The quorum connection string for local ZooKeeper
</td>
<td>
</td>
<td>
ZooKeeper 缓存过期时间(秒)
</td>
<td>
300
</td>
<td>
配置存储连接字符串(以逗号分隔的列表)
</td>
<td>
</td>
<td>
The port on which the standalone broker listens for connections
</td>
<td>
6650
</td>
<td>
THe port used by the standalone broker for HTTP requests
</td>
<td>
8080
</td>
<td>
The hostname or IP address on which the standalone service binds
</td>
<td>
0.0.0.0
</td>
<td>
The hostname or IP address that the standalone service advertises to the outside world. If not set, the value of <code>InetAddress.getLocalHost().getHostName()</code> is used.
</td>
<td>
</td>
<td>
Number of threads to use for Netty IO
</td>
<td>
2 * Runtime.getRuntime().availableProcessors()
</td>
<td>
Number of threads to use for HTTP requests processing
</td>
<td>
2 * Runtime.getRuntime().availableProcessors()
</td>
<td>
This flag controls features that are meant to be used when running in standalone mode.
</td>
<td>
N/A
</td>
<td>
The name of the cluster that this broker belongs to.
</td>
<td>
standalone
</td>
<td>
Enable cluster's failure-domain which can distribute brokers into logical region.
</td>
<td>
false
</td>
<td>
The ZooKeeper session timeout, in milliseconds.
</td>
<td>
30000
</td>
<td>
ZooKeeper operation timeout in seconds.
</td>
<td>
30
</td>
<td>
The time to wait for graceful broker shutdown. After this time elapses, the process will be killed.
</td>
<td>
60000
</td>
<td>
Flag to skip broker shutdown when broker handles Out of memory error.
</td>
<td>
false
</td>
<td>
Enable the backlog quota check, which enforces a specified action when the quota is reached.
</td>
<td>
true
</td>
<td>
How often to check for topics that have reached the backlog quota.
</td>
<td>
60
</td>
<td>
The default per-topic backlog quota limit. Being less than 0 means no limitation. By default, it is -1.
</td>
<td>
-1
</td>
<td>
The default ttl for namespaces if ttl is not configured at namespace policies.
</td>
<td>
0
</td>
<td>
Enable the deletion of inactive topics.
</td>
<td>
true
</td>
<td>
How often to check for inactive topics, in seconds.
</td>
<td>
60
</td>
<td>
Maximum pending publish requests per connection to avoid keeping large number of pending requests in memory
</td>
<td>
1000
</td>
<td>
How often to proactively check and purged expired messages.
</td>
<td>
5
</td>
<td>
How long to delay rewinding cursor and dispatching messages when active consumer is changed.
</td>
<td>
1000
</td>
<td>
How long to delete inactive subscriptions from last consumption. When it is set to 0, inactive subscriptions are not deleted automatically
</td>
<td>
0
</td>
<td>
Enable subscription message redelivery tracker to send redelivery count to consumer.
</td>
<td>
true
</td>
<td>
Whether to enable the Key_Shared subscription.
</td>
<td>
true
</td>
<td>
In the Key_Shared subscription mode, with default AUTO_SPLIT mode, use splitting ranges or consistent hashing to reassign keys to new consumers.
</td>
<td>
false
</td>
<td>
In the Key_Shared subscription mode, the number of points in the consistent-hashing ring. The greater the number, the more equal the assignment of keys to consumers.
</td>
<td>
100
</td>
<td>
How frequently to proactively check and purge expired subscription
</td>
<td>
5
</td>
<td>
Set the default behavior for message deduplication in the broker. This can be overridden per-namespace. If it is enabled, the broker rejects messages that are already stored in the topic.
</td>
<td>
false
</td>
<td>
Maximum number of producer information that it's going to be persisted for deduplication purposes
</td>
<td>
10000
</td>
<td>
Number of entries after which a deduplication information snapshot is taken. A greater interval leads to less snapshots being taken though it would increase the topic recovery time, when the entries published after the snapshot need to be replayed.
</td>
<td>
1000
</td>
<td>
停止活动的时间(分钟级别),当生产者断开连接超过这个时间,就丢弃和该生产者有关的去重信息。
</td>
<td>
360
</td>
<td>
When a namespace is created without specifying the number of bundles, this value is used as the default setting.
</td>
<td>
4
</td>
<td>
Enable checks for minimum allowed client library version.
</td>
<td>
false
</td>
<td>
Allow client libraries with no version information
</td>
<td>
true
</td>
<td>
The path for the file used to determine the rotation status for the broker when responding to service discovery health checks
</td>
<td>
/usr/local/apache/htdocs
</td>
<td>
The maximum number of unacknowledged messages allowed to be received by consumers on a shared subscription. The broker will stop sending messages to a consumer once this limit is reached or until the consumer begins acknowledging messages. A value of 0 disables the unacked message limit check and thus allows consumers to receive messages without any restrictions.
</td>
<td>
50000
</td>
<td>
The same as above, except per subscription rather than per consumer.
</td>
<td>
200000
</td>
<td>
Maximum number of unacknowledged messages allowed per broker. Once this limit reaches, the broker stops dispatching messages to all shared subscriptions which has a higher number of unacknowledged messages until subscriptions start acknowledging messages back and unacknowledged messages count reaches to limit/2. When the value is set to 0, unacknowledged message limit check is disabled and broker does not block dispatchers.
</td>
<td>
0
</td>
<td>
Once the broker reaches maxUnackedMessagesPerBroker limit, it blocks subscriptions which have higher unacknowledged messages than this percentage limit and subscription does not receive any new messages until that subscription acknowledges messages back.
</td>
<td>
0.16
</td>
<td>
Max number of partitions per partitioned topic. Use 0 or negative number to disable the check
</td>
<td>
0
</td>
<td>
There are two policies when ZooKeeper session expired happens, "shutdown" and "reconnect". If it is set to "shutdown" policy, when ZooKeeper session expired happens, the broker is shutdown. If it is set to "reconnect" policy, the broker tries to reconnect to ZooKeeper server and re-register metadata to ZooKeeper. Note: the "reconnect" policy is an experiment feature.
</td>
<td>
shutdown
</td>
<td>
Tick time to schedule task that checks topic publish rate limiting across all topics. A lower value can improve accuracy while throttling publish but it uses more CPU to perform frequent check. (Disable publish throttling with value 0)
</td>
<td>
10
</td>
<td>
Tick time to schedule task that checks broker publish rate limiting across all topics. A lower value can improve accuracy while throttling publish but it uses more CPU to perform frequent check. When the value is set to 0, publish throttling is disabled.
</td>
<td>
50
</td>
<td>
Maximum rate (in 1 second) of messages allowed to publish for a broker if the message rate limiting is enabled. When the value is set to 0, message rate limiting is disabled.
</td>
<td>
0
</td>
<td>
Maximum rate (in 1 second) of bytes allowed to publish for a broker if the byte rate limiting is enabled. When the value is set to 0, the byte rate limiting is disabled.
</td>
<td>
0
</td>
<td>
Too many subscribe requests from a consumer can cause broker rewinding consumer cursors and loading data from bookies, hence causing high network bandwidth usage. When the positive value is set, broker will throttle the subscribe requests for one consumer. Otherwise, the throttling will be disabled. By default, throttling is disabled.
</td>
<td>
0
</td>
<td>
Rate period for {subscribeThrottlingRatePerConsumer}. By default, it is 30s.
</td>
<td>
30
</td>
<td>
Default messages (per second) dispatch throttling-limit for every topic. When the value is set to 0, default message dispatch throttling-limit is disabled.
</td>
<td>
0
</td>
<td>
Default byte (per second) dispatch throttling-limit for every topic. When the value is set to 0, default byte dispatch throttling-limit is disabled.
</td>
<td>
0
</td>
<td>
Enable dispatch rate-limiting relative to publish rate.
</td>
<td>
false
</td>
<td>
The defaulted number of message dispatching throttling-limit for a subscription. The value of 0 disables message dispatch-throttling.
</td>
<td>
0
</td>
<td>
The default number of message-bytes dispatching throttling-limit for a subscription.
</td>
<td>
</td>
配置项 authenticateOriginalAuthData zookeeperServers zooKeeperCacheExpirySeconds configurationStoreServers brokerServicePort webServicePort bindAddress advertisedAddress numIOThreads numHttpServerThreads isRunningStandalone clusterName failureDomainsEnabled zooKeeperSessionTimeoutMillis zooKeeperOperationTimeoutSeconds brokerShutdownTimeoutMs skipBrokerShutdownOnOOM backlogQuotaCheckEnabled backlogQuotaCheckIntervalInSeconds backlogQuotaDefaultLimitGB ttlDurationDefaultInSeconds brokerDeleteInactiveTopicsEnabled brokerDeleteInactiveTopicsFrequencySeconds maxPendingPublishdRequestsPerConnection messageExpiryCheckIntervalInMinutes activeConsumerFailoverDelayTimeMillis subscriptionExpirationTimeMinutes subscriptionRedeliveryTrackerEnabled subscriptionKeySharedEnable subscriptionKeySharedUseConsistentHashing subscriptionKeySharedConsistentHashingReplicaPoints subscriptionExpiryCheckIntervalInMinutes brokerDeduplicationEnabled brokerDeduplicationMaxNumberOfProducers brokerDeduplicationEntriesInterval brokerDeduplicationProducerInactivityTimeoutMinutes defaultNumberOfNamespaceBundles clientLibraryVersionCheckEnabled clientLibraryVersionCheckAllowUnversioned statusFilePath maxUnackedMessagesPerConsumer maxUnackedMessagesPerSubscription maxUnackedMessagesPerBroker maxUnackedMessagesPerSubscriptionOnBrokerBlocked maxNumPartitionsPerPartitionedTopic zookeeperSessionExpiredPolicy topicPublisherThrottlingTickTimeMillis brokerPublisherThrottlingTickTimeMillis brokerPublisherThrottlingMaxMessageRate brokerPublisherThrottlingMaxByteRate subscribeThrottlingRatePerConsumer subscribeRatePeriodPerConsumerInSecond dispatchThrottlingRatePerTopicInMsg dispatchThrottlingRatePerTopicInByte dispatchThrottlingRateRelativeToPublishRate dispatchThrottlingRatePerSubscriptionInMsg dispatchThrottlingRatePerSubscriptionInByte The value of 0 disables message-byte dispatch-throttling.|0| | dispatchThrottlingOnNonBacklogConsumerEnabled | Enable dispatch-throttling for both caught up consumers as well as consumers who have backlogs. | true | |dispatcherMaxReadBatchSize|The maximum number of entries to read from BookKeeper. By default, it is 100 entries.|100| |dispatcherMaxReadSizeBytes|The maximum size in bytes of entries to read from BookKeeper. By default, it is 5MB.|5242880| |dispatcherMinReadBatchSize|The minimum number of entries to read from BookKeeper. By default, it is 1 entry. When there is an error occurred on reading entries from bookkeeper, the broker will backoff the batch size to this minimum number.|1| |dispatcherMaxRoundRobinBatchSize|The maximum number of entries to dispatch for a shared subscription. By default, it is 20 entries.|20| | preciseDispatcherFlowControl | Precise dispathcer flow control according to history message number of each entry. | false | | maxConcurrentLookupRequest | Maximum number of concurrent lookup request that the broker allows to throttle heavy incoming lookup traffic. | 50000 | | maxConcurrentTopicLoadRequest | Maximum number of concurrent topic loading request that the broker allows to control the number of zk-operations. | 5000 | | maxConcurrentNonPersistentMessagePerConnection | Maximum number of concurrent non-persistent message that can be processed per connection. | 1000 | | numWorkerThreadsForNonPersistentTopic | Number of worker threads to serve non-persistent topic. | 8 | | enablePersistentTopics | Enable broker to load persistent topics. | true | | enableNonPersistentTopics | Enable broker to load non-persistent topics. | true | | maxProducersPerTopic | Maximum number of producers allowed to connect to topic. Once this limit reaches, the broker rejects new producers until the number of connected producers decreases. When the value is set to 0, maxProducersPerTopic-limit check is disabled. | 0 | | maxConsumersPerTopic | Maximum number of consumers allowed to connect to topic. Once this limit reaches, the broker rejects new consumers until the number of connected consumers decreases. When the value is set to 0, maxConsumersPerTopic-limit check is disabled. | 0 | | maxConsumersPerSubscription | Maximum number of consumers allowed to connect to subscription. Once this limit reaches, the broker rejects new consumers until the number of connected consumers decreases. When the value is set to 0, maxConsumersPerSubscription-limit check is disabled. | 0 | | maxNumPartitionsPerPartitionedTopic | Maximum number of partitions per partitioned topic. When the value is set to a negative number or is set to 0, the check is disabled. | 0 | | tlsCertRefreshCheckDurationSec | TLS certificate refresh duration in seconds. When the value is set to 0, check the TLS certificate on every new connection. | 300 | | tlsCertificateFilePath | Path for the TLS certificate file. | | | tlsKeyFilePath | Path for the TLS private key file. | | | tlsTrustCertsFilePath | Path for the trusted TLS certificate file.| | | tlsAllowInsecureConnection | Accept untrusted TLS certificate from the client. If it is set to true, a client with a certificate which cannot be verified with the ‘tlsTrustCertsFilePath’ certificate is allowed to connect to the server, though the certificate is not be used for client authentication. | false | | tlsProtocols | Specify the TLS protocols the broker uses to negotiate during TLS handshake. | | | tlsCiphers | Specify the TLS cipher the broker uses to negotiate during TLS Handshake. | | | tlsRequireTrustedClientCertOnConnect | Trusted client certificates are required for to connect TLS. Reject the Connection if the client certificate is not trusted. In effect, this requires that all connecting clients perform TLS client authentication. | false | | tlsEnabledWithKeyStore | Enable TLS with KeyStore type configuration in broker. | false | | tlsProvider | TLS Provider for KeyStore type. | | | tlsKeyStoreType | TLS KeyStore type configuration in the broker.
- JKS
- PKCS12 |JKS| | tlsKeyStore | TLS KeyStore path in the broker. | | | tlsKeyStorePassword | TLS KeyStore password for the broker. | | | tlsTrustStoreType | TLS TrustStore type configuration in the broker
- JKS
- PKCS12 |JKS| | tlsTrustStore | TLS TrustStore path in the broker. | | | tlsTrustStorePassword | TLS TrustStore password for the broker. | | | brokerClientTlsEnabledWithKeyStore | Configure whether the internal client uses the KeyStore type to authenticate with Pulsar brokers. | false | | brokerClientSslProvider | The TLS Provider used by the internal client to authenticate with other Pulsar brokers. | | | brokerClientTlsTrustStoreType | TLS TrustStore type configuration for the internal client to authenticate with Pulsar brokers.
- JKS
PKCS12 | JKS | | brokerClientTlsTrustStore | TLS TrustStore path for the internal client to authenticate with Pulsar brokers. | | | brokerClientTlsTrustStorePassword | TLS TrustStore password for the internal client to authenticate with Pulsar brokers. | | | brokerClientTlsCiphers | Specify the TLS cipher that the internal client uses to negotiate during TLS Handshake. | | | brokerClientTlsProtocols | Specify the TLS protocols that the broker uses to negotiate during TLS handshake. | | systemTopicEnabled | Enable/Disable system topics. | false | | topicLevelPoliciesEnabled | Enable or disable topic level policies. Topic level policies depends on the system topic. Please enable the system topic first. | false | | proxyRoles | Role names that are treated as “proxy roles”. If the broker sees a request with role as proxyRoles, it demands to see a valid original principal. | | | authenticateOriginalAuthData | If this flag is set, the broker authenticates the original Auth data. Otherwise, it just accepts the originalPrincipal and authorizes it (if required). | false | |authenticationEnabled| Enable authentication for the broker. |false| |authenticationProviders| A comma-separated list of class names for authentication providers. |false| |authorizationEnabled| Enforce authorization in brokers. |false| | authorizationProvider | Authorization provider fully qualified class-name. | org.apache.pulsar.broker.authorization.PulsarAuthorizationProvider | | authorizationAllowWildcardsMatching | Allow wildcard matching in authorization. Wildcard matching is applicable only when the wildcard-character (
) presents at the first or last position. | false | |superUserRoles| Role names that are treated as “superusers.” Superusers are authorized to perform all admin tasks. | | |brokerClientAuthenticationPlugin| The authentication settings of the broker itself. Used when the broker connects to other brokers either in the same cluster or from other clusters. | | |brokerClientAuthenticationParameters| The parameters that go along with the plugin specified using brokerClientAuthenticationPlugin. | | |athenzDomainNames| Supported Athenz authentication provider domain names as a comma-separated list. | | | anonymousUserRole | When this parameter is not empty, unauthenticated users perform as anonymousUserRole. | | |tokenAuthClaim| Specify the token claim that will be used as the authentication “principal” or “role”. The “subject” field will be used if this is left blank || |tokenAudienceClaim| The token audience “claim” name, e.g. “aud”. It is used to get the audience from token. If it is not set, the audience is not verified. || | tokenAudience | The token audience stands for this broker. The field
tokenAudienceClaim
of a valid token need contains this parameter.| | |saslJaasClientAllowedIds|This is a regexp, which limits the range of possible ids which can connect to the Broker using SASL. By default, it is set toSaslConstants.JAAS_CLIENT_ALLOWED_IDS_DEFAULT
, which is “.pulsar.*“, so only clients whose id contains ‘pulsar’ are allowed to connect.|N/A| |saslJaasBrokerSectionName|Service Principal, for login context name. By default, it is set toSaslConstants.JAAS_DEFAULT_BROKER_SECTION_NAME
, which is “Broker”.|N/A| |httpMaxRequestSize|If the value is larger than 0, it rejects all HTTP requests with bodies larged than the configured limit.|-1| |exposePreciseBacklogInPrometheus| Enable expose the precise backlog stats, set false to use published counter and consumed counter to calculate, this would be more efficient but may be inaccurate. |false| |bookkeeperMetadataServiceUri|Metadata service uri is what BookKeeper used for loading corresponding metadata driver and resolving its metadata service location. This value can be fetched usingbookkeeper shell whatisinstanceid
command in BookKeeper cluster. For example:zk+hierarchical://localhost:2181/ledgers
. The metadata service uri list can also be semicolon separated values like:zk+hierarchical://zk1:2181;zk2:2181;zk3:2181/ledgers
.|N/A| |bookkeeperClientAuthenticationPlugin| Authentication plugin to be used when connecting to bookies (BookKeeper servers). || |bookkeeperClientAuthenticationParametersName| BookKeeper authentication plugin implementation parameters and values. || |bookkeeperClientAuthenticationParameters| Parameters associated with the bookkeeperClientAuthenticationParametersName || |bookkeeperClientTimeoutInSeconds| Timeout for BookKeeper add and read operations. |30| |bookkeeperClientSpeculativeReadTimeoutInMillis| Speculative reads are initiated if a read request doesn’t complete within a certain time. A value of 0 disables speculative reads. |0| |bookkeeperUseV2WireProtocol|Use older Bookkeeper wire protocol with bookie.|true| |bookkeeperClientHealthCheckEnabled| Enable bookie health checks. |true| |bookkeeperClientHealthCheckIntervalSeconds| The time interval, in seconds, at which health checks are performed. New ledgers are not created during health checks. |60| |bookkeeperClientHealthCheckErrorThresholdPerInterval| Error threshold for health checks. |5| |bookkeeperClientHealthCheckQuarantineTimeInSeconds| If bookies have more than the allowed number of failures within the time interval specified by bookkeeperClientHealthCheckIntervalSeconds |1800| |bookkeeperGetBookieInfoIntervalSeconds|Specify options for the GetBookieInfo check. This setting helps ensure the list of bookies that are up to date on the brokers.|86400| |bookkeeperGetBookieInfoRetryIntervalSeconds|Specify options for the GetBookieInfo check. This setting helps ensure the list of bookies that are up to date on the brokers.|60| |bookkeeperClientRackawarePolicyEnabled| |true| |bookkeeperClientRegionawarePolicyEnabled| |false| |bookkeeperClientMinNumRacksPerWriteQuorum| |2| |bookkeeperClientMinNumRacksPerWriteQuorum| |false| |bookkeeperClientReorderReadSequenceEnabled| |false| |bookkeeperClientIsolationGroups||| |bookkeeperClientSecondaryIsolationGroups| Enable bookie secondary-isolation group if bookkeeperClientIsolationGroups doesn’t have enough bookie available. || |bookkeeperClientMinAvailableBookiesInIsolationGroups| bookkeeperClientIsolationGroups 中应可用的最少 bookie 数,否则 broker 会将 bookkeeperClientSecondaryIsolationGroups 的 bookie 囊括在隔离列表中。 || | bookkeeperTLSProviderFactoryClass | Set the client security provider factory class name. | org.apache.bookkeeper.tls.TLSContextFactory | | bookkeeperTLSClientAuthentication | Enable TLS authentication with bookie. | false | | bookkeeperTLSKeyFileType | Supported type: PEM, JKS, PKCS12. | PEM | | bookkeeperTLSTrustCertTypes | Supported type: PEM, JKS, PKCS12. | PEM | | bookkeeperTLSKeyStorePasswordPath | Path to file containing keystore password, if the client keystore is password protected. | | bookkeeperTLSTrustStorePasswordPath | Path to file containing truststore password, if the client truststore is password protected. | | | bookkeeperTLSKeyFilePath | Path for the TLS private key file. | | | bookkeeperTLSCertificateFilePath | Path for the TLS certificate file. | | | bookkeeperTLSTrustCertsFilePath | Path for the trusted TLS certificate file. | | | bookkeeperDiskWeightBasedPlacementEnabled | Enable/Disable disk weight based placement. | false | | bookkeeperExplicitLacIntervalInMills | Set the interval to check the need for sending an explicit LAC. When the value is set to 0, no explicit LAC is sent. | 0 | | bookkeeperClientExposeStatsToPrometheus | Expose BookKeeper client managed ledger stats to Prometheus. | false | |managedLedgerDefaultEnsembleSize| |1| |managedLedgerDefaultWriteQuorum| |1| |managedLedgerDefaultAckQuorum| |1| | managedLedgerDigestType | Default type of checksum to use when writing to BookKeeper. | CRC32C | | managedLedgerNumWorkerThreads | Number of threads to be used for managed ledger tasks dispatching. | 8 | | managedLedgerNumSchedulerThreads | Number of threads to be used for managed ledger scheduled tasks. | 8 | |managedLedgerCacheSizeMB| |N/A| |managedLedgerCacheCopyEntries| Whether to copy the entry payloads when inserting in cache.| false| |managedLedgerCacheEvictionWatermark| |0.9| |managedLedgerCacheEvictionFrequency| Configure the cache eviction frequency for the managed ledger cache (evictions/sec) | 100.0 | |managedLedgerCacheEvictionTimeThresholdMillis| All entries that have stayed in cache for more than the configured time, will be evicted | 1000 | |managedLedgerCursorBackloggedThreshold| Configure the threshold (in number of entries) from where a cursor should be considered ‘backlogged’ and thus should be set as inactive. | 1000| |managedLedgerUnackedRangesOpenCacheSetEnabled| Use Open Range-Set to cache unacknowledged messages |true| |managedLedgerDefaultMarkDeleteRateLimit| |0.1| |managedLedgerMaxEntriesPerLedger| |50000| |managedLedgerMinLedgerRolloverTimeMinutes| |10| |managedLedgerMaxLedgerRolloverTimeMinutes| |240| |managedLedgerCursorMaxEntriesPerLedger| |50000| |managedLedgerCursorRolloverTimeInSeconds| |14400| | managedLedgerMaxSizePerLedgerMbytes | Maximum ledger size before triggering a rollover for a topic. | 2048 | | managedLedgerMaxUnackedRangesToPersist | Maximum number of “acknowledgment holes” that are going to be persistently stored. When acknowledging out of order, a consumer leaves holes that are supposed to be quickly filled by acknowledging all the messages. The information of which messages are acknowledged is persisted by compressing in “ranges” of messages that were acknowledged. After the max number of ranges is reached, the information is only tracked in memory and messages are redelivered in case of crashes. | 10000 | | managedLedgerMaxUnackedRangesToPersistInZooKeeper | Maximum number of “acknowledgment holes” that can be stored in Zookeeper. If the number of unacknowledged message range is higher than this limit, the broker persists unacknowledged ranges into bookkeeper to avoid additional data overhead into Zookeeper. | 1000 | |autoSkipNonRecoverableData| |false| | managedLedgerMetadataOperationsTimeoutSeconds | Operation timeout while updating managed-ledger metadata. | 60 | | managedLedgerReadEntryTimeoutSeconds | Read entries timeout when the broker tries to read messages from BookKeeper. | 0 | | managedLedgerAddEntryTimeoutSeconds | Add entry timeout when the broker tries to publish message to BookKeeper. | 0 | | managedLedgerNewEntriesCheckDelayInMillis | New entries check delay for the cursor under the managed ledger. If no new messages in the topic, the cursor tries to check again after the delay time. For consumption latency sensitive scenario, you can set the value to a smaller value or 0. Of course, a smaller value may degrade consumption throughput.|10 ms| | managedLedgerPrometheusStatsLatencyRolloverSeconds | Managed ledger prometheus stats latency rollover seconds. | 60 | | managedLedgerTraceTaskExecution | Whether to trace managed ledger task execution time. | true | |managedLedgerNewEntriesCheckDelayInMillis|New entries check delay for the cursor under the managed ledger. If no new messages in the topic, the cursor will try to check again after the delay time. For consumption latency sensitive scenario, it can be set to a smaller value or 0. A smaller value degrades consumption throughput. By default, it is 10ms.|10| |loadBalancerEnabled| |false| |loadBalancerPlacementStrategy| |weightedRandomSelection| |loadBalancerReportUpdateThresholdPercentage| |10| |loadBalancerReportUpdateMaxIntervalMinutes| |15| |loadBalancerHostUsageCheckIntervalMinutes| |1| |loadBalancerSheddingIntervalMinutes| |30| |loadBalancerSheddingGracePeriodMinutes| |30| |loadBalancerBrokerMaxTopics| |50000| |loadBalancerBrokerUnderloadedThresholdPercentage| |1| |loadBalancerBrokerOverloadedThresholdPercentage| |85| |loadBalancerResourceQuotaUpdateIntervalMinutes| |15| |loadBalancerBrokerComfortLoadLevelPercentage| |65| |loadBalancerAutoBundleSplitEnabled| |false| | loadBalancerAutoUnloadSplitBundlesEnabled | Enable/Disable automatic unloading of split bundles. | true | |loadBalancerNamespaceBundleMaxTopics| |1000| |loadBalancerNamespaceBundleMaxSessions| |1000| |loadBalancerNamespaceBundleMaxMsgRate| |1000| |loadBalancerNamespaceBundleMaxBandwidthMbytes| |100| |loadBalancerNamespaceMaximumBundles| |128| | loadBalancerBrokerThresholdShedderPercentage | The broker resource usage threshold. When the broker resource usage is greater than the pulsar cluster average resource usage, the threshold shedder is triggered to offload bundles from the broker. It only takes effect in the ThresholdSheddler strategy. | 10 | | loadBalancerHistoryResourcePercentage | The history usage when calculating new resource usage. It only takes effect in the ThresholdSheddler strategy. | 0.9 | | loadBalancerBandwithInResourceWeight | The BandWithIn usage weight when calculating new resource usage. It only takes effect in the ThresholdSheddler strategy. | 1.0 | | loadBalancerBandwithOutResourceWeight | The BandWithOut usage weight when calculating new resource usage. It only takes effect in the ThresholdSheddler strategy. | 1.0 | | loadBalancerCPUResourceWeight | The CPU usage weight when calculating new resource usage. It only takes effect in the ThresholdSheddler strategy. | 1.0 | | loadBalancerMemoryResourceWeight | The heap memory usage weight when calculating new resource usage. It only takes effect in the ThresholdSheddler strategy. | 1.0 | | loadBalancerDirectMemoryResourceWeight | The direct memory usage weight when calculating new resource usage. It only takes effect in the ThresholdSheddler strategy. | 1.0 | | loadBalancerBundleUnloadMinThroughputThreshold | Bundle unload minimum throughput threshold. Avoid bundle unload frequently. It only takes effect in the ThresholdSheddler strategy. | 10 | |replicationMetricsEnabled| |true| |replicationConnectionsPerBroker| |16| |replicationProducerQueueSize| |1000| | replicationPolicyCheckDurationSeconds | Duration to check replication policy to avoid replicator inconsistency due to missing ZooKeeper watch. When the value is set to 0, disable checking replication policy. | 600 | |defaultRetentionTimeInMinutes| |0| |defaultRetentionSizeInMB| |0| |keepAliveIntervalSeconds| |30|WebSocket
配置项 Description 默认值 configurationStoreServers zooKeeperSessionTimeoutMillis 30000 zooKeeperCacheExpirySeconds ZooKeeper 缓存过期时间(秒) 300 serviceUrl serviceUrlTls brokerServiceUrl brokerServiceUrlTls webServicePort 8080 webServicePortTls 8443 bindAddress 0.0.0.0 clusterName authenticationEnabled false authenticationProviders authorizationEnabled false superUserRoles brokerClientAuthenticationPlugin brokerClientAuthenticationParameters tlsEnabled false tlsAllowInsecureConnection false tlsCertificateFilePath tlsKeyFilePath tlsTrustCertsFilePath Pulsar proxy
The Pulsar proxy can be configured in the
conf/proxy.conf
file.配置项 Description 默认值 forwardAuthorizationCredentials Forward client authorization credentials to Broker for re-authorization, and make sure authentication is enabled for this to take effect. false zookeeperServers ZooKeeper quorum 连接字符串(以逗号分隔的列表) configurationStoreServers 配置存储连接字符串(以逗号分隔的列表) brokerServiceURL The service URL pointing to the broker cluster. brokerServiceURLTLS The TLS service URL pointing to the broker cluster brokerWebServiceURL The Web service URL pointing to the broker cluster brokerWebServiceURLTLS The TLS Web service URL pointing to the broker cluster functionWorkerWebServiceURL The Web service URL pointing to the function worker cluster. It is only configured when you setup function workers in a separate cluster. functionWorkerWebServiceURLTLS The TLS Web service URL pointing to the function worker cluster. It is only configured when you setup function workers in a separate cluster. brokerServiceURL If service discovery is disabled, this url should point to the discovery service provider. N/A brokerServiceURLTLS If service discovery is disabled, this url should point to the discovery service provider. N/A brokerWebServiceURL This settings are unnecessary if zookeeperServers
is specified.N/A brokerWebServiceURLTLS This settings are unnecessary if zookeeperServers
is specified.N/A functionWorkerWebServiceURL If function workers are setup in a separate cluster, configure the this setting to point to the function workers cluster. N/A functionWorkerWebServiceURLTLS If function workers are setup in a separate cluster, configure the this setting to point to the function workers cluster. N/A zookeeperSessionTimeoutMs ZooKeeper会话超时(以毫秒为单位) 30000 zooKeeperCacheExpirySeconds ZooKeeper 缓存过期时间(秒) 300 advertisedAddress Hostname or IP address the service advertises to the outside world. If not set, the value of InetAddress.getLocalHost().getHostname()
is used.N/A servicePort 用于服务器二进制Protobuf请求的端口 6650 servicePortTls 用于服务器二进制Protobuf TLS请求的端口 6651 statusFilePath 在响应服务发现健康检查时,用于确定代理实例的轮换状态的文件的路径 advertisedAddress Hostname or IP address the service advertises to the outside world. InetAddress.getLocalHost().getHostname()
proxyLogLevel Proxy log level - 0: Do not log any TCP channel information.
- 1: Parse and log any TCP channel information and command information without message body.
- 2: Parse and log channel information, command information and message body.
0 authenticationEnabled 是否为Pulsar代理启用身份验证 false authenticateMetricsEndpoint Whether the ‘/metrics’ endpoint requires authentication. Defaults to true. ‘authenticationEnabled’ must also be set for this to take effect. true authenticationProviders 身份验证提供者名称列表(以逗号分隔的类名列表) authorizationEnabled 是否由Pulsar代理强制执行授权 false authorizationProvider 授权提供程序的完全限定类名 org.apache.pulsar.broker.authorization.PulsarAuthorizationProvider anonymousUserRole When this parameter is not empty, unauthenticated users perform as anonymousUserRole. brokerClientAuthenticationPlugin Pulsar代理使用的身份验证插件,用于对Pulsar brokers进行身份验证 brokerClientAuthenticationParameters Pulsar代理用于对Pulsar Brokers进行身份验证的参数 brokerClientTrustCertsFilePath Pulsar代理用于对Pulsar Brokers进行身份验证的可信证书的路径 superUserRoles “超级用户”的角色名,这意味着它们将能够执行所有管理 forwardAuthorizationCredentials Whether client authorization credentials are forwared to the broker for re-authorization. Authentication must be enabled via authenticationEnabled=true for this to take effect. false maxConcurrentInboundConnections Max concurrent inbound connections. The proxy will reject requests beyond that. 10000 maxConcurrentLookupRequests Max concurrent outbound connections. The proxy will error out requests beyond that. 50000 tlsEnabledInProxy Deprecated - use servicePortTls
andwebServicePortTls
instead.false tlsEnabledWithBroker Whether TLS is enabled when communicating with Pulsar brokers. false tlsCertRefreshCheckDurationSec TLS certificate refresh duration in seconds. If the value is set 0, check TLS certificate every new connection. 300 tlsCertificateFilePath TLS证书文件的路径 tlsKeyFilePath TLS私钥文件的路径 tlsTrustCertsFilePath 受信任的TLS证书pem文件的路径 tlsHostnameVerificationEnabled 当代理与brokers建立TLS连接时是否验证主机名 false tlsRequireTrustedClientCertOnConnect Whether client certificates are required for TLS. Connections are rejected if the client certificate isn’t trusted. false tlsProtocols Specify the tls protocols the broker will use to negotiate during TLS Handshake. Multiple values can be specified, separated by commas. Example:- TLSv1.2
,TLSv1.1
,TLSv1
tlsCiphers Specify the tls cipher the broker will use to negotiate during TLS Handshake. Multiple values can be specified, separated by commas. Example:- TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
httpReverseProxyConfigs HTTP directs to redirect to non-pulsar services httpOutputBufferSize HTTP output buffer size. The amount of data that will be buffered for HTTP requests before it is flushed to the channel. A larger buffer size may result in higher HTTP throughput though it may take longer for the client to see data. If using HTTP streaming via the reverse proxy, this should be set to the minimum value (1) so that clients see the data as soon as possible. 32768 httpNumThreads Number of threads to use for HTTP requests processing 2 * Runtime.getRuntime().availableProcessors() tokenSecretKey Configure the secret key to be used to validate auth tokens. The key can be specified like: tokenSecretKey=data:;base64,xxxxxxxxx
ortokenSecretKey=file:///my/secret.key
tokenPublicKey Configure the public key to be used to validate auth tokens. The key can be specified like: tokenPublicKey=data:;base64,xxxxxxxxx
ortokenPublicKey=file:///my/secret.key
tokenAuthClaim Specify the token claim that will be used as the authentication “principal” or “role”. The “subject” field will be used if this is left blank tokenAudienceClaim The token audience “claim” name, e.g. “aud”. It is used to get the audience from token. If it is not set, the audience is not verified. tokenAudience The token audience stands for this broker. The field tokenAudienceClaim
of a valid token need contains this parameter.proxyLogLevel Set the Pulsar Proxy log level. - If the value is set to 0, no TCP channel information is logged.
- If the value is set to 1, only the TCP channel information and command information (without message body) are parsed and logged.
- If the value is set to 2, all TCP channel information, command information, and message body are parsed and logged.
0 ZooKeeper
ZooKeeper handles a broad range of essential configuration- and coordination-related tasks for Pulsar. The default configuration file for ZooKeeper is in the
conf/zookeeper.conf
file in your Pulsar installation. The following parameters are available:配置项 Description 默认值 tickTime The tick is the basic unit of time in ZooKeeper, measured in milliseconds and used to regulate things like heartbeats and timeouts. tickTime is the length of a single tick. 2000 initLimit The maximum time, in ticks, that the leader ZooKeeper server allows follower ZooKeeper servers to successfully connect and sync. The tick time is set in milliseconds using the tickTime parameter. 10 syncLimit The maximum time, in ticks, that a follower ZooKeeper server is allowed to sync with other ZooKeeper servers. The tick time is set in milliseconds using the tickTime parameter. 5 dataDir The location where ZooKeeper will store in-memory database snapshots as well as the transaction log of updates to the database. data/zookeeper clientPort The port on which the ZooKeeper server will listen for connections. 2181 admin.enableServer The port at which the admin listens. true admin.serverPort The port at which the admin listens. 9990 autopurge.snapRetainCount ZooKeeper 中有快照自动清理机制。该参数指定在 autopurge.purgeInterval 配置的时间间隔内,可以保留的快照文件的数量。 3 autopurge.purgeInterval The time interval, in hours, by which the ZooKeeper database purge task is triggered. Setting to a non-zero number will enable auto purge; setting to 0 will disable. Read this guide before enabling auto purge. 1 forceSync Requires updates to be synced to media of the transaction log before finishing processing the update. If this option is set to ‘no’, ZooKeeper will not require updates to be synced to the media. WARNING: it’s not recommended to run a production ZK cluster with forceSync
disabled.是 maxClientCnxns The maximum number of client connections. Increase this if you need to handle more ZooKeeper clients. 60 In addition to the parameters in the table above, configuring ZooKeeper for Pulsar involves adding a
server.N
line to theconf/zookeeper.conf
file for each node in the ZooKeeper cluster, whereN
is the number of the ZooKeeper node. Here’s an example for a three-node ZooKeeper cluster:server.1=zk1.us-west.example.com:2888:3888
server.2=zk2.us-west.example.com:2888:3888
server.3=zk3.us-west.example.com:2888:3888
We strongly recommend consulting the ZooKeeper Administrator’s Guide for a more thorough and comprehensive introduction to ZooKeeper configuration