kafka broker configs list

背景說明

在維護 kafka 集羣的過程當中,發現之前的一些配置項並非很合理,緣由是本身對 kafka broker 的配置項不瞭解,爲了增強本身對這部分的理解,也爲了更好的維護 kafka 集羣,對 kafka-1.0.1 版本的 broker 的配置項進行了 review。html

可配置項

一、必需要配置的參數有三個:java

broker.id
	log.dirs
	zookeeper.connect
複製代碼

二、Topic級別的配置參數和默認值列表以下:算法

列表中的Dynamic Update Mode列中三個選項的含義分別以下:shell

> read-only : 必需要重啓broker才能實現值得更新。
> per-broker :能夠爲每個broker動態更新。
> cluster-wide : 能夠做爲集羣範圍的默認值進行動態更新,也能夠做爲per-broker類型進行更新(測試)。
複製代碼

**下面是 topic 級別的 broker configs : **apache

name description type default valid value importance dynamic update mode
zookeeper.connect zk列表 String high read-only
advertised.host.name 已經棄用!使用‘advertised.listeners’替代。表明要發佈到zk上的供客戶端使用的HostName。 String null high read-only
advertised.listeners 發佈到ZooKeeper上給客戶端使用的監聽器,若是與上述的監聽器不一樣。在IaaS環境中,這個須要與broker綁定的接口不一樣。若是這個沒有設置,將會使用listeners的值。 String null high per-broker
advertised.port 已經棄用!只有在‘advertised.listeners’或者'listener'沒有設置的狀況下才生效,使用‘advertised.listeners’替代。表明要發佈到ZooKeeper以供客戶端使用的端口。 int null high read-only
auto.create.topics.enable 是否容許在broker上自動建立topic。 boolean True high read-only
auto.leader.rebalance.enable 是否容許leader自動rebalance(自動選舉)。 boolean True high read-only
若是設置爲True,那麼後臺會維護一個檢測和觸發leader rebalance的線程。
background.threads 用於處理後臺各類任務的線程數量。 int 10 [1,...] high cluster-wide
broker.id 服務器的broker標識。若是沒有設置,會自動建立一個唯一的broker id。 int -1 high read-only
爲了不Zookeeper建立的標識與用戶配置的標識產生衝突,自動建立的broker標識從 reserved.broker.max.id + 1開始。
compression.type 爲指定的topic指定壓縮類型,可選類型有'gzip', 'snappy', 'lz4'; String producer high cluster-wide
若是設置爲'uncompressed' 就意味着沒有設定壓縮類型;
若是設置爲 'producer' 就意味着保留producer設置的壓縮類型。
delete.topic.enable 容許刪除topic。 boolean True high read-only
若是這項參數沒有啓用,那麼經過admin tool刪除topic就不會有效果。
host.name 已經棄用!只有在‘listeners’沒有設置的狀況下使用。 String "" high read-only
leader.imbalance.check.interval.seconds 控制器觸發的分區從新平衡檢查的頻率。 long 300 high read-only
leader.imbalance.per.broker.percentage 每一個broker容許的leader不平衡比率閾值。 int 10 high read-only
在每一個broker上leader都不平衡的狀況下,控制器纔會觸發leader rebalance.
該值以百分比形式設置,10 <==> 10%
這個值計算方法:(leader不是prefered leader的AR數量)/(AR列表中的總數)
listeners 監聽器列表選項。設置後將監聽由逗號分割的URI和監聽器列表,若是監器的名稱不是一個安全的協議,listener.security.protocol.map也必須設置。 String null high per-broker
指定主機名爲0.0.0.0來綁定全部的接口。讓主機名爲空來綁定到默認的接口。
合法的監聽器列表樣例:
PLAINTEXT://myhost:9092,SSL://:9091 CLIENT://0.0.0.0:9092,REPLICATION://localhost:9093
log.dir log.dirs屬性的補充,保存數據目錄。 string /tmp/kafka-logs high read-only
log.dirs 保存數據目錄。 String null high read-only
log.flush.interval.messages 消息被寫入到磁盤前在日誌分區上可保留的消息數量的最大值 long 9.22337203685477E+18 high cluster-wide
log.flush.interval.ms 消息被書寫到磁盤之間在內存中保存的最大時長,若是沒有設置,那麼就用‘log.flush.scheduler.interval.ms’對應的值。 long null high cluster-wide
log.flush.offset.checkpoint.interval.ms 檢查點文件的更新頻率,就像日誌的還原點 int 60000 [0,...] high read-only
log.flush.scheduler.interval.ms log flusher【檢查是否有log須要刷寫到磁盤】的檢查頻率 long 9.22337203685477E+18 high read-only
log.flush.start.offset.checkpoint.interval.ms 日誌起始偏移量持久化記錄的刷新頻率 int 60000 [0,...] high read-only
log.retention.bytes 日誌保留最大的size long -1 high cluster-wide
log.retention.hours 日誌保留時間,單位hour int 168 high read-only
優先級低於屬性‘log.retention.ms ’
log.retention.minutes 日誌保留時間,單位minutes int null high read-only
若是沒設置,則使用‘log.retention.ms’中的值
優先級低於屬性‘log.retention.ms ’
log.retention.ms 日誌保留時間,單位ms long null high cluster-wide
若是沒有設置,則使用‘log.retention.minutes’中的值
log.roll.hours 生成一個新的log segment所需的最長時間,單位hour int 168 [1,...] high read-only
優先級低於log.roll.ms
log.roll.ms 生成一個新的log segment所需的最長時間,單位ms long null high cluster-wide
若是沒有設置,使用log.roll.hours項
log.roll.jitter.hours 從logRollTimeMillis中減去的最大抖動(以小時爲單位) int 0 [0,...] high read-only
是log.roll.jitter.ms屬性的次要選項
log.roll.jitter.ms 從logRollTimeMillis中減去的最大抖動(以ms爲單位) long null high cluster-wide
log.segment.bytes 單個log segment的最大size int 1073741824 / 1G [14,...] high cluster-wide
log.segment.delete.delay.ms 文件刪除以前延遲時間 / ms long 60000 [0,...] high cluster-wide
message.max.bytes Kafka容許的一批消息的最大size(一個batch的最大size)。 int 1000012 [0,...] high cluster-wide
若是增長此參數的值而且存在0.10.2版本以前的消費者,那麼老版本消費者的提取大小也必須增長,以便他們能夠獲取這麼大的記錄批次。
在最新的消息格式版本中,記錄老是按批次分組以提升效率。 在之前的消息格式版本中,未壓縮的記錄不會分組到批次中,而且此限制僅適用於該狀況下的單個記錄。
能夠單獨爲每個topic設置該項。
min.insync.replicas ack設置選項:-1/all、0、一、... int 1 [1,...] high cluster-wide
-1/all:
ISR中全部的副本確認後才認爲發送成功
1899/12/31 上午12:00:00
默認全部的數據發送成功,吞吐量最大,不安全
1899/12/31 上午1:00:00
leader副本寫入成功便可
二、三、4...k...
須要k個replica寫入成功才行,可是若是k超過了replica的數量,會報錯NotEnoughReplicas 或者 NotEnoughReplicasAfterAppend
num.io.threads 用於處理請求的線程數量,包括磁盤I/O處理。 int 8 [1,...] high cluster-wide
num.network.threads 用於接受或者發送網絡請求的線程數量 int 3 [1,...] high cluster-wide
num.recovery.threads.per.data.dir 每一個日誌目錄用於日誌恢復的線程數量(用於在啓動時加載和關閉時刷寫到磁盤) int 1 [1,...] high cluster-wide
num.replica.alter.log.dirs.threads 用於在log dirctory之間移動replicas的線程數量,可能包括disk I/O int null high read-only
num.replica.fetchers 從一個broker源獲複製數據的fetcher線程數量。 int 1 high cluster-wide
增大該值能夠提高follower broker的I/O並行度。
offset.metadata.max.bytes 與偏移提交關聯的元數據條目的最大size int 4096 high read-only
offsets.commit.required.acks 接受提交之間所需的acks,一般狀況下不該該修改默認值-1 short -1 high read-only
offsets.commit.timeout.ms 提交Offset的最大容許等待時長。 int 5000 [1,...] high read-only
偏移提交將被延遲到提交偏移主題的全部副本收提交或超時爲止。這是相似於生產者請求超時。
offsets.load.buffer.size 在將Offset從Offset segment加載到緩存中時,一次讀取的batch的size大小 int 5242880 [1,...] high read-only
offsets.retention.check.interval.ms 檢查老舊Offset的頻率 long 600000 [1,...] high read-only
offsets.retention.minutes 存在超過期長的offset會被拋棄 int 1440 [1,...] high read-only
offsets.topic.compression.codec 偏移量topic的壓縮編碼器,能夠保證原子提交 int 0 high read-only
offsets.topic.num.partitions offset topic的partition數量 int 50 [1,...] high read-only
offsets.topic.replication.factor offset topic的副本數量 short 3 [1,...] high read-only
offsets.topic.segment.bytes offset topic中segment的大小設置。 int 104857600 [1,...] high read-only
這個參數的值應該設置的相對較小,這樣能夠加快日誌壓縮和緩存加載
port 已經棄用!設置接收和監聽鏈接 int 9092 high read-only
queued.max.requests 網絡線程被阻塞以前容許的請求隊列的大小 int 500 [1,...] high read-only
quota.consumer.default 已棄用:僅在Zookeeper動態默認配額沒有被配置時使用。任何經過客戶端標識或消費者組來區分的消費者將會受到限制,若是它每秒獲取的字節數多於此屬性設置的值。 long 9.22337203685477E+18 [1,...] high read-only
quota.producer.default 已棄用:僅在Zookeeper動態默認配額沒有被配置時使用。任何經過客戶端標識來區分的生產者將會受到限制,若是它每秒產生的字節數多於此屬性設置的值。 long 9.22337203685477E+18 [1,...] high read-only
replica.fetch.min.bytes 獲取響應的指望的最小字節數,若是當前沒有足夠的字節數,那麼等待replicaMaxWaitTimeMs時長 int 1 high read-only
replica.fetch.wait.max.ms follower broker發出的每一個fetcher請求的最長等待時間。 int 500 high read-only
此值應始終始終小於replica.lag.time.max.ms,以防止低吞吐量的topic頻繁收縮ISR
replica.high.watermark.checkpoint.interval.ms HW(高水位)記錄到磁盤的頻率 long 5000 high read-only
replica.lag.time.max.ms 若是follower broker沒有發送任何的fetch請求 || 尚未消費到leader log的最新的offset位置,那麼leader副本會將該follower副本從ISR中移除 long 10000 high read-only
replica.socket.receive.buffer.bytes 用於網絡請求的套接字接收緩存 int 65536 high read-only
replica.socket.timeout.ms 網絡請求的socket超時時間,設置的值應該不小於‘replica.fetch.wait.max.ms’值 int 30000 high read-only
request.timeout.ms 這個配置控制了客戶端一個請求等待響應的最大時間。 int 30000 high read-only
若是已經超時了卻沒有收到響應,若有必要客戶端會從新發送請求或是當重試耗盡時請求失敗。
socket.receive.buffer.bytes 套接字接收緩存,若是值是-1那麼 OS默認值會被使用 int 102400 high read-only
socket.request.max.bytes 一個socket請求包含的最大字節數 int 104857600 [1,...] high read-only
socket.send.buffer.bytes 套接字發送緩存,若是值是-1那麼 OS默認值會被使用。 int 102400 high read-only
transaction.max.timeout.ms transaction/事物容許的最大超時時長。 int 900000 [1,...] high read-only
若是客戶端請求的事物時間超過該值,那麼broker會在InitProducerIdRequest返回一個錯誤。這能夠防止客戶端由於有太大的超時,從而阻止其餘消費者從事物中包含的topic中消費消息。
transaction.state.log.load.buffer.size 將生產者id和事物加載到緩衝中時,從事物日誌段中讀取批次的大小設置。 int 5242880 [1,...] high read-only
Batch size for reading from the transaction log segments when loading producer ids and transactions into the cache.
transaction.state.log.min.isr 重寫/覆蓋事物topic的min.insync.replicas參數。 int 2 [1,...] high read-only
Overridden min.insync.replicas config for the transaction topic.
transaction.state.log.num.partitions 事物主題的分區數量(部署後不能修改) int 50 [1,...] high read-only
The number of partitions for the transaction topic (should not change after deployment).
transaction.state.log.replication.factor 事物主題的副本數量。只有在集羣size大於設置的副本數量的狀況下,內部主題纔會建立成功。 short 3 [1,...] high read-only
The replication factor for the transaction topic (set higher to ensure availability). Internal topic creation will fail until the cluster size meets this replication factor requirement.
transaction.state.log.segment.bytes 事物主題的log segment應該相對較小,這樣能夠達到更快的日誌壓縮和緩存加載效果。 int 104857600 [1,...] high read-only
The transaction topic segment bytes should be kept relatively small in order to facilitate faster log compaction and cache loads
transactional.id.expiration.ms 事務協調器在長時間沒有從生產者事物id收取到任何事物狀態更新時,會主動將其終止,該參數設置的是終止前的最長等待時間。 int 604800000 [1,...] high read-only
The maximum amount of time in ms that the transaction coordinator will wait before proactively expire a producer's transactional id without receiving any transaction status updates from it.
unclean.leader.election.enable 是否容許不在ISR列表中的副本當選爲leader副本,設置爲true可能會形成數據丟失。 boolean False high cluster-wide
Indicates whether to enable replicas not in the ISR set to be elected as leader as a last resort, even though doing so may result in data loss
zookeeper.connection.timeout.ms 客戶端和zk創建鏈接的最大等待時長,沒有設置的話會採用‘zookeeper.session.timeout.ms’項對應的值。 int null high read-only
The max time that the client waits to establish a connection to zookeeper. If not set, the value in zookeeper.session.timeout.ms is used
zookeeper.max.in.flight.requests 客戶端發送到zk命令阻塞以前容許發送的未確認請求數量的最大值。 int 10 [1,...] high read-only
The maximum number of unacknowledged requests the client will send to Zookeeper before blocking.
zookeeper.session.timeout.ms zk會話超時時間設置。 int 6000 high read-only
Zookeeper session timeout
zookeeper.set.acl 設置客戶端使用安全的訪問控制列表 boolean False high read-only
Set client to use secure ACLs
broker.id.generation.enable 在服務器端啓用自動生成broker id功能,若是開啓該參數,那麼也應該同時檢查一下‘reserved.broker.max.id’項對應的值。 boolean True medium read-only
Enable automatic broker id generation on the server. When enabled the value configured for reserved.broker.max.id should be reviewed.
broker.rack broker所在的機架。在考慮分配replica副本到哪個broker上時,考慮機架的因素能夠增長容錯能力。 string null medium read-only
Rack of the broker. This will be used in rack aware replication assignment for fault tolerance. Examples: RACK1, us-east-1d
connections.max.idle.ms 空閒鏈接超時。服務端的socket處理線程的空閒時間超過該值後會關閉。 long 600000 medium read-only
Idle connections timeout: the server socket processor threads close the connections that idle more than this
controlled.shutdown.enable 是否容許服務器的受控關機。 boolean True medium read-only
Enable controlled shutdown of the server
controlled.shutdown.max.retries 在‘受控關機’發生失敗時能夠重試的次數設置。 int 3 medium read-only
Controlled shutdown can fail for multiple reasons. This determines the number of retries when such failure happens
controlled.shutdown.retry.backoff.ms 每次‘受控關機’重試的時間間隔,用於系統的狀態恢復。 long 5000 medium read-only
Before each retry, the system needs time to recover from the state that caused the previous failure (Controller fail over, replica lag etc). This config determines the amount of time to wait before retrying.
controller.socket.timeout.ms 控制器到broker之間的socket頻道/信道超時時間。 int 30000 medium read-only
The socket timeout for controller-to-broker channels
default.replication.factor 容許自動建立topic的狀況下,建立topic的副本數量。 int 1 medium read-only
default replication factors for automatically created topics
delegation.token.expiry.time.ms token的有效時間,默認值1天,超時須要更新/續訂。 long 86400000 [1,...] medium read-only
The token validity time in seconds before the token needs to be renewed. Default value 1 day.
delegation.token.master.key 用於生成和驗證委託tokens的主(公)/密鑰。 必須在全部broker中配置相同的密鑰。 password null medium read-only
若是未設置密鑰或將其設置爲空字符串,那麼broker將禁用委派token支持。
Master/secret key to generate and verify delegation tokens. Same key must be configured across all the brokers. If the key is not set or set to empty string, brokers will disable the delegation token support.
delegation.token.max.lifetime.ms token的生命時長。默認值爲7天,超過該值就沒法再被更新/續訂。 long 604800000 [1,...] medium read-only
The token has a maximum lifetime beyond which it cannot be renewed anymore. Default value 7 days.
delete.records.purgatory.purge.interval.requests 【刪除消息】請求記錄的清理間隔(此間隔非時間間隔,而是以請求數量爲間隔)。 int 1 medium read-only
The purge interval (in number of requests) of the delete records request purgatory
fetch.purgatory.purge.interval.requests 【拉取消息】請求記錄的刪除間隔(此間隔非時間間隔,而是以請求數量爲間隔)。 int 1000 medium read-only
The purge interval (in number of requests) of the fetch request purgatory
group.initial.rebalance.delay.ms 在new group內執行第一次從新平衡以前,組協調器會等待更多消費者加入新組的時間,該值設置的爲其等待的最大時長。 較長的延遲意味着可能更少的rebalance,但會增長處理開始以前的時間。 int 3000 medium read-only
The amount of time the group coordinator will wait for more consumers to join a new group before performing the first rebalance. A longer delay means potentially fewer rebalances, but increases the time until processing begins.
group.max.session.timeout.ms 容許已經註冊成功的消費者最大的會話超時時間。較長的超市時長可使得消費者有更多的時間在心跳之間處理消息,可是這是以更長的故障檢測時長做爲代價的。 int 300000 medium read-only
The maximum allowed session timeout for registered consumers. Longer timeouts give consumers more time to process messages in between heartbeats at the cost of a longer time to detect failures.
group.min.session.timeout.ms 容許已經註冊成功的消費者最小的會話超時時間。較短的超時時長能夠致使更快的故障檢測,代價是須要更頻繁的檢測消費者的心跳,這可能會致使broker資源垮掉。 int 6000 medium read-only
The minimum allowed session timeout for registered consumers. Shorter timeouts result in quicker failure detection at the cost of more frequent consumer heartbeating, which can overwhelm broker resources.
inter.broker.listener.name broker之間用於通訊的監聽器名稱。若是此值沒有設置,監聽器名稱根據security.inter.broker.protocol定義。注意不能同時設置該項和security.inter.broker.protocol項。 string null medium read-only
Name of listener used for communication between brokers. If this is unset, the listener name is defined by security.inter.broker.protocol. It is an error to set this and security.inter.broker.protocol properties at the same time.
inter.broker.protocol.version 指明內部broker之間使用協議的版本。 string 1.1-IV0 medium read-only
Specify which version of the inter-broker protocol will be used. This is typically bumped after all brokers were upgraded to a new version. Example of some valid values are: 0.8.0, 0.8.1, 0.8.1.1, 0.8.2, 0.8.2.0, 0.8.2.1, 0.9.0.0, 0.9.0.1 Check ApiVersion for the full list.
log.cleaner.backoff.ms log cleaner在沒有日誌清理時的休眠時間。 long 15000 [0,...] medium cluster-wide
The amount of time to sleep when there are no logs to clean
log.cleaner.dedupe.buffer.size 用於全部cleaner線程進行日誌重複刪除的總內存。 long 134217728 medium cluster-wide
The total memory used for log deduplication across all cleaner threads
log.cleaner.delete.retention.ms 刪除記錄/消息的保存時長。 long 86400000 medium cluster-wide
How long are delete records retained?
log.cleaner.enable 容許日誌清理進程在服務器上運行。 boolean True medium read-only
只要存在設置了cleanup.policy=compac 項的topic,該項據須要設置爲true,否者壓縮不會執行,topic的size會不斷增長。
Enable the log cleaner process to run on the server. Should be enabled if using any topics with a cleanup.policy=compact including the internal offsets topic. If disabled those topics will not be compacted and continually grow in size.
log.cleaner.io.buffer.load.factor 日誌清理器刪除重複數據緩衝區加載因子。重複數據刪除緩衝區能夠映射爲百分比。 double 0.9 medium cluster-wide
較高的值會致使一次清理更多的日誌,可是對致使更多的哈希衝突。
Log cleaner dedupe buffer load factor. The percentage full the dedupe buffer can become. A higher value will allow more log to be cleaned at once but will lead to more hash collisions
log.cleaner.io.buffer.size 全部的清理線程間用於日誌清理的I/O緩衝的總內存。 int 524288 [0,...] medium cluster-wide
The total memory used for log cleaner I/O buffers across all cleaner threads
log.cleaner.io.max.bytes.per.second 日誌清理器將被限速,這樣日誌清理的讀寫I/O的總和平均值將小於這個值。 double 1.7976931348623157E308 medium cluster-wide
The log cleaner will be throttled so that the sum of its read and write i/o will be less than this value on average
log.cleaner.min.cleanable.ratio 超過該比例則進行log清理,比例計算方法:髒日誌/總日誌 double 0.5 medium cluster-wide
The minimum ratio of dirty log to total log for a log to eligible for cleaning
log.cleaner.min.compaction.lag.ms 消息在log中保持未被壓縮的最短時長,僅僅適用於要被壓縮的日誌。 long 0 medium cluster-wide
The minimum time a message will remain uncompacted in the log. Only applicable for logs that are being compacted.
log.cleaner.threads 用於日誌清理的後臺線程數。 int 1 [0,...] medium cluster-wide
The number of background threads to use for log cleaning
log.cleanup.policy 除了保留窗口以外的log segment的默認的清理策略。 list delete [compact, delete] medium cluster-wide
能夠設置多個方法,方法之間經過逗號分隔,有效的策略有:"delete" and "compact"。
The default cleanup policy for segments beyond the retention window. A comma separated list of valid policies. Valid policies are: "delete" and "compact"
log.index.interval.bytes 在偏移量索引文件中插入索引的間隔(以字節爲間隔,並非消息的數量)。 int 4096 [0,...] medium cluster-wide
The interval with which we add an entry to the offset index
log.index.size.max.bytes 偏移量索引文件的最大值。 int 10485760 [4,...] medium cluster-wide
The maximum size in bytes of the offset index
log.message.format.version 指定消息格式的版本,broker會根據該選項將消息按指定的格式添加到log中。 string 1.1-IV0 medium read-only
須要是合法的ApiVersion,例如:0.8.2, 0.9.0.0, 0.10.0。
經過設置特定的消息格式版本,用戶能夠代表磁盤上的全部現有消息都小於或等於指定的版本。 錯誤地設置此值將致使舊版本的使用者中斷,由於他們將接收具備他們不理解的格式的消息。
Specify the message format version the broker will use to append messages to the logs. The value should be a valid ApiVersion. Some examples are: 0.8.2, 0.9.0.0, 0.10.0, check ApiVersion for more details. By setting a particular message format version, the user is certifying that all the existing messages on disk are smaller or equal than the specified version. Setting this value incorrectly will cause consumers with older versions to break as they will receive messages with a format that they don't understand.
log.message.timestamp.difference.max.ms 容許的broker接收到消息時的時間戳與消息中指定的時間戳之間的最大差別。 long 9.22337203685477E+18 medium cluster-wide
若是設置了 log.message.timestamp.type=CreateTime ,那麼超過該閾值的消息會被拒絕。
若是設置了 log.message.timestamp.type=LogAppendTime,那麼該參數會失效。
該項的設定值須要小於等於log.retention.ms,從而避免沒有必要的頻繁的日誌滾動。
The maximum difference allowed between the timestamp when a broker receives a message and the timestamp specified in the message. If log.message.timestamp.type=CreateTime, a message will be rejected if the difference in timestamp exceeds this threshold. This configuration is ignored if log.message.timestamp.type=LogAppendTime.The maximum timestamp difference allowed should be no greater than log.retention.ms to avoid unnecessarily frequent log rolling.
log.message.timestamp.type 指定消息中的時間戳是CreateTime仍是LogAppendTime。默認是CreateTime。 string CreateTime [CreateTime, LogAppendTime] medium cluster-wide
Define whether the timestamp in the message is message create time or log append time. The value should be either CreateTime or LogAppendTime
log.preallocate 在建立新的segment以前是否預分配文件。Windows上須要設置爲true. boolean False medium cluster-wide
Should pre allocate file when create new segment? If you are using Kafka on Windows, you probably need to set it to true.
log.retention.check.interval.ms 日誌清理器檢查是否有日誌須要清理的檢查間隔時間/ms long 300000 [1,...] medium read-only
The frequency in milliseconds that the log cleaner checks whether any log is eligible for deletion
max.connections.per.ip 單個ip容許創建鏈接的最大數量。 int 2147483647 [1,...] medium read-only
The maximum number of connections we allow from each ip address
max.connections.per.ip.overrides 每一個ip或者主機名最大鏈接數,覆蓋默認值。 string "" medium read-only
Per-ip or hostname overrides to the default maximum number of connections
max.incremental.fetch.session.cache.slots 可維護的最大消息提取會話數量。 int 1000 [0,...] medium read-only
The maximum number of incremental fetch sessions that we will maintain.
num.partitions 麼個主題默認的partition數量。 int 1 [1,...] medium read-only
The default number of log partitions per topic
password.encoder.old.secret 用於動態配置密碼的舊的密鑰。只有在更新密鑰時才須要陳志祥參數。 password null medium read-only
若是指定,那麼使用此舊的密鑰對全部的動態編碼的密碼進行解碼,並在broker啓動時使用password.encoder.secret進行從新編碼。
The old secret that was used for encoding dynamically configured passwords. This is required only when the secret is updated. If specified, all dynamically encoded passwords are decoded using this old secret and re-encoded using password.encoder.secret when broker starts up.
password.encoder.secret 用於爲此代理編碼動態配置密碼的密鑰。 password null medium read-only
The secret used for encoding dynamically configured passwords for this broker.
principal.builder.class KafkaPrincipalBuilder接口實現類的全名,用於構建KafkaPrincipal類型對象,這個對象在認證受權時會用到。能夠理解爲用來構建SSL安全協議的規則。 class null medium per-broker
The fully qualified name of a class that implements the KafkaPrincipalBuilder interface, which is used to build the KafkaPrincipal object used during authorization. This config also supports the deprecated PrincipalBuilder interface which was previously used for client authentication over SSL. If no principal builder is defined, the default behavior depends on the security protocol in use. For SSL authentication, the principal name will be the distinguished name from the client certificate if one is provided; otherwise, if client authentication is not required, the principal name will be ANONYMOUS. For SASL authentication, the principal will be derived using the rules defined by sasl.kerberos.principal.to.local.rules if GSSAPI is in use, and the SASL authentication ID for other mechanisms. For PLAINTEXT, the principal will be ANONYMOUS.
producer.purgatory.purge.interval.requests 【生產請求消息】請求記錄的清理間隔(此間隔非時間間隔,而是以請求數量爲間隔)。 int 1000 medium read-only
The purge interval (in number of requests) of the producer request purgatory
queued.max.request.bytes 在再也不讀取請求以前容許隊列中有的字節數。 long -1 medium read-only
The number of queued bytes allowed before no more requests are read
replica.fetch.backoff.ms 當拉取partition出現錯誤時,拉取操做休眠時間。 int 1000 [0,...] medium read-only
The amount of time to sleep when fetch partition error occurs.
replica.fetch.max.bytes 容許從每一個partition中獲取的消息的字節數。 int 1048576 [0,...] medium read-only
這不是一個絕對的最大值,若是獲取的第一個非空的分區中的第一個記錄批次大於這個屬性的值,這個記錄批次將繼續被返回以確保取得進展。
此外,能夠經過message.max.bytes (broker側) 或 max.message.bytes (topic側)來定義broker能夠接受的消息batch/批次的最大size。
The number of bytes of messages to attempt to fetch for each partition. This is not an absolute maximum, if the first record batch in the first non-empty partition of the fetch is larger than this value, the record batch will still be returned to ensure that progress can be made. The maximum record batch size accepted by the broker is defined via message.max.bytes (broker config) or max.message.bytes (topic config).
replica.fetch.response.max.bytes 指望的拉取請求響應的最大字節數。 int 10485760 [0,...] medium read-only
Maximum bytes expected for the entire fetch response. Records are fetched in batches, and if the first record batch in the first non-empty partition of the fetch is larger than this value, the record batch will still be returned to ensure that progress can be made. As such, this is not an absolute maximum. The maximum record batch size accepted by the broker is defined via message.max.bytes (broker config) or max.message.bytes (topic config).
reserved.broker.max.id 能夠做爲broker id的最大值。 int 1000 [0,...] medium read-only
Max number that can be used for a broker.id
sasl.enabled.mechanisms kafka server中啓用的SASL機制列表。此列表可能包含安全提供程序可用的任何機制。默認狀況下只有CSSAPI可用。 list GSSAPI medium per-broker
qThe list of SASL mechanisms enabled in the Kafka server. The list may contain any mechanism for which a security provider is available. Only GSSAPI is enabled by default.
sasl.jaas.config JAAS登陸上下文參數,用於SASL鏈接。格式爲: ' (=)*;' password null medium per-broker
JAAS login context parameters for SASL connections in the format used by JAAS configuration files. JAAS configuration file format is described here. The format for the value is: ' (=)*;'
sasl.kerberos.kinit.cmd Kerberos kinit命令路徑。 string /usr/bin/kinit medium per-broker
Kerberos kinit command path.
sasl.kerberos.min.time.before.relogin 刷新嘗試之間的登陸線程睡眠時間。 long 60000 medium per-broker
Login thread sleep time between refresh attempts.
sasl.kerberos.principal.to.local.rules 從主體名到短名之間的映射規則列表。按照映射規則順序評估,只要找到匹配的規則後面的規則則被忽略。默認狀況下,{username} / {hostname} @ {REALM}形式的主體名稱將映射到{username}。 有關格式的更多詳細信息,能夠參閱安全受權和acls。 請注意,若是principal.builder.classconfiguration提供了KafkaPrincipalBuilder的擴展,則會忽略此配置。 list DEFAULT medium per-broker
A list of rules for mapping from principal names to short names (typically operating system usernames). The rules are evaluated in order and the first rule that matches a principal name is used to map it to a short name. Any later rules in the list are ignored. By default, principal names of the form {username}/{hostname}@{REALM} are mapped to {username}. For more details on the format please seesecurity authorization and acls. Note that this configuration is ignored if an extension of KafkaPrincipalBuilder is provided by the principal.builder.classconfiguration.
sasl.kerberos.service.name kafka運行Kerberos的主體名。在Kafka的JAAS配置或Kafka的配置中定義均可以。 string null medium per-broker
The Kerberos principal name that Kafka runs as. This can be defined either in Kafka's JAAS config or in Kafka's config.
sasl.kerberos.ticket.renew.jitter 添加到續訂時間的隨機抖動百分比。 double 0.05 medium per-broker
Percentage of random jitter added to the renewal time.
sasl.kerberos.ticket.renew.window.factor 登陸線程將一直睡眠,直到指定的時間窗口因子從最近一次的刷新到的ticket超時過時,此時它將嘗試更新/續訂ticket。 double 0.8 medium per-broker
Login thread will sleep until the specified window factor of time from last refresh to ticket's expiry has been reached, at which time it will try to renew the ticket.
sasl.mechanism.inter.broker.protocol 用於內部broker通訊的簡單身份驗證和安全層機制。默認設置爲CSSAPI/通用安全服務應用程序接口 string GSSAPI medium per-broker
SASL mechanism used for inter-broker communication. Default is GSSAPI.
security.inter.broker.protocol 用於brokers之間通訊的安全協議。可選項有PLAINTEXT, SSL, SASL_PLAINTEXT, SASL_SSL. string PLAINTEXT medium read-only
不能同時設置該參數和inter.broker.listener.name參數。
Security protocol used to communicate between brokers. Valid values are: PLAINTEXT, SSL, SASL_PLAINTEXT, SASL_SSL. It is an error to set this and inter.broker.listener.name properties at the same time.
ssl.cipher.suites 密碼套件列表。這是用於使用TLS或SSL網絡協議協商網絡鏈接的安全設置的身份驗證,加密,MAC和密鑰交換算法的命名組合。 默認狀況下,支持全部可用的密碼套件。 list "" medium per-broker
A list of cipher suites. This is a named combination of authentication, encryption, MAC and key exchange algorithm used to negotiate the security settings for a network connection using TLS or SSL network protocol. By default all the available cipher suites are supported.
ssl.client.auth 配置kafka broker以請求客戶端身份驗證。常見設置: string none [required, requested, none] medium per-broker
ssl.client.auth = required #設置爲required意味着客戶端身份驗證是必須的。
ssl.client.auth = requested #這意味着客戶端身份驗證是可選的。 與請求不一樣,若是設置了此選項,則客戶端能夠選擇不提供有關自身的身份驗證信息
ssl.client.auth = none #這意味着不須要客戶端身份驗證。默認值爲none
Configures kafka broker to request client authentication. The following settings are common:
ssl.client.auth=required If set to required client authentication is required.
ssl.client.auth=requested This means client authentication is optional. unlike requested , if this option is set client can choose not to provide authentication information about itself
ssl.client.auth=noneThis means client authentication is not needed.
ssl.enabled.protocols 爲SSL鏈接啓用的協議列表。 list TLSv1.2,TLSv1.1,TLSv1 medium per-broker
The list of protocols enabled for SSL connections.
ssl.key.password 密鑰庫文件中私鑰的密碼。 這對於客戶來講是可選的。 password null medium per-broker
The password of the private key in the key store file. This is optional for client.
ssl.keymanager.algorithm 密鑰管理器工廠用於SSL鏈接的算法。 默認值是爲Java虛擬機配置的密鑰管理器工廠算法。 string SunX509 medium per-broker
The algorithm used by key manager factory for SSL connections. Default value is the key manager factory algorithm configured for the Java Virtual Machine.
ssl.keystore.location 密鑰庫文件的位置。 這對於客戶端是可選的,可用於客戶端的雙向身份驗證。 string null medium per-broker
The location of the key store file. This is optional for client and can be used for two-way authentication for client.
ssl.keystore.password 密鑰庫文件的訪問密碼。 這對於客戶端是可選的,僅在配置了ssl.keystore.location時才須要。 password null medium per-broker
The store password for the key store file. This is optional for client and only needed if ssl.keystore.location is configured.
ssl.keystore.type 密鑰庫文件的文件格式。 這對於客戶來講是可選的。 string JKS medium per-broker
The file format of the key store file. This is optional for client.
ssl.protocol 用於生成SSLContext的SSL協議。 string TLS medium per-broker
默認設置爲TLS,在大多數狀況下均可以。 最近的JVM中的容許值是TLS,TLSv1.1和TLSv1.2。 較舊的JVM可能支持SSL,SSLv2和SSLv3,但因爲已知的安全漏洞,不鼓勵使用它們。
The SSL protocol used to generate the SSLContext. Default setting is TLS, which is fine for most cases. Allowed values in recent JVMs are TLS, TLSv1.1 and TLSv1.2. SSL, SSLv2 and SSLv3 may be supported in older JVMs, but their usage is discouraged due to known security vulnerabilities.
ssl.provider 用於SSL鏈接的安全提供程序的名稱。 默認值是JVM的默認安全提供程序。 string null medium per-broker
The name of the security provider used for SSL connections. Default value is the default security provider of the JVM.
ssl.trustmanager.algorithm 信任管理器工廠用於SSL鏈接的算法。 默認值是爲Java虛擬機配置的信任管理器工廠算法。 string PKIX medium per-broker
The algorithm used by trust manager factory for SSL connections. Default value is the trust manager factory algorithm configured for the Java Virtual Machine.
ssl.truststore.location 信任庫文件的位置。 string null medium per-broker
The location of the trust store file.
ssl.truststore.password 信任庫文件的密碼。 若是未設置密碼,則仍可訪問信任庫,但禁用完整性檢查。 password null medium per-broker
The password for the trust store file. If a password is not set access to the trust store is still available, but integrity checking is disabled.
ssl.truststore.type 信任庫文件的文件格式。 string JKS medium per-broker
The file format of the trust store file.
alter.config.policy.class.name 用於驗證的改變配置方法類名稱。 class null low read-only
該類應該是接口 org.apache.kafka.server.policy.AlterConfigPolicy的實現類
The alter configs policy class that should be used for validation. The class should implement the org.apache.kafka.server.policy.AlterConfigPolicy interface.
alter.log.dirs.replication.quota.window.num 保留在內存中用於修改log dirs副本指標的樣本數。 int 11 [1,...] low read-only
The number of samples to retain in memory for alter log dirs replication quotas
alter.log.dirs.replication.quota.window.size.seconds 上個參數中提到的改變log dirs副本指標的樣本的時間跨度。 int 1 [1,...] low read-only
The time span of each sample for alter log dirs replication quotas
authorizer.class.name 應該用於受權的受權者類。 string "" low read-only
The authorizer class that should be used for authorization
create.topic.policy.class.name 應該用於驗證的建立topic策略類。 class null low read-only
該類應該是org.apache.kafka.server.policy.CreateTopicPolicy接口的實現類。
The create topic policy class that should be used for validation. The class should implement the org.apache.kafka.server.policy.CreateTopicPolicy interface.
delegation.token.expiry.check.interval.ms 掃描間隔以刪除過時的token。 long 3600000 [1,...] low read-only
Scan interval to remove expired delegation tokens.
listener.security.protocol.map 監聽器名稱和安全協議之間的映射。 string PLAINTEXT:PLAINTEXT,SSL:SSL,SASL_PLAINTEXT:SASL_PLAINTEXT,SASL_SSL:SASL_SSL low per-broker
必須爲同一安全協議定義,以便在多個端口或IP中使用。 例如,即便二者都須要SSL,也能夠分離內部和外部流量。 具體地說,用戶能夠定義名爲INTERNAL和EXTERNAL的偵聽器,並將此屬性定義爲:INTERNAL:SSL,EXTERNAL:SSL。 如圖所示,鍵和值由冒號分隔,映射條目以逗號分隔。 每一個偵聽器名稱只應在地圖中出現一次。 經過向配置名稱添加規範化前綴(偵聽器名稱爲小寫),能夠爲每一個偵聽器配置不一樣的安全性(SSL和SASL)設置。 例如,要爲INTERNAL偵聽器設置不一樣的密鑰庫,將設置名爲「listener.name.internal.ssl.keystore.location」的配置。 若是未設置偵聽器名稱的配置,則配置將回退到通用配置(即ssl.keystore.location)。
Map between listener names and security protocols. This must be defined for the same security protocol to be usable in more than one port or IP. For example, internal and external traffic can be separated even if SSL is required for both. Concretely, the user could define listeners with names INTERNAL and EXTERNAL and this property as: INTERNAL:SSL,EXTERNAL:SSL. As shown, key and value are separated by a colon and map entries are separated by commas. Each listener name should only appear once in the map. Different security (SSL and SASL) settings can be configured for each listener by adding a normalised prefix (the listener name is lowercased) to the config name. For example, to set a different keystore for the INTERNAL listener, a config with name listener.name.internal.ssl.keystore.location would be set. If the config for the listener name is not set, the config will fallback to the generic config (i.e. ssl.keystore.location).
metric.reporters 用於度量報告的類列表。實現接口 org.apache.kafka.common.metrics.MetricsReporter的類能夠插入到類列表中,這樣就能夠被metic建立通知到. JmxReporter通常包括註冊JMX統計。 list "" low cluster-wide
A list of classes to use as metrics reporters. Implementing the org.apache.kafka.common.metrics.MetricsReporter interface allows plugging in classes that will be notified of new metric creation. The JmxReporter is always included to register JMX statistics.
metrics.num.samples 用於維護計算指標的樣本數量。 int 2 [1,...] low read-only
The number of samples maintained to compute metrics.
metrics.recording.level 指標的最高紀錄級別。 string INFO low read-only
The highest recording level for metrics.
metrics.sample.window.ms 計算度量樣本的時間窗口。 long 30000 [1,...] low read-only
The window of time a metrics sample is computed over.
password.encoder.cipher.algorithm 用於編碼動態配置密碼的密碼算法。 string AES/CBC/PKCS5Padding low read-only
The Cipher algorithm used for encoding dynamically configured passwords.
password.encoder.iterations 用於編碼動態配置密碼的迭代計數。 int 4096 [1024,...] low read-only
The iteration count used for encoding dynamically configured passwords.
password.encoder.key.length 用於編碼動態配置密碼的密鑰長度。 int 128 [8,...] low read-only
The key length used for encoding dynamically configured passwords.
password.encoder.keyfactory.algorithm SecretKeyFactory算法用於編碼動態配置的密碼。 string null low read-only
默認值爲PBKDF2WithHmacSHA512(若是可用),不然爲PBKDF2WithHmacSHA1。
The SecretKeyFactory algorithm used for encoding dynamically configured passwords. Default is PBKDF2WithHmacSHA512 if available and PBKDF2WithHmacSHA1 otherwise.
quota.window.num 在內存中維護的用於客戶端配額的樣本數量。 int 11 [1,...] low read-only
The number of samples to retain in memory for client quotas
quota.window.size.seconds 上面參數中樣本的時間窗。 int 1 [1,...] low read-only
The time span of each sample for client quotas
replication.quota.window.num 在內存中維護的用於副本配額的樣本數量。 int 11 [1,...] low read-only
The number of samples to retain in memory for replication quotas
replication.quota.window.size.seconds 用於複製配額的每一個樣本的時間跨度。 int 1 [1,...] low read-only
The time span of each sample for replication quotas
ssl.endpoint.identification.algorithm 端點識別算法,使用服務器證書驗證服務器主機名。 string null low per-broker
The endpoint identification algorithm to validate server hostname using server certificate.
ssl.secure.random.implementation 用於SSL加密操做的SecureRandom PRNG實現。 string null low per-broker
The SecureRandom PRNG implementation to use for SSL cryptography operations.
transaction.abort.timed.out.transaction.cleanup.interval.ms 回滾已超時的事務的時間間隔。 int 60000 [1,...] low read-only
The interval at which to rollback transactions that have timed out
transaction.remove.expired.transaction.cleanup.interval.ms 刪除【因爲transactional.id.expiration.ms過時而引發的過時的事物】的時間間隔 int 3600000 [1,...] low read-only
The interval at which to remove transactions that have expired due to transactional.id.expiration.ms passing
zookeeper.sync.time.ms zk的follower能夠多長時間不與zk leader同步(zk follower能夠落後zk leader的最長時間) int 2000 low read-only
How far a ZK follower can be behind a ZK leader

