附录 A. 代理配置参数
advertised.listeners
Type: string
Default: null
Importance: high
Dynamic update: per-broker
与监听器配置属性不同,要发布到 ZooKeeper
的监听程序
供客户端使用。在 IaaS 环境中,这可能需要与代理绑定到的接口不同。如果没有设置,则使用监听程序
的值。与监听器
不同,公告 0.0.0.0 meta-address 无效。与监听器
不同,此属性中可能存在重复的端口,以便可以配置一个侦听器来公告另一个侦听器的地址。这在使用外部负载均衡器时很有用。auto.create.topics.enable
Type: boolean
Default: true
Importance: high
Dynamic update: read-only
在服务器上启用自动创建主题。
auto.leader.rebalance.enable
Type: boolean
Default: true
Importance: high
Dynamic update: read-only
启用自动领导平衡。后台线程会定期检查分区领导分布,由
leader.imbalance.check.interval.seconds
进行配置。如果领导 imbalance 超过leader.imbalance.per.broker.percentage
,则触发领导到分区的首选领导。background.threads
type: int
Default: 10
Valid Values: [1,…]
Importance: high
Dynamic update: cluster-wide
用于各种后台处理任务的线程数量。
broker.id
type: int
Default: -1
Importance: high
Dynamic update: read-only
此服务器的代理 ID。如果未设置,则会生成唯一的代理 id。要避免 zookeeper 生成的代理 ID 和用户配置的代理 ID 间的冲突,从 reserved.broker.max.id + 1 中生成代理 ids start。
compression.type
Type: string
Default: producer
Importance: high
Dynamic update: cluster-wide
指定给定主题的最终压缩类型。此配置接受标准压缩解码器('gzip', 'snappy', 'lz4', 'zstd')。它还接受等同于没有压缩的 'uncompressed';而 'producer' 表示保留由 producer 设置的原始压缩 codec。
control.plane.listener.name
Type: string
Default: null
Importance: high
Dynamic update: read-only
用于控制器和代理之间的通信的监听程序名称。代理将使用 control.plane.listener.name 在监听器列表中找到端点,以侦听来自控制器的连接。例如,如果代理的配置为:listeners = INTERNAL://192.1.1.8:9092, EXTERNAL://10.1.1.5:9093, CONTROLLER://192.1.1.8:9094 listener.security.protocol.map = INTERNAL:PLAINTEXT, EXTERNAL:SSL, CONTROLLER:SSL control.plane.listener.name = CONTROLLER On startup, the broker will start listening on "192.1.1.8:9094" with security protocol "SSL"。在控制器一侧,当它通过 zookeeper 发现代理发布的端点时,它将使用 control.plane.listener.name 找到端点,它将用来与代理建立连接。例如,如果代理公布的在 zookeeper 上的端的为: "endpoints" : ["INTERNAL://broker1.example.com:9092","EXTERNAL://broker1.example.com:9093","CONTROLLER://broker1.example.com:9094"] and the controller’s config is : listener.security.protocol.map = INTERNAL:PLAINTEXT, EXTERNAL:SSL, CONTROLLER:SSL control.plane.listener.name = CONTROLLER then controller will use "broker1.example.com:9094" with security protocol "SSL" to connect to the broker。如果没有显式配置,则默认值为 null,且没有控制器连接的专用端点。
controller.listener.names
Type: string
Default: null
Importance: high
Dynamic update: read-only
控制器使用的监听程序名称的逗号分隔列表。这在 KRaft 模式下运行时需要。基于 ZK 的控制器不会使用这个配置。
controller.quorum.election.backoff.max.ms
type: int
Default: 1000 (1 second)
Importance: high
Dynamic update: read-only
开始新选举前的最长时间(毫秒)。这在有助于防止网格锁定的二进制指数 backoff 机制中使用。
controller.quorum.election.timeout.ms
type: int
Default: 1000 (1 second)
Importance: high
Dynamic update: read-only
在触发新选举前,等待的最长时间(以毫秒为单位),而无需从领导中获取。
controller.quorum.fetch.timeout.ms
type: int
Default: 2000 (2 seconds)
Importance: high
Dynamic update: read-only
在成为候选人并触发票务选举前,不成功从当前领导获得的最长时间;在询问是否有新时机之前从大多数仲裁中获取的最长时间。
controller.quorum.voters
type: list
Default: ""
Valid Values: non-empty list
Importance: high
Dynamic update: read-only
在以逗号分隔的
{id}@{host}:{port}
条目列表中,为一组 voters 的 id/endpoint 信息映射。例如:1@localhost:9092,2@localhost:9093,3@localhost:9094
.delete.topic.enable
Type: boolean
Default: true
Importance: high
Dynamic update: read-only
启用删除主题。如果关闭此配置,通过 admin 工具删除主题将无效。
leader.imbalance.check.interval.seconds
Type: long
Default: 300
Importance: high
Dynamic update: read-only
控制器触发分区重新平衡检查的频率。
leader.imbalance.per.broker.percentage
Type: int
Default: 10
Importance: high
Dynamic update: read-only
每个代理允许的 leader 的比率。如果每个代理超过这个值,控制器会触发领导平衡。该值以百分比为单位。
监听器
Type: string
Default: PLAINTEXT://:9092
Importance: high
Dynamic update: per-broker
侦听器列表 - 我们将侦听的 URI 列表和侦听器名称。如果侦听器名称不是安全协议,还必须设置
listener.security.protocol.map
。侦听器名称和端口号必须是唯一的。将 hostname 指定为 0.0.0.0 以绑定到所有接口。将 hostname 留空,以绑定到默认接口。法律侦听器列表示例: PLAINTEXT://myhost:9092,SSL://:9091 CLIENT://0.0.0.0:9092,REPLICATION://localhost:9093。log.dir
type: string
Default: /tmp/kafka-logs
Importance: high
Dynamic update: read-only
保存日志数据的目录(为 log.dirs 属性提供)。
log.dirs
Type: string
Default: null
Importance: high
Dynamic update: read-only
保存日志数据的目录。如果没有设置,则使用 log.dir 的值。
log.flush.interval.messages
type: long
Default: 9223372036854775807
Valid Values: [1,…]
Importance: high
Dynamic update: cluster-wide
在消息刷新到磁盘前,日志分区上积累的消息数量。
log.flush.interval.ms
Type: long
Default: null
Importance: high
Dynamic update: cluster-wide
在刷新到磁盘前,任何主题中的消息保存在内存中的最长时间( ms)。如果没有设置,则使用 log.flush.scheduler.interval.ms 中的值。
log.flush.offset.checkpoint.interval.ms
type: int
Default: 60000 (1 minute)
Valid Values: [0,…]
Importance: high
Dynamic update: read-only
更新最后一次刷新的持久记录的频率,该记录充当日志恢复点。
log.flush.scheduler.interval.ms
type: long
Default: 9223372036854775807
Importance: high
Dynamic update: read-only
日志清除程序的频率(ms)检查是否需要清空到磁盘中的日志。
log.flush.start.offset.checkpoint.interval.ms
type: int
Default: 60000 (1 minute)
Valid Values: [0,…]
Importance: high
Dynamic update: read-only
我们更新日志启动偏移的永久记录的频率。
log.retention.bytes
Type: long
Default: -1
Importance: high
Dynamic update: cluster-wide
删除日志前的最大大小。
log.retention.hours
type: int
Default: 168
Importance: high
Dynamic update: read-only
删除日志文件前的小时数(以小时为单位),以及 log.retention.ms 属性的几小时数。
log.retention.minutes
type: int
Default: null
Importance: high
Dynamic update: read-only
在删除日志文件前(以分钟为单位)保留日志文件的分钟数,次要到 log.retention.ms 属性。如果没有设置,则使用 log.retention.hours 中的值。
log.retention.ms
Type: long
Default: null
Importance: high
Dynamic update: cluster-wide
删除日志文件前的毫秒数(以毫秒为单位),如果没有设置,则使用 log.retention.minutes 的值。如果设置为 -1,则不会应用时间限制。
log.roll.hours
type: int
Default: 168
Valid Values: [1,…]
Importance: high
Dynamic update: read-only
推出新日志段前的最长时间(以小时为单位),二级到 log.roll.ms 属性。
log.roll.jitter.hours
type: int
Default: 0
Valid Values: [0,…]
Importance: high
Dynamic update: read-only
从 logRollTimeMillis (以小时为单位)中减去的最大 jitter,次要到 log.roll.jitter.ms 属性。
log.roll.jitter.ms
Type: long
Default: null
Importance: high
Dynamic update: cluster-wide
从 logRollTimeMillis (以毫秒为单位)中减去的最大 jitter。如果没有设置,则使用 log.roll.jitter.hours 中的值。
log.roll.ms
Type: long
Default: null
Importance: high
Dynamic update: cluster-wide
推出新日志段前的最长时间(以毫秒为单位)。如果没有设置,则使用 log.roll.hours 中的值。
log.segment.bytes
type: int
Default: 1073741824 (1 gibibyte)
Valid Values: [14,…]
Importance: high
Dynamic update: cluster-wide
单个日志文件的最大大小。
log.segment.delete.delay.ms
type: long
Default: 60000 (1 minute)
Valid Values: [0,…]
Importance: high
Dynamic update: cluster-wide
从文件系统中删除文件前等待的时间。
message.max.bytes
type: int
Default: 1048588
Valid Values: [0,…]
Importance: high
Dynamic update: cluster-wide
Kafka 允许的最大记录批处理大小(如果启用了压缩,在压缩后进行压缩)。如果这被增加,且有 0.10.2 旧的消费者,还必须增加用户的获取大小,以便他们可以获取记录批处理。在最新的消息格式版本中,记录始终分组到批处理中,以获得效率。在以前的消息格式版本中,未压缩记录没有分组到批处理中,在这种情况下,这个限制仅适用于单个记录。可以使用主题级别
max.message.bytes
配置为每个主题设置。metadata.log.dir
Type: string
Default: null
Importance: high
Dynamic update: read-only
此配置决定了将集群元数据日志放在 KRaft 模式的位置。如果没有设置,则元数据日志会放置在 log.dirs 的第一个日志目录中。
metadata.log.max.record.bytes.between.snapshots
type: long
Default: 20971520
Valid Values: [1,…]
Importance: high
Dynamic update: read-only
这是生成新快照前日志的最大字节数,以及生成新快照前所需的高水位线之间的最大字节数。
metadata.log.segment.bytes
type: int
Default: 1073741824 (1 gibibyte)
Valid Values: [12,…]
Importance: high
Dynamic update: read-only
单个元数据日志文件的最大大小。
metadata.log.segment.ms
Type: long
Default: 604800000 (7 days)
Importance: high
Dynamic update: read-only
推出新元数据日志文件前的最长时间(以毫秒为单位)。
metadata.max.retention.bytes
Type: long
Default: -1
Importance: high
Dynamic update: read-only
在删除旧快照和日志文件前,元数据日志和快照的最大组合大小。由于在任何日志可以被删除之前,至少有一个快照必须存在,所以这是一个软限制。
metadata.max.retention.ms
Type: long
Default: 604800000 (7 days)
Importance: high
Dynamic update: read-only
删除元数据日志文件或快照前的毫秒数。由于在任何日志可以被删除之前,至少有一个快照必须存在,所以这是一个软限制。
min.insync.replicas
type: int
Default: 1
Valid Values: [1,…]
Importance: high
Dynamic update: cluster-wide
当制作者将 acks 设为 "all" (或 "-1"),min.insync.replicas 指定必须确认写入的最少副本数才被视为成功。如果无法满足此最小值,则生成者将引发异常(NotEnoughReplicas 或 NotEnoughReplicasAfterAppend)。当一起使用时,min.insync.replicas 和 acks 允许您强制实施更大的持久性保证。典型的场景是创建带有复制因子 3 的主题,将 min.insync.replicas 设置为 2,并使用 acks of "all" 生成。这将确保如果大多数副本都未收到写入,则生成者引发异常。
node.id
type: int
Default: -1
Importance: high
Dynamic update: read-only
与此进程时所扮演的角色关联的节点 ID
。roles
是非空的。这在以 KRaft 模式运行时是必需的配置。num.io.threads
type: int
Default: 8
Valid Values: [1,…]
Importance: high
Dynamic update: cluster-wide
服务器用来处理请求的线程数量,其中可能包括磁盘 I/O。
num.network.threads
type: int
Default: 3
Valid Values: [1,…]
Importance: high
Dynamic update: cluster-wide
服务器用来从网络接收请求并将响应发送到网络的线程数量。
num.recovery.threads.per.data.dir
type: int
Default: 1
Valid Values: [1,…]
Importance: high
Dynamic update: cluster-wide
在启动时用于日志恢复的每个数据目录的线程数量,并在关闭时清除。
num.replica.alter.log.dirs.threads
type: int
Default: null
Importance: high
Dynamic update: read-only
可在日志目录之间移动副本的线程数量,其中可能包括磁盘 I/O。
num.replica.fetchers
Type: int
Default: 1
Importance: high
Dynamic update: cluster-wide
用于从源代理复制消息的获取程序线程数量。增加这个值可以提高后续代理中的 I/O 并行程度。
offset.metadata.max.bytes
Type: int
Default: 4096 (4 kibibytes)
Importance: high
Dynamic update: read-only
与偏移提交关联的元数据条目的最大大小。
offsets.commit.required.acks
Type: short
Default: -1
Importance: high
Dynamic update: read-only
在可以接受提交前所需的 acks。通常,默认(-1)不应被覆盖。
offsets.commit.timeout.ms
type: int
Default: 5000 (5 seconds)
Valid Values: [1,…]
Importance: high
Dynamic update: read-only
偏移提交会延迟,直到 offsets 主题的所有副本都接收提交或达到此超时为止。这与制作者请求超时类似。
offsets.load.buffer.size
type: int
Default: 5242880
Valid Values: [1,…]
Importance: high
Dynamic update: read-only
将偏移加载到缓存中时从偏移段读取的批处理大小(如果记录太大,则覆盖)。
offsets.retention.check.interval.ms
type: long
Default: 600000 (10 minutes)
Valid Values: [1,…]
Importance: high
Dynamic update: read-only
检查过时偏移的频率。
offsets.retention.minutes
type: int
Default: 10080
Valid Values: [1,…]
Importance: high
Dynamic update: read-only
在消费者组丢失了所有消费者(即变为空)后,在被丢弃前,将为此保留周期保留其偏移量。对于独立的消费者(使用手动分配),偏移将在最后一次提交加此保留周期后过期。
offsets.topic.compression.codec
Type: int
Default: 0
Importance: high
Dynamic update: read-only
偏移主题的压缩 codec - 压缩可用于实现"原子"提交。
offsets.topic.num.partitions
type: int
Default: 50
Valid Values: [1,…]
Importance: high
Dynamic update: read-only
偏移提交主题的分区数量(部署后不应更改)。
offsets.topic.replication.factor
Type: short
Default: 3
Valid Values: [1,…]
Importance: high
Dynamic update: read-only
偏移主题的复制因素(设置更高以确保可用性)。内部主题创建将失败,直到集群大小满足此复制因素要求。
offsets.topic.segment.bytes
type: int
Default: 104857600 (100 mebibytes)
Valid Values: [1,…]
Importance: high
Dynamic update: read-only
偏移主题片段字节数应该保持相对小,以便加快日志压缩和缓存负载。
process.roles
type: list
Default: ""
Valid Values: [broker, controller]
Importance: high
Dynamic update: read-only
此进程 play 的角色: 'broker'、'controller' 或 'broker,controller'(如果两者都是)。此配置仅适用于 KRaft (Kafka Raft)模式(而不是 ZooKeeper)中的集群。为 Zookeeper 集群保留此配置未定义或为空。
queued.max.requests
type: int
Default: 500
Valid Values: [1,…]
Importance: high
Dynamic update: read-only
在阻止网络线程前,允许 data-plane 的已排队请求数。
replica.fetch.min.bytes
Type: int
Default: 1
Importance: high
Dynamic update: read-only
每个获取响应的预期最小字节数。如果没有足够字节,请等待
replica.fetch.wait.max.ms
(broker config)。replica.fetch.wait.max.ms
Type: int
Default: 500
Importance: high
Dynamic update: read-only
由后续副本发布的每个获取者请求的最大等待时间。这个值应该始终小于 replica.lag.time.max.ms,以防止频繁缩小 ISR 用于低吞吐量主题。
replica.high.watermark.checkpoint.interval.ms
Type: long
Default: 5000 (5 seconds)
Importance: high
Dynamic update: read-only
将高水位线保存到磁盘的频率。
replica.lag.time.max.ms
type: long
Default: 30000 (30 秒)
Importance: high
Dynamic update: read-only
如果后续者没有发送任何获取请求,或者还没有消耗领导日志结束偏移,则领导机将从 isr 中删除后续者。
replica.socket.receive.buffer.bytes
type: int
Default: 65536 (64 kibibytes)
Importance: high
Dynamic update: read-only
网络请求的套接字接收缓冲区。
replica.socket.timeout.ms
type: int
Default: 30000 (30 秒)
Importance: high
Dynamic update: read-only
网络请求的套接字超时。其值应至少为 replica.fetch.wait.max.ms。
request.timeout.ms
type: int
Default: 30000 (30 秒)
Importance: high
Dynamic update: read-only
配置控制客户端等待请求响应的最长时间。如果在超时之前没有收到响应,客户端将在需要时重新发送请求(如果重试用时失败)。
sasl.mechanism.controller.protocol
Type: string
Default: GSSAPI
Importance: high
Dynamic update: read-only
用于与控制器通信的 SASL 机制。默认为 GSSAPI。
socket.receive.buffer.bytes
type: int
Default: 102400 (100 kibibytes)
Importance: high
Dynamic update: read-only
套接字服务器套接字的 SO_RCVBUF 缓冲。如果值为 -1,则使用操作系统默认值。
socket.request.max.bytes
type: int
Default: 104857600 (100 mebibytes)
Valid Values: [1,…]
Importance: high
Dynamic update: read-only
套接字请求中的最大字节数。
socket.send.buffer.bytes
type: int
Default: 102400 (100 kibibytes)
Importance: high
Dynamic update: read-only
套接字服务器套接字的 SO_SNDBUF 缓冲区。如果值为 -1,则使用操作系统默认值。
transaction.max.timeout.ms
type: int
Default: 900000 (15 minutes)
Valid Values: [1,…]
Importance: high
Dynamic update: read-only
事务允许的最大超时时间。如果客户端请求的事务时间超过这个值,则代理将在 InitProducerIdRequest 中返回错误。这可防止客户端太大的超时时间,这可能会使消费者从事务中包含的主题中读取。
transaction.state.log.load.buffer.size
type: int
Default: 5242880
Valid Values: [1,…]
Importance: high
Dynamic update: read-only
将制作者 ID 和事务加载到缓存中时从事务日志片段读取的批处理大小(如果记录太大,则覆盖)。
transaction.state.log.min.isr
type: int
Default: 2
Valid Values: [1,…]
Importance: high
Dynamic update: read-only
覆盖 min.insync.replicas 配置,用于事务主题。
transaction.state.log.num.partitions
type: int
Default: 50
Valid Values: [1,…]
Importance: high
Dynamic update: read-only
事务主题的分区数量(部署后不应更改)。
transaction.state.log.replication.factor
Type: short
Default: 3
Valid Values: [1,…]
Importance: high
Dynamic update: read-only
事务主题的复制因素(设置更高),以确保可用性。内部主题创建将失败,直到集群大小满足此复制因素要求。
transaction.state.log.segment.bytes
type: int
Default: 104857600 (100 mebibytes)
Valid Values: [1,…]
Importance: high
Dynamic update: read-only
事务主题片段字节数应该保持相对小,以便加快日志压缩和缓存负载。
transactional.id.expiration.ms
type: int
Default: 604800000 (7 days)
Valid Values: [1,…]
Importance: high
Dynamic update: read-only
事务协调器将在不接收当前事务状态更新前等待的时间(毫秒)。此设置也会影响生成者 id 过期 - 制作者 ids 在最后一次使用给定制作者 id 写入后过期。请注意,因为主题的保留设置,如果从制作者 ID 最后一次写入被删除,则制作者 id 可能会更早过期。
unclean.leader.election.enable
Type: boolean
Default: false
Importance: high
Dynamic update: cluster-wide
指明是否启用 ISR 集中的副本作为最后的手段,即使这样做可能会导致数据丢失。
zookeeper.connect
Type: string
Default: null
Importance: high
Dynamic update: read-only
以
hostname:port
指定 ZooKeeper 连接字符串,其中 host 和 port 是 ZooKeeper 服务器的主机和端口。当 ZooKeeper 机器停机时,要允许连接到其他 ZooKeeper 节点,您还可以以hostname1:port1,hostname2:port2,hostname3:port3
格式指定多个主机。服务器也可以具有 ZooKeeper chroot 路径作为其 ZooKeeper 连接字符串的一部分,将其数据置于全局 ZooKeeper 命名空间中的一些路径下。例如,要提供 chroot 路径/chroot/path
,您可以将连接字符串指定为hostname1:port1,hostname2:port2,hostname3:port3/chroot/path
。zookeeper.connection.timeout.ms
type: int
Default: null
Importance: high
Dynamic update: read-only
客户端等待建立与 zookeeper 的连接的最大时间。如果没有设置,则使用 zookeeper.session.timeout.ms 中的值。
zookeeper.max.in.flight.requests
type: int
Default: 10
Valid Values: [1,…]
Importance: high
Dynamic update: read-only
客户端在阻止前发送到 Zookeeper 的最大未确认请求数。
zookeeper.session.timeout.ms
Type: int
Default: 18000 (18 seconds)
Importance: high
Dynamic update: read-only
ZooKeeper 会话超时。
zookeeper.set.acl
Type: boolean
Default: false
Importance: high
Dynamic update: read-only
将 client 设置为使用安全 ACL。
broker.heartbeat.interval.ms
type: int
Default: 2000 (2 seconds)
Importance: medium
Dynamic update: read-only
代理心跳之间时间长度(以毫秒为单位)。在 KRaft 模式下运行时使用。
broker.id.generation.enable
type: boolean
Default: true
Importance: medium
Dynamic update: read-only
在服务器上启用自动代理 ID 生成。启用为 reserved.broker.max.id 配置的值时,应检查。
broker.rack
Type: string
Default: null
Importance: medium
Dynamic update: read-only
代理的机架。这将用于机架感知为容错的复制分配。示例:
RACK1、
us-east-1d
.broker.session.timeout.ms
type: int
Default: 9000 (9 seconds)
Importance: medium
Dynamic update: read-only
没有心跳时代理租期最后一次的时间长度(以毫秒为单位)。在 KRaft 模式下运行时使用。
connections.max.idle.ms
Type: long
Default: 600000 (10 minutes)
Importance: medium
Dynamic update: read-only
闲置连接超时:服务器套接字处理器线程关闭闲置超过这个连接。
connections.max.reauth.ms
Type: long
Default: 0
Importance: medium
Dynamic update: read-only
当明确设置为正数(默认值为 0,而不是正数)时,不会超过配置的值的会话生命周期会在验证时与 v2.2.0 或更高版本的客户端进行通信。代理将断开在会话生命周期中未重新验证的任何这样的连接,然后用于除重新身份验证以外的任何目的。配置名称可以选择在小写中使用监听程序前缀和 SASL 机制名称作为前缀。例如,listener.name.sasl_ssl.oauthbearer.connections.max.reauth.ms=3600000。
controlled.shutdown.enable
type: boolean
Default: true
Importance: medium
Dynamic update: read-only
启用服务器的受控关闭。
controlled.shutdown.max.retries
type: int
Default: 3
Importance: medium
Dynamic update: read-only
受控关闭可能会因为多个原因失败。这决定了发生此类失败时的重试次数。
controlled.shutdown.retry.backoff.ms
Type: long
Default: 5000 (5 seconds)
Importance: medium
Dynamic update: read-only
每次重试前,系统需要从导致之前失败的状态中恢复(Controller 故障转移、副本滞后等)。此配置决定了重试前等待的时间。
controller.quorum.append.linger.ms
type: int
Default: 25
Importance: medium
Dynamic update: read-only
领导领导将等待写入的时间(以毫秒为单位),然后再将它们刷新到磁盘。
controller.quorum.request.timeout.ms
type: int
Default: 2000 (2 seconds)
Importance: medium
Dynamic update: read-only
配置控制客户端等待请求响应的最长时间。如果在超时之前没有收到响应,客户端将在需要时重新发送请求(如果重试用时失败)。
controller.socket.timeout.ms
type: int
Default: 30000 (30 秒)
Importance: medium
Dynamic update: read-only
controller-to-broker 频道的套接字超时。
default.replication.factor
Type: int
Default: 1
Importance: medium
Dynamic update: read-only
自动创建主题的默认复制因素。
delegation.token.expiry.time.ms
type: long
Default: 86400000 (1 day)
Valid Values: [1,…]
Importance: medium
Dynamic update: read-only
需要续订令牌前,令牌的有效性时间(以 miliseconds 为单位)。默认值为 1 天。
delegation.token.master.key
Type: password
Default: null
Importance: medium
Dynamic update: read-only
DEPRECATED : delegation.token.secret.key 的别名,它应该被使用而不是此配置。
delegation.token.max.lifetime.ms
Type: long
Default: 604800000 (7 days)
Valid Values: [1,…]
Importance: medium
Dynamic update: read-only
令牌具有最长生命周期,其无法再续订。默认值为 7 天。
delegation.token.secret.key
Type: password
Default: null
Importance: medium
Dynamic update: read-only
生成和验证委托令牌的 secret 密钥。必须在所有代理间配置相同的密钥。如果密钥未设置或设置为空字符串,代理将禁用委派令牌支持。
delete.records.purgatory.purge.interval.requests
Type: int
Default: 1
Importance: medium
Dynamic update: read-only
删除记录的清除间隔(请求数)
fetch.max.bytes
type: int
Default: 57671680 (55 mebibytes)
Valid Values: [1024,…]
Importance: medium
Dynamic update: read-only
我们将返回获取请求的最大字节数。必须至少为 1024。
fetch.purgatory.purge.interval.requests
type: int
Default: 1000
Importance: medium
Dynamic update: read-only
获取请求的清除间隔(请求数)。
group.initial.rebalance.delay.ms
type: int
Default: 3000 (3 秒)
Importance: medium
Dynamic update: read-only
在执行第一次重新平衡前,组协调器将等待更多消费者加入新组的时间。较长的延迟意味着重新平衡可能会减少,但会增加处理开始的时间。
group.max.session.timeout.ms
Type: int
Default: 1800000 (30 minutes)
Importance: medium
Dynamic update: read-only
注册消费者允许的最大会话超时。超时时间较长,可让消费者在心跳之间处理消息的时间较长,以检测故障的时间。
group.max.size
type: int
Default: 2147483647
Valid Values: [1,…]
Importance: medium
Dynamic update: read-only
单个消费者组可以容纳的最大消费者数量。
group.min.session.timeout.ms
type: int
Default: 6000 (6 seconds)
Importance: medium
Dynamic update: read-only
注册使用者允许的最小会话超时。超时时间较短,会导致在更频繁的消费者心跳的情况下更快地检测失败,这可能会造成代理资源的问题。
initial.broker.registration.timeout.ms
type: int
Default: 60000 (1 minute)
Importance: medium
Dynamic update: read-only
最初注册控制器仲裁时,在声明失败并退出代理进程前要等待的毫秒数。
inter.broker.listener.name
Type: string
Default: null
Importance: medium
Dynamic update: read-only
用于代理间通信的监听程序名称。如果未设置,监听程序名称由 security.inter.broker.protocol 定义。同时设置这个和 security.inter.broker.protocol 属性是一个错误。
inter.broker.protocol.version
Type: string
Default: 3.1-IV0
Valid Values: [0.8.0, 0.8.1, 0.8.2, 0.9.0, 0.10.0-IV0, 0.10.0-IV1, 0.10.1-IV0, 0.10.1-IV1, 0.10.1-IV2, 0.10.2-IV0, 0.11.0-IV0, 0.11.0-IV1, 0.11.0-IV2, 1.0-IV0, 1.1-IV0, 1.1-IV0, 1.1-IV0, 1.1-IV0, 2.0-iv0, 2.0-iv1, 2.1-iv0, 2.1-iv1, 2.1-iv2, 2.2-iv0, 2.2-iv1, 2.3-iv0, 2.3-iv1, 2.4-iv0, 2.4-iv1, 2.5-iv0, 2.6-iv0, 2.7-iv0, 2.7-iv1, 2.7-iv2, 2.8-iv0, 2.8-iv1, 3.0-iv0, 3.0-iv1, 3.0-iv0, 3.0-iv1, 3.1-IV0]
Importance: medium
Dynamic update: read-only
指定要使用的 inter-broker 协议的版本。这通常会在所有代理都升级到新版本后被禁止。一些有效值的示例为: 0.8.0, 0.8.1, 0.8.1.1, 0.8.2, 0.8.2.2.0, 0.8.2.1, 0.9.0.0, 0.9.0.1 Check ApiVersion for the full list。
log.cleaner.backoff.ms
type: long
Default: 15000 (15 秒)
Valid Values: [0,…]
Importance: medium
Dynamic update: cluster-wide
没有日志清理时休眠的时间长度。
log.cleaner.dedupe.buffer.size
Type: long
Default: 134217728
Importance: medium
Dynamic update: cluster-wide
在所有清理线程中用于日志 deduplication 的总内存。
log.cleaner.delete.retention.ms
Type: long
Default: 86400000 (1 day)
Importance: medium
Dynamic update: cluster-wide
删除记录的保留的时长?
log.cleaner.enable
type: boolean
Default: true
Importance: medium
Dynamic update: read-only
启用日志清理程序,以在服务器上运行。如果使用包含 cleanup.policy=compact 的任何主题,则应启用,包括内部偏移主题。如果禁用了这些主题,则不会压缩并持续增大。
log.cleaner.io.buffer.load.factor
type: double
Default: 0.9
Importance: medium
Dynamic update: cluster-wide
Log cleaner deduer dedupe 缓冲区负载因素。去除重复缓冲区的百分比可能会变为。较高的值将允许一次清理更多日志,但会导致更多的哈希冲突。
log.cleaner.io.buffer.size
type: int
Default: 524288
Valid Values: [0,…]
Importance: medium
Dynamic update: cluster-wide
在所有清理线程中用于日志清理 I/O 缓冲区的总内存。
log.cleaner.io.max.bytes.per.second
type: double
Default: 1.7976931348623157E308
Importance: medium
Dynamic update: cluster-wide
日志清理器将被节流,其 read 和 write i/o 的总和将小于这个值。
log.cleaner.max.compaction.lag.ms
type: long
Default: 9223372036854775807
Importance: medium
Dynamic update: cluster-wide
消息在日志中保留无法压缩的最长时间。仅适用于被压缩的日志。
log.cleaner.min.cleanable.ratio
type: double
Default: 0.5
Importance: medium
Dynamic update: cluster-wide
脏日志的最小比率,达到日志的总日志,以满足清理的要求。如果还指定了 log.cleaner.max.compaction.lag.ms 或 log.cleaner.min.compaction.lag.ms 配置,则日志紧凑器会在 log.cleaner.minaction.minaction.gms 期间内马上考虑压缩条件。 或(ii)如果日志在 log.cleaner.max.compaction.lag.ms 期间内有脏(uncompacted)记录。
log.cleaner.min.compaction.lag.ms
Type: long
Default: 0
Importance: medium
Dynamic update: cluster-wide
消息在日志中保持 uncompacted 的最短时间。仅适用于被压缩的日志。
log.cleaner.threads
type: int
Default: 1
Valid Values: [0,…]
Importance: medium
Dynamic update: cluster-wide
用于日志清理的后台线程数量。
log.cleanup.policy
type: list
Default: delete
Valid Values: [compact, delete]
Importance: medium
Dynamic update: cluster-wide
除了保留窗口外的片段的默认清理策略。以逗号分隔的有效策略列表。有效策略包括:"delete" 和 "compact"。
log.index.interval.bytes
Type: int
Default: 4096 (4 kibibytes)
Valid Values: [0,…]
Importance: medium
Dynamic update: cluster-wide
我们向偏移索引中添加条目的时间间隔。
log.index.size.max.bytes
type: int
Default: 10485760 (10 mebibytes)
Valid Values: [4,…]
Importance: medium
Dynamic update: cluster-wide
偏移索引的最大大小(以字节为单位)。
log.message.format.version
Type: string
Default: 3.0-IV1
Valid Values: [0.8.0, 0.8.1, 0.8.2, 0.9.0, 0.10.0-IV0, 0.10.0-IV1, 0.10.1-IV0, 0.10.1-IV1, 0.10.1-IV2, 0.10.2-IV0, 0.11.0-IV0, 0.11.0-IV1, 0.11.0-IV2, 1.0-IV0, 1.1-IV0, 1.1-IV0, 1.1-IV0, 2.0-iv0, 2.0-iv1, 2.1-iv0, 2.1-iv1, 2.1-iv2, 2.2-iv0, 2.2-iv1, 2.3-iv0, 2.3-iv1, 2.4-iv0, 2.4-iv1, 2.5-iv0, 2.6-iv0, 2.7-iv0, 2.7-iv1, 2.7-iv2, 2.8-iv0, 2.8-iv1, 3.0-iv0, 3.0-iv1, 3.0-iv0, 3.0-iv1, 3.1-IV0]
Importance: medium
Dynamic update: read-only
指定代理用来将消息附加到日志中的消息格式版本。该值应该是一个有效的 ApiVersion。一些示例为:0.8.2, 0.9.0.0, 0.10.0,查看 ApiVersion 了解更多信息。通过设置特定的消息格式版本,用户认证磁盘上所有现有的消息是否都小于或等于指定版本。错误地设置这个值将导致具有旧版本的用户中断,因为它们会收到一个不理解的格式的消息。
log.message.timestamp.difference.max.ms
type: long
Default: 9223372036854775807
Importance: medium
Dynamic update: cluster-wide
代理收到消息和消息中指定的时间戳之间允许的最大区别。如果 log.message.timestamp.type=CreateTime,如果时间戳的差异超过这个阈值,则会被拒绝。如果 log.message.timestamp.type=LogAppendTime。允许的最大时间戳差异不应大于 log.retention.ms,以避免不必要频繁的日志滚动。
log.message.timestamp.type
Type: string
Default: CreateTime
Valid Values: [CreateTime, LogAppendTime]
Importance: medium
Dynamic update: cluster-wide
定义消息中的时间戳是消息创建时间还是日志附加时间。该值应该是
CreateTime
或LogAppendTime
。log.preallocate
Type: boolean
Default: false
Importance: medium
Dynamic update: cluster-wide
创建新段时,应预先分配文件?如果您在 Windows 上使用 Kafka,您可能需要将其设置为 true。
log.retention.check.interval.ms
Type: long
Default: 300000 (5 minutes)
Valid Values: [1,…]
Importance: medium
Dynamic update: read-only
日志清理程序的频率(以毫秒为单位)检查任何日志是否有资格删除。
max.connection.creation.rate
type: int
Default: 2147483647
Valid Values: [0,…]
Importance: medium
Dynamic update: cluster-wide
我们随时在代理中允许的最大连接创建率。也可以通过使用监听器前缀前缀配置监听程序级别的限制,如
listener.name.internal.max.connection.creation.rate
.Broker-wide 连接速率限制,但应该根据应用程序要求配置监听程序限制。如果达到监听器或代理限制,则新连接将节流,但 inter-broker 监听程序除外。只有在达到监听器级别速率限制时,才会节流 inter-broker 侦听器上的连接。max.connections
type: int
Default: 2147483647
Valid Values: [0,…]
Importance: medium
Dynamic update: cluster-wide
我们随时允许的最大连接数。除了使用 max.connections.per.ip 配置的任何每个ip 限制外,还会应用这个限制。也可以通过使用监听程序前缀前缀(如 listener.name.
internal.max.connections )为配置监听程序
级别的限制来配置。代理范围限制应该基于代理容量,而监听器限制则应该根据应用程序要求进行配置。如果达到监听程序或代理限制,则阻止新的连接。即使达到代理范围限制,也允许 inter-broker 侦听器上的连接。在这种情况下,其他监听器中最早使用的连接将关闭。max.connections.per.ip
type: int
Default: 2147483647
Valid Values: [0,…]
Importance: medium
Dynamic update: cluster-wide
我们允许从每个 ip 地址允许的最大连接数。如果使用 max.connections.per.ip.overrides 属性配置覆盖,则可以将其设置为 0。如果达到限制,则将丢弃来自 ip 地址的新连接。
max.connections.per.ip.overrides
Type: string
Default: ""
Importance: medium
Dynamic update: cluster-wide
每个ip 或 hostname 的逗号分隔列表覆盖默认最大连接数。示例值为 "hostName:100,127.0.0.1:200"。
max.incremental.fetch.session.cache.slots
type: int
Default: 1000
Valid Values: [0,…]
Importance: medium
Dynamic update: read-only
我们将维护的最大增量获取会话数量。
num.partitions
type: int
Default: 1
Valid Values: [1,…]
Importance: medium
Dynamic update: read-only
每个主题的默认日志分区数量。
password.encoder.old.secret
Type: password
Default: null
Importance: medium
Dynamic update: read-only
用于动态配置的编码密码的旧 secret。这只在更新 secret 时才需要。如果指定,所有动态编码的密码都使用这个旧 secret 进行解码,并在代理启动时使用 password.encoder.secret 重新编码。
password.encoder.secret
Type: password
Default: null
Importance: medium
Dynamic update: read-only
用于为这个代理动态配置的编码密码的 secret。
principal.builder.class
type: class
Default: org.apache.kafka.common.security.authenticator.DefaultKafkaPrincipalBuilder
Importance: medium
Dynamic update: per-broker
实现 KafkaPrincipalBuilder 接口的类的完全限定名称,用于构建授权期间使用的 KafkaPrincipal 对象。如果没有定义主体构建器,则默认行为取决于所使用的安全协议。对于 SSL 身份验证,主体将使用由与客户端证书区分名称(如果提供)的
ssl.principal.mapping.rules
定义的规则派生。否则,如果不需要客户端身份验证,则主体名称为 ANONYMOUS。对于 SASL 身份验证,如果 GSSAPI 正在使用中,则主体将使用sasl.kerberos.principal.to.local.rules
定义的规则派生,以及其它机制的 SASL 身份验证 ID。对于 PLAINTEXT,主体将是 ANONYMOUS。producer.purgatory.purge.interval.requests
type: int
Default: 1000
Importance: medium
Dynamic update: read-only
生成者请求的清除间隔(请求数)。
queued.max.request.bytes
Type: long
Default: -1
Importance: medium
Dynamic update: read-only
在没有读取更多请求前允许的排队字节数。
replica.fetch.backoff.ms
type: int
Default: 1000 (1 second)
Valid Values: [0,…]
Importance: medium
Dynamic update: read-only
获取分区错误时休眠的时间长度。
replica.fetch.max.bytes
type: int
Default: 1048576 (1 mebibyte)
Valid Values: [0,…]
Importance: medium
Dynamic update: read-only
尝试为每个分区获取的信息字节数。这不是绝对的最大值,如果获取的第一个非空分区中的第一个记录批处理大于这个值,则记录批处理仍会返回,以确保可以进行进度。代理接受的最大记录批处理大小通过
message.max.bytes
(broker config)或max.message.bytes
(topic config)定义。replica.fetch.response.max.bytes
type: int
Default: 10485760 (10 mebibytes)
Valid Values: [0,…]
Importance: medium
Dynamic update: read-only
整个获取响应预期的最大字节数。记录批量获取,如果获取的第一个非空分区中的第一个记录批处理大于这个值,则记录批处理仍会返回,以确保可以进行进度。因此,这不是绝对最大值。代理接受的最大记录批处理大小通过
message.max.bytes
(broker config)或max.message.bytes
(topic config)定义。replica.selector.class
Type: string
Default: null
Importance: medium
Dynamic update: read-only
实现 ReplicaSelector 的完全限定类名称。代理使用它来查找首选读取副本。默认情况下,我们使用返回领导的实施。
reserved.broker.max.id
type: int
Default: 1000
Valid Values: [0,…]
Importance: medium
Dynamic update: read-only
可用于 broker.id 的最大数量。
sasl.client.callback.handler.class
Type: class
Default: null
Importance: medium
Dynamic update: read-only
实现 AuthenticateCallbackHandler 接口的 SASL 客户端回调处理程序类的完全限定名称。
sasl.enabled.mechanisms
type: list
Default: GSSAPI
Importance: medium
Dynamic update: per-broker
Kafka 服务器中启用的 SASL 机制列表。列表中可以包含安全提供程序可用的机制。只有 GSSAPI 会被默认启用。
sasl.jaas.config
Type: password
Default: null
Importance: medium
Dynamic update: per-broker
用于 SASL 连接的 JAAS 登录上下文参数,其格式供 JAAS 配置文件使用。JAAS 配置文件格式描述 在此处。该值的格式是:
loginModuleClass controlFlag (optionName=optionValue)*;
。对于代理,配置必须在小写中带有监听前缀和 SASL 机制名称前缀。例如: listener.name.sasl_ssl.scram-sha-256.sasl.jaas.config=com.example.ScramLoginModule required;。sasl.kerberos.kinit.cmd
type: string
Default: /usr/bin/kinit
Importance: medium
Dynamic update: per-broker
Kerberos kinit 命令路径。
sasl.kerberos.min.time.before.relogin
type: long
Default: 60000
Importance: medium
Dynamic update: per-broker
刷新尝试之间的登录线程睡眠时间。
sasl.kerberos.principal.to.local.rules
Type: list
Default: DEFAULT
Importance: medium
Dynamic update: per-broker
从主体名称映射到短名称(通常是操作系统用户名)的规则列表。规则按顺序评估,第一个与主体名称匹配的规则用于将其映射到短名称。稍后列表中的任何规则都会被忽略。默认情况下,形式 {username}/{hostname}@{REALM} 的主体名称映射到 {username}。有关格式的详情,请查看 安全授权和 acls。请注意,如果
principal.builder.class
配置提供了 KafkaPrincipalBuilder 的扩展,则此配置会被忽略。sasl.kerberos.service.name
Type: string
Default: null
Importance: medium
Dynamic update: per-broker
Kafka 运行的 Kerberos 主体名称。这可以在 Kafka 的 JAAS 配置或 Kafka 配置中定义。
sasl.kerberos.ticket.renew.jitter
type: double
Default: 0.05
Importance: medium
Dynamic update: per-broker
添加到续订时间的随机 jitter 的百分比。
sasl.kerberos.ticket.renew.window.factor
type: double
Default: 0.8
Importance: medium
Dynamic update: per-broker
登录线程将处于睡眠状态,直到达到最后一次刷新到票据到期的时间因素前处于睡眠状态,此时将尝试续订票据。
sasl.login.callback.handler.class
Type: class
Default: null
Importance: medium
Dynamic update: read-only
实现 AuthenticateCallbackHandler 接口的 SASL 登录回调处理程序类的完全限定名称。对于代理,登录回调处理器配置必须以监听器前缀和 SASL 机制名称作为前缀作为前缀。例如: listener.name.sasl_ssl.scram-sha-256.sasl.login.callback.handler.class=com.example.CustomScramLoginCallbackHandler。
sasl.login.class
Type: class
Default: null
Importance: medium
Dynamic update: read-only
实现登录接口的类的完全限定名称。对于代理,登录配置必须在小写中带有监听前缀和 SASL 机制名称前缀。For example, listener.name.sasl_ssl.scram-sha-256.sasl.login.class=com.example.CustomScramLogin.
sasl.login.refresh.buffer.seconds
Type: short
Default: 300
Importance: medium
Dynamic update: per-broker
在刷新凭证时凭证过期前的缓冲时间(以秒为单位)。如果刷新情况比缓冲区秒数接近过期,则刷新将移动,以尽可能多地维护缓冲区时间。法律值介于 0 到 3600 (1 小时)之间;如果没有指定值,则使用默认值 300 (5 分钟)。如果这个值和 sasl.login.refresh.min.period.seconds 超过了凭证剩余的生命周期,则忽略这个值。目前仅适用于 OAUTHBEARER。
sasl.login.refresh.min.period.seconds
Type: short
Default: 60
Importance: medium
Dynamic update: per-broker
登录刷新线程在刷新凭证前等待的时间(以秒为单位)。法律值介于 0 到 900 (15 分钟)之间;如果没有指定值,则使用默认值 60 (1 分钟)。如果这个值和 sasl.login.refresh.buffer.seconds 都会被忽略,如果它们的总和超过凭证的剩余生命周期。目前仅适用于 OAUTHBEARER。
sasl.login.refresh.window.factor
type: double
Default: 0.8
Importance: medium
Dynamic update: per-broker
登录刷新线程将休眠到与凭证生命周期相关的指定窗口因素,此时将尝试刷新凭证。法律值介于 0.5 (50%)和 1.0 (100%)之间,如果没有指定值,则使用默认值 0.8 (80%)。目前仅适用于 OAUTHBEARER。
sasl.login.refresh.window.jitter
type: double
Default: 0.05
Importance: medium
Dynamic update: per-broker
与凭证的生命周期相关的最大随机 jitter 量添加到登录刷新线程的睡眠时间中。法律值介于 0 到 0.25(25%)之间,如果没有指定值,则使用默认值 0.05(5%)。目前仅适用于 OAUTHBEARER。
sasl.mechanism.inter.broker.protocol
Type: string
Default: GSSAPI
Importance: medium
Dynamic update: per-broker
用于代理间通信的 SASL 机制。默认为 GSSAPI。
sasl.oauthbearer.jwks.endpoint.url
Type: string
Default: null
Importance: medium
Dynamic update: read-only
可以从中检索供应商的 JWKS (JSON Web Key Set) 的 OAuth/OIDC 供应商 URL。URL 可以是基于 HTTP (S)或基于文件的 URL。如果 URL 基于 HTTP (S),则 JWKS 数据将通过代理启动时配置的 URL 从 OAuth/OIDC 供应商中检索。所有 then-current 密钥都将缓存在代理上以进行传入请求。如果为 JWT 收到了身份验证请求,其中包含缓存中尚未在缓存中的"kid"标头声明值,则将根据需要再次查询 JWKS 端点。但是,代理会轮询每个 sasl.oauthbearer.jwks.endpoint.refresh.ms 毫秒的 URL,以便在收到包含这些密钥的任何 JWT 请求前刷新缓存。如果 URL 基于文件,代理将在启动时从配置的位置加载 JWKS 文件。如果 JWT 包含没有在 JWKS 文件中的 "kid" 标头值,代理将拒绝 JWT 并且身份验证将失败。
sasl.oauthbearer.token.endpoint.url
Type: string
Default: null
Importance: medium
Dynamic update: read-only
OAuth/OIDC 身份提供程序的 URL。如果 URL 基于 HTTP (S),这是签发者的令牌端点 URL,其请求将根据 sasl.jaas.config 中的配置登录。如果 URL 基于文件,它指定一个包含由 OAuth/OIDC 身份提供程序发布的访问令牌( JWT 序列化形式)的文件,以用于授权。
sasl.server.callback.handler.class
Type: class
Default: null
Importance: medium
Dynamic update: read-only
实现 AuthenticateCallbackHandler 接口的 SASL 服务器回调处理程序类的完全限定名称。服务器回调处理程序必须在小写中带有监听器前缀和 SASL 机制名称作为前缀。例如: listener.name.sasl_ssl.plain.sasl.server.callback.handler.class=com.example.CustomPlainCallbackHandler。
security.inter.broker.protocol
Type: string
Default: PLAINTEXT
Importance: medium
Dynamic update: read-only
用于在代理间进行通信的安全协议。有效值为: PLAINTEXT, SSL, SASL_PLAINTEXT, SASL_SSL。这是一个同时设置这个和 inter.broker.listener.name 属性的错误。
socket.connection.setup.timeout.max.ms
type: long
Default: 30000 (30 秒)
Importance: medium
Dynamic update: read-only
客户端等待套接字连接建立的最大时间。当每个连续连接失败时,连接设置超时会达到这个最大值。为避免连接差异,将把一个随机化因值应用于超时,导致计算值高于 20% 的随机范围。
socket.connection.setup.timeout.ms
type: long
Default: 10000 (10 秒)
Importance: medium
Dynamic update: read-only
客户端等待套接字连接建立的时间长度。如果在超时时间前没有构建连接,客户端将关闭套接字频道。
ssl.cipher.suites
type: list
Default: ""
Importance: medium
Dynamic update: per-broker
密码套件列表。这是用来使用 TLS 或 SSL 网络协议协商网络连接的安全设置的身份验证、加密、MAC 和密钥交换算法的命名组合。默认情况下,支持所有可用的密码套件。
ssl.client.auth
Type: string
Default: none
Valid Values: [required, requested, none]
Importance: medium
Dynamic update: per-broker
配置 kafka 代理以请求客户端身份验证。以下设置是通用的:
-
如果设为所需的客户端身份验证,则需要
ssl.client.auth=required
。 -
ssl.client.auth=requested
意味着客户端身份验证是可选的。与需要不同,如果设置此选项,则可以选择不提供有关其自身的身份验证信息 -
SSL.client.auth=none
意味着不需要客户端身份验证。
-
如果设为所需的客户端身份验证,则需要
ssl.enabled.protocols
type: list
Default: TLSv1.2,TLSv1.3
Importance: medium
Dynamic update: per-broker
为 SSL 连接启用的协议列表。在使用 Java 11 或更新版本时,默认为 'TLSv1.2,TLSv1.3',否则 'TLSv1.2'。使用 Java 11 的默认值,如果客户端和服务器同时支持 TLSv1.3,则客户端和服务器将首选 TLSv1.3,否则将回退到 TLSv1.2(假设两者都至少支持 TLSv1.2)。对于大多数情况,这个默认值应该可以正常工作。另请参阅
ssl.protocol
的配置文档。ssl.key.password
Type: password
Default: null
Importance: medium
Dynamic update: per-broker
密钥存储文件或者 'ssl.keystore.key' 中指定的 PEM 密钥的密码。只有在配置了双向身份验证时,客户端才需要这样做。
ssl.keymanager.algorithm
Type: string
Default: SunX509
Importance: medium
Dynamic update: per-broker
密钥管理器工厂用于 SSL 连接的算法。默认值是为 Java 虚拟机配置的密钥管理器工厂算法。
ssl.keystore.certificate.chain
Type: password
Default: null
Importance: medium
Dynamic update: per-broker
使用由 'ssl.keystore.type" 指定的格式的证书链。默认 SSL 引擎工厂仅支持使用 X.509 证书列表的 PEM 格式。
ssl.keystore.key
Type: password
Default: null
Importance: medium
Dynamic update: per-broker
使用 'ssl.keystore.type" 指定的格式的私钥。默认 SSL 引擎工厂只支持使用 PKCS#8 密钥的 PEM 格式。如果密钥加密,必须使用 'ssl.key.password' 指定密钥密码。
ssl.keystore.location
Type: string
Default: null
Importance: medium
Dynamic update: per-broker
密钥存储文件的位置。这对客户端是可选的,可用于客户端进行双向身份验证。
ssl.keystore.password
Type: password
Default: null
Importance: medium
Dynamic update: per-broker
密钥存储文件的存储密码。这对客户端是可选的,只有在配置了 'ssl.keystore.location' 时才需要。PEM 格式不支持密钥存储密码。
ssl.keystore.type
Type: string
Default: JKS
Importance: medium
Dynamic update: per-broker
密钥存储文件的文件格式。这对客户端是可选的。
ssl.protocol
type: string
Default: TLSv1.3
Importance: medium
Dynamic update: per-broker
用于生成 SSLContext 的 SSL 协议。使用 Java 11 或更新版本运行时,默认为 'TLSv1.3',否则 'TLSv1.2'。对于大多数用例,这个值应该可以正常工作。最近的 JVM 中允许的值为 'TLSv1.2' 和 'TLSv1.3'。旧的 JVM 可以支持 'TLS', 'TLSv1.1', 'SSLv2', 'SSLv2' 和 'SSLv3',但由于已知的安全漏洞,不建议使用它们。使用这个配置和 'ssl.enabled.protocols' 的默认值,如果服务器不支持 'TLSv1.3',客户端将降级为 'TLSv1.2'。如果此配置被设置为 'TLSv1.2',客户端将不会使用 'TLSv1.3',即使它是 ssl.enabled.protocols 中的值之一,服务器只支持 'TLSv1.3'。
ssl.provider
Type: string
Default: null
Importance: medium
Dynamic update: per-broker
用于 SSL 连接的安全供应商的名称。默认值是 JVM 的默认安全提供程序。
ssl.trustmanager.algorithm
Type: string
Default: PKIX
Importance: medium
Dynamic update: per-broker
信任管理器工厂用于 SSL 连接的算法。默认值是为 Java 虚拟机配置的信任管理器工厂算法。
ssl.truststore.certificates
Type: password
Default: null
Importance: medium
Dynamic update: per-broker
可信证书,格式为 'ssl.truststore.type'。默认 SSL 引擎工厂仅支持使用 X.509 证书使用 PEM 格式。
ssl.truststore.location
Type: string
Default: null
Importance: medium
Dynamic update: per-broker
信任存储文件的位置。
ssl.truststore.password
Type: password
Default: null
Importance: medium
Dynamic update: per-broker
信任存储文件的密码。如果没有设置密码,则仍然使用配置的信任存储文件,但禁用完整性检查。PEM 格式不支持信任存储密码。
ssl.truststore.type
Type: string
Default: JKS
Importance: medium
Dynamic update: per-broker
信任存储文件的文件格式。
zookeeper.clientCnxnSocket
Type: string
Default: null
Importance: medium
Dynamic update: read-only
通常,在使用 TLS 连接到 ZooKeeper 时,将
org.apache.zookeeper.ClientCnxnSocketNetty
设置为 org.apache.zookeeper.ClientCnxnSocketNetty。覆盖通过同名zookeeper.clientCnxnSocket
系统属性设置的任何显式值。zookeeper.ssl.client.enable
Type: boolean
Default: false
Importance: medium
Dynamic update: read-only
将 client 设置为在连接到 ZooKeeper 时使用 TLS。显式值会覆盖通过
zookeeper.client.secure
系统属性设置的任何值(请注意不同的名称)。如果没有设置,则默认为 false;如果未设置zookeeper.clientCnxnSocket
nSocket (通常为org.apache.zookeeper.ClientCnxnSocketNetty
);其他值可以包括zookeeper.ssl.cipher.suites
, zookeeper.ssl.crl.enable ,
,zookeeper.
ssl.enabled.protocolszookeeper.ssl.endpoint.identification.algorithm
,zookeeper.ssl.keystore.location
,zookeeper.ssl.keystore.password
,zookeeper.ssl.keystore.type
,zookeeper.ssl.ocsp.enable
,zookeeper.ssl.protocol
,zookeeper.ssl.truststore.location
,zookeeper.ssl.truststore.password
,zookeeper.ssl.truststore.type
.zookeeper.ssl.keystore.location
Type: string
Default: null
Importance: medium
Dynamic update: read-only
将客户端证书与 ZooKeeper 的 TLS 连接一起使用时的密钥存储位置。覆盖通过
zookeeper.ssl.keyStore.location
系统属性设置的任何显式值(请注意 camelCase)。zookeeper.ssl.keystore.password
Type: password
Default: null
Importance: medium
Dynamic update: read-only
将客户端证书与 ZooKeeper 的 TLS 连接一起使用时,密钥存储密码。覆盖通过
zookeeper.ssl.keyStore.password
系统属性设置的任何显式值(请注意 camelCase)。请注意,Zookeeper 不支持与密钥存储密码不同的密钥密码,因此请确保将密钥存储中的密钥密码设置为与密钥存储密码相同;否则,尝试 Zookeeper 的连接将失败。zookeeper.ssl.keystore.type
Type: string
Default: null
Importance: medium
Dynamic update: read-only
将客户端证书与 ZooKeeper 的 TLS 连接一起使用时,密钥存储类型。覆盖通过
zookeeper.ssl.keyStore.type
系统属性设置的任何显式值(请注意 camelCase)。默认值null
表示类型将根据密钥存储的文件名扩展名自动探测到。zookeeper.ssl.truststore.location
Type: string
Default: null
Importance: medium
Dynamic update: read-only
使用 TLS 连接到 ZooKeeper 时的 truststore 位置。覆盖通过
zookeeper.ssl.trustStore.location
系统属性设置的任何显式值(请注意 camelCase)。zookeeper.ssl.truststore.password
Type: password
Default: null
Importance: medium
Dynamic update: read-only
使用 TLS 连接到 ZooKeeper 时的 truststore 密码。覆盖通过
zookeeper.ssl.trustStore.password
系统属性设置的任何显式值(请注意 camelCase)。zookeeper.ssl.truststore.type
Type: string
Default: null
Importance: medium
Dynamic update: read-only
使用 TLS 连接 ZooKeeper 时的 truststore 类型。覆盖通过
zookeeper.ssl.trustStore.type
系统属性设置的任何显式值(请注意 camelCase)。默认值null
表示类型将根据信任存储的文件名扩展名自动探测到。alter.config.policy.class.name
Type: class
Default: null
Importance: low
Dynamic update: read-only
应该用于验证的更改配置策略类。该类应实施
org.apache.kafka.server.policy.AlterConfigPolicy
接口。alter.log.dirs.replication.quota.window.num
type: int
Default: 11
Valid Values: [1,…]
Importance: low
Dynamic update: read-only
要在内存中保留的示例数量,用于更改日志目录复制配额。
alter.log.dirs.replication.quota.window.size.seconds
type: int
Default: 1
Valid Values: [1,…]
Importance: low
Dynamic update: read-only
每个修改日志目录复制配额的时间范围。
authorizer.class.name
Type: string
Default: ""
Importance: low
Dynamic update: read-only
实现
org.apache.kafka.server.authorizer.Authorizer
接口的类的完全限定名称,代理将用于授权。client.quota.callback.class
Type: class
Default: null
Importance: low
Dynamic update: read-only
实现 ClientQuotaCallback 接口的类的完全限定名称,用于决定应用到客户端请求的配额限制。默认情况下,会应用存储在 ZooKeeper 中的 <user>, <client-id>, <user> 或 <client-id> 配额。对于任何给定请求,会应用与会话的用户主体和请求的 client-id 匹配的最具体配额。
connection.failed.authentication.delay.ms
type: int
Default: 100
Valid Values: [0,…]
Importance: low
Dynamic update: read-only
在失败的身份验证时连接关闭延迟:这是在身份验证失败时连接关闭的时间(以毫秒为单位)。这必须配置为小于 connection.max.idle.ms,以防止连接超时。
controller.quorum.retry.backoff.ms
type: int
Default: 20
Importance: low
Dynamic update: read-only
尝试重试对给定主题分区失败的请求前等待的时间。这可避免在某些故障场景中的紧密循环中重复发送请求。
controller.quota.window.num
type: int
Default: 11
Valid Values: [1,…]
Importance: low
Dynamic update: read-only
要在内存中为控制器修改配额保留的示例数量。
controller.quota.window.size.seconds
type: int
Default: 1
Valid Values: [1,…]
Importance: low
Dynamic update: read-only
每个控制器修改配额的示例的时间跨度。
create.topic.policy.class.name
Type: class
Default: null
Importance: low
Dynamic update: read-only
应该用于验证的 create 主题策略类。该类应实施
org.apache.kafka.server.policy.CreateTopicPolicy
接口。delegation.token.expiry.check.interval.ms
type: long
Default: 3600000 (1 hour)
Valid Values: [1,…]
Importance: low
Dynamic update: read-only
扫描间隔,以删除已过期的委托令牌。
kafka.metrics.polling.interval.secs
type: int
Default: 10
Valid Values: [1,…]
Importance: low
Dynamic update: read-only
指标轮询间隔(以秒为单位),可在 kafka.metrics.reporters 实现中使用。
kafka.metrics.reporters
Type: list
Default: ""
Importance: low
Dynamic update: read-only
用作 Yammer 指标定制报告器的类列表。报告者应该实现
kafka.metrics.KafkaMetricsReporter
trait。如果客户端想要在自定义报告器上公开 JMX 操作,自定义报告器还需要实施一个 MBean 特征来扩展kafka.metrics.KafkaMetricsReporterMBean
特征,以便注册的 MBean 符合标准的 MBean 约定。listener.security.protocol.map
Type: string
Default: PLAINTEXT:PLAINTEXT,SSL:SSL,SASL_PLAINTEXT:SASL_PLAINTEXT,SASL_SSL:SASL_SSL
Importance: low
Dynamic update: per-broker
在侦听器名称和安全协议之间进行映射。这必须针对同一安全协议定义,才能在多个端口或 IP 中使用。例如,即使两者都需要 SSL,也可以分隔内部和外部流量。另外,用户可以将名为 INTERNAL 和 EXTERNAL 的监听程序定义为:
INTERNAL:SSL,EXTERNAL:SSL
。如上所示,键和值使用冒号分隔,映射条目则用逗号分开。每个侦听器名称应当仅显示映射中的一次。可以通过向配置名称中添加规范化前缀(监听程序名称小写)来为每个监听程序配置不同的安全(SSL 和 SASL)设置。例如,要为 INTERNAL 侦听器设置不同的密钥存储,将设置名为listener.name.internal.ssl.keystore.location
的配置。如果没有设置监听程序名称的配置,则配置将回退到通用配置(如ssl.keystore.location
)。请注意,在 KRaft 中,如果不提供显式映射且没有使用其他安全协议,则假定从controller.listener.names
到 PLAINTEXT 定义的监听程序名称的默认映射。log.message.downconversion.enable
Type: boolean
Default: true
Importance: low
Dynamic update: cluster-wide
此配置控制消息格式的下行是否启用以满足使用请求的使用。当设置为
false
时,代理不会为希望旧的消息格式的消费者执行 down-conversion。对于来自较旧的客户端的消费请求,代理会以UNSUPPORTED_VERSION
错误响应。此配置不适用于复制可能需要的任何消息格式转换。metric.reporters
Type: list
Default: ""
Importance: low
Dynamic update: cluster-wide
用作指标报告器的类列表。实施
org.apache.kafka.common.metrics.MetricsReporter
接口,允许插入将收到新指标创建通知的类。总是包括 JmxReporter 来注册 JMX 统计信息。metrics.num.samples
type: int
Default: 2
Valid Values: [1,…]
Importance: low
Dynamic update: read-only
为计算指标维护的示例数量。
metrics.recording.level
Type: string
Default: INFO
Importance: low
Dynamic update: read-only
指标的最高记录级别。
metrics.sample.window.ms
type: long
Default: 30000 (30 秒)
Valid Values: [1,…]
Importance: low
Dynamic update: read-only
计算指标示例的时间窗口。
password.encoder.cipher.algorithm
type: string
Default: AES/CBC/PKCS5Padding
Importance: low
Dynamic update: read-only
用于动态配置的编码密码的 Cipher 算法。
password.encoder.iterations
type: int
Default: 4096
Valid Values: [1024,…]
Importance: low
Dynamic update: read-only
用于动态配置的编码密码的迭代计数。
password.encoder.key.length
type: int
Default: 128
Valid Values: [8,…]
Importance: low
Dynamic update: read-only
用于动态配置的编码密码的密钥长度。
password.encoder.keyfactory.algorithm
Type: string
Default: null
Importance: low
Dynamic update: read-only
用于动态配置的编码密码的 SecretKeyFactory 算法。如果可用,则默认为 PBKDF2WithHmacSHA512,否则为 PBKDF2WithHmacSHA1。
quota.window.num
type: int
Default: 11
Valid Values: [1,…]
Importance: low
Dynamic update: read-only
要在内存中为客户端配额保留的示例数量。
quota.window.size.seconds
type: int
Default: 1
Valid Values: [1,…]
Importance: low
Dynamic update: read-only
客户端配额的每个示例的时间跨度。
replication.quota.window.num
type: int
Default: 11
Valid Values: [1,…]
Importance: low
Dynamic update: read-only
要在内存中为复制配额保留的示例数量。
replication.quota.window.size.seconds
type: int
Default: 1
Valid Values: [1,…]
Importance: low
Dynamic update: read-only
复制配额的每个示例的时间跨度。
sasl.login.connect.timeout.ms
type: int
Default: null
Importance: low
Dynamic update: read-only
(可选)外部身份验证供应商连接超时的值(以毫秒为单位)。目前仅适用于 OAUTHBEARER。
sasl.login.read.timeout.ms
type: int
Default: null
Importance: low
Dynamic update: read-only
(可选)外部身份验证供应商读取超时的值(以毫秒为单位)。目前仅适用于 OAUTHBEARER。
sasl.login.retry.backoff.max.ms
type: long
Default: 10000 (10 秒)
Importance: low
Dynamic update: read-only
(可选)登录尝试外部身份验证提供程序之间等待的最大等待值(以毫秒为单位)。登录使用基于 sasl.login.retry.backoff.ms 设置的初始等待的指数 backoff 算法,并在尝试到 sasl.login.retry.backoff.max.ms 设置指定的最大等待长度之间加倍。目前仅适用于 OAUTHBEARER。
sasl.login.retry.backoff.ms
Type: long
Default: 100
Importance: low
Dynamic update: read-only
(可选)登录尝试外部身份验证提供程序期间初始等待的值(以毫秒为单位)。登录使用基于 sasl.login.retry.backoff.ms 设置的初始等待的指数 backoff 算法,并在尝试到 sasl.login.retry.backoff.max.ms 设置指定的最大等待长度之间加倍。目前仅适用于 OAUTHBEARER。
sasl.oauthbearer.clock.skew.seconds
type: int
Default: 30
Importance: low
Dynamic update: read-only
(可选)值(以秒为单位),允许 OAuth/OIDC 身份提供程序和代理间的差别。
sasl.oauthbearer.expected.audience
Type: list
Default: null
Importance: low
Dynamic update: read-only
(可选)代理用逗号分隔的设置来验证是否已为其中一个预期的受众发出 JWT。JWT 将检查是否有标准的 OAuth "aud" 声明,如果设置了这个值,代理将与 JWT 的"aud"声明中的值匹配,以查看是否有完全匹配。如果没有匹配项,代理将拒绝 JWT,身份验证将失败。
sasl.oauthbearer.expected.issuer
Type: string
Default: null
Importance: low
Dynamic update: read-only
代理的 (可选)用于验证 JWT 是否已由预期签发者创建的(可选)设置。JWT 将检查是否有标准 OAuth "iss" 声明,如果设置了这个值,代理会完全匹配 JWT 的"iss"声明中的内容。如果没有匹配项,代理将拒绝 JWT,身份验证将失败。
sasl.oauthbearer.jwks.endpoint.refresh.ms
Type: long
Default: 3600000 (1 hour)
Importance: low
Dynamic update: read-only
(可选)代理在刷新其 JWKS (JSON Web Key Set)缓存之间等待的值,其中包含键以验证 JWT 的签名。
sasl.oauthbearer.jwks.endpoint.retry.backoff.max.ms
type: long
Default: 10000 (10 秒)
Importance: low
Dynamic update: read-only
(可选)尝试从外部身份验证提供程序检索 JWKS (JSON Web Key Set)之间的最大等待值(以毫秒为单位)。JWKS 检索使用基于 sasl.oauthbearer.jwks.endpoint.retry.backoff.ms 设置的初始等待算法的指数 backoff 算法,并在尝试到 sasl.oauthbearer.jwks.endpoint.retry.backoff.max.ms 设置所指定的最大等待长度之间加倍。
sasl.oauthbearer.jwks.endpoint.retry.backoff.ms
Type: long
Default: 100
Importance: low
Dynamic update: read-only
(可选)在 JWKS (JSON Web Key Set)检索外部身份验证提供程序尝试时的初始等待值(以毫秒为单位)。JWKS 检索使用基于 sasl.oauthbearer.jwks.endpoint.retry.backoff.ms 设置的初始等待算法的指数 backoff 算法,并在尝试到 sasl.oauthbearer.jwks.endpoint.retry.backoff.max.ms 设置所指定的最大等待长度之间加倍。
sasl.oauthbearer.scope.claim.name
Type: string
Default: scope
Importance: low
Dynamic update: read-only
范围的 OAuth 声明通常命名为 "scope",但如果 OAuth/OIDC 供应商为该声明使用不同的名称,则此(可选)设置可以提供用于 JWT 有效负载声明中包含的范围的名称。
sasl.oauthbearer.sub.claim.name
Type: string
Default: sub
Importance: low
Dynamic update: read-only
该主题的 OAuth 声明通常命名为 "sub",但如果 OAuth/OIDC 供应商为该声明使用不同的名称,则此(可选)设置可以为 JWT 有效负载的声明中包含的主题提供不同的名称。
security.providers
Type: string
Default: null
Importance: low
Dynamic update: read-only
每个返回供应商实施安全算法的可配置创建者类列表。这些类应实施
org.apache.kafka.common.security.auth.SecurityProviderCreator
接口。ssl.endpoint.identification.algorithm
Type: string
Default: https
Importance: low
Dynamic update: per-broker
使用服务器证书验证服务器主机名的端点标识算法。
ssl.engine.factory.class
type: class
Default: null
Importance: low
Dynamic update: per-broker
org.apache.kafka.common.security.auth.SslEngineFactory 类型的类提供 SSLEngine 对象。默认值为 org.apache.kafka.common.security.ssl.DefaultSslEngineFactory。
ssl.principal.mapping.rules
Type: string
Default: DEFAULT
Importance: low
Dynamic update: read-only
用于映射的规则列表,用于将名称与客户端证书区分到短名称。规则按顺序评估,第一个与主体名称匹配的规则用于将其映射到短名称。稍后列表中的任何规则都会被忽略。默认情况下,可区分 X.500 证书的名称将是主体。有关格式的详情,请查看 安全授权和 acls。请注意,如果
principal.builder.class
配置提供了 KafkaPrincipalBuilder 的扩展,则此配置会被忽略。ssl.secure.random.implementation
Type: string
Default: null
Importance: low
Dynamic update: per-broker
用于 SSL 加密操作的 SecureRandom PRNG 实施。
transaction.abort.timed.out.transaction.cleanup.interval.ms
type: int
Default: 10000 (10 秒)
Valid Values: [1,…]
Importance: low
Dynamic update: read-only
回滚超时事务的时间间隔。
transaction.remove.expired.transaction.cleanup.interval.ms
type: int
Default: 3600000 (1 hour)
Valid Values: [1,…]
Importance: low
Dynamic update: read-only
删除因为
transactional.id.expiration.ms
传递而过期的事务的时间间隔。zookeeper.ssl.cipher.suites
Type: list
Default: null
Importance: low
Dynamic update: read-only
指定在 ZooKeeper TLS 协商(csv)中使用的启用的密码套件。覆盖通过
zookeeper.ssl.ciphersuites
系统属性明确设置的值(注意单个单词 "ciphersuites")。默认值null
表示启用的密码套件列表由所使用的 Java 运行时决定。zookeeper.ssl.crl.enable
Type: boolean
Default: false
Importance: low
Dynamic update: read-only
指定是否在 ZooKeeper TLS 协议中启用证书撤销列表。覆盖通过
zookeeper.ssl.crl
系统属性设置的任何显式值(请注意较短的名称)。zookeeper.ssl.enabled.protocols
Type: list
Default: null
Importance: low
Dynamic update: read-only
指定 ZooKeeper TLS negotiate (csv)中启用的协议。覆盖通过
zookeeper.ssl.enabledProtocols
系统属性设置的任何显式值(请注意 camelCase)。默认值null
表示启用的协议将是zookeeper.ssl.protocol
配置属性值。zookeeper.ssl.endpoint.identification.algorithm
Type: string
Default: HTTPS
Importance: low
Dynamic update: read-only
指定是否在 ZooKeeper TLS 协商过程中启用主机名验证,使用 (不区分大小写) "https" 表示启用 ZooKeeper 主机名验证,并有一个显式空白值表示它被禁用(仅用于测试目的)。显式值会覆盖通过
zookeeper.ssl.hostnameVerification
系统属性设置的任何 "true" 或 "false" 值(请注意不同的名称和值; true 表示 https 和 false 表示空白)。zookeeper.ssl.ocsp.enable
Type: boolean
Default: false
Importance: low
Dynamic update: read-only
指定是否在 ZooKeeper TLS 协议中启用在线证书状态协议。覆盖通过
zookeeper.ssl.ocsp
系统属性设置的任何显式值(请注意较短的名称)。zookeeper.ssl.protocol
type: string
Default: TLSv1.2
Importance: low
Dynamic update: read-only
指定 ZooKeeper TLS 协商中使用的协议。显式值会覆盖通过同名的
zookeeper.ssl.protocol
系统属性设置的任何值。zookeeper.sync.time.ms
type: int
Default: 2000 (2 seconds)
Importance: low
Dynamic update: read-only
ZK 关注者可以落后于 ZK 的领导。