三、修改上表中的參數須要經過./kafka-configs.sh文件來實現更改(kafka版本號 >= 1.1)。bootstrap

例如改變當前broker 0上的log cleaner threads能夠經過下面命令實現:緩存

> bin/kafka-configs.sh --bootstrap-server localhost:9092 --entity-type brokers --entity-name 0 --alter --add-config log.cleaner.threads=2
複製代碼

查看當前broker 0的動態配置參數:安全

> bin/kafka-configs.sh --bootstrap-server localhost:9092 --entity-type brokers --entity-name 0 --describe
複製代碼

刪除broker id爲0的server上的配置參數/設置爲默認值:bash

> bin/kafka-configs.sh --bootstrap-server localhost:9092 --entity-type brokers --entity-name 0 --alter --delete-config log.cleaner.threads
複製代碼

同時更新集羣上全部broker上的參數(cluster-wide類型,保持全部brokers上參數的一致性):服務器

> bin/kafka-configs.sh --bootstrap-server localhost:9092 --entity-type brokers --entity-default --alter --add-config log.cleaner.threads=2
複製代碼

查看當前集羣中動態的cluster-wide類型的參數列表:

> bin/kafka-configs.sh --bootstrap-server localhost:9092 --entity-type brokers --entity-default --describe
複製代碼

若是一個參數同時在不一樣的level層面進行了定義,那麼其使用的優先級以下所示:

Dynamic per-broker config stored in ZooKeeper  # 保存在zk中的動態的per-broker配置
Dynamic cluster-wide default config stored in ZooKeeper # 保存在zk中的動態的cluster-wide級別的配置
Static broker config from server.properties  # server.properties中靜態配置的參數
Kafka default, see broker configs  # kafka的終極默認值
複製代碼
相關文章
相關標籤/搜索