kafka文檔(11)----0.10.1-Document-文檔(3)-configures-broker配置信息

3. CONFIGURATION

Kafka uses key-value pairs in the property file format for configuration. These values can be supplied either from a file or programmatically.


3、配置信息

Kafka使用key-value格式配置信息。這些配置可以從配置文件中獲取或者是程序中的默認值。

3.1 Broker Configs

The essential configurations are the following:
  • broker.id
  • log.dirs
  • zookeeper.connect
Topic-level configurations and defaults are discussed in more detail below.


3.1 Broker配置

基本的配置信息包含以下:

-broker.id

-log.dirs

-zookeeper.connect

Topic-level的配置以及默認值請閱讀下面


NAME DESCRIPTION TYPE DEFAULT VALID VALUES IMPORTANCE
zookeeper.connect Zookeeper host string

zookeeper host字符串
string

high
advertised.host.name DEPRECATED: only used when `advertised.listeners` or `listeners` are not set. Use `advertised.listeners` instead. Hostname to publish to ZooKeeper for clients to use. In IaaS environments, this may need to be different from the interface to which the broker binds. If this is not set, it will use the value for `host.name` if configured. Otherwise it will use the value returned from java.net.InetAddress.getCanonicalHostName().

已廢棄:只有當‘advertised.listeners'或者’listeners'沒有設置時才使用。目前使用‘advertised.listeners'代替。主機名傳遞到zookeeper,以供客戶端使用。在laaS環境中,這個名字可能與broker綁定的名字不同。如果這個值沒有設置,如果‘host.name’選項設置了,系統將會使用’host.name'的值,否則系統會返回java.net.InetAddress.getCanonicalHostName()錯誤。
string null
high
advertised.listeners Listeners to publish to ZooKeeper for clients to use, if different than the listeners above. In IaaS environments, this may need to be different from the interface to which the broker binds. If this is not set, the value for `listeners` will be used.

如果這個值和上面的listeners配置不同,將會傳遞此值到zookeeper以供客戶端使用。在laaS環境中,這個值可能與brokers綁定的名字不同。如果沒有設置這個值,系統會使用‘listeners'
string null
high
advertised.port DEPRECATED: only used when `advertised.listeners` or `listeners` are not set. Use `advertised.listeners` instead. The port to publish to ZooKeeper for clients to use. In IaaS environments, this may need to be different from the port to which the broker binds. If this is not set, it will publish the same port that the broker binds to.

已廢棄:只有當沒有設置‘advertised.listeners'和’listeners'時才使用這個值。目前使用‘advertised.listeners'作爲替代。這是發佈到zookeeper上,以供客戶端使用。在laaS環境中,這個可能和broker綁定的端口不同。如果這個值沒有設置,一般會使用broker綁定的端口。
int null
high
auto.create.topics.enable Enable auto creation of topic on the server

是否允許在server上自動創建topic
boolean true
high
auto.leader.rebalance.enable Enables auto leader balancing. A background thread checks and triggers leader balance if required at regular intervals

是否允許leader的自動平衡。如果允許的話,會有後臺線程檢查並觸發leader的均衡操作。
boolean true
high
background.threads The number of threads to use for various background processing tasks

後臺處理任務的線程數
int 10 [1,...] high
broker.id The broker id for this server. If unset, a unique broker id will be generated.To avoid conflicts between zookeeper generated broker id's and user configured broker id's, generated broker ids start from reserved.broker.max.id + 1.

當前server的broker id。如果沒有設置,系統會自動分配一個唯一的broker id。爲了避免在zookeeper自動產生的broker id和用戶配置的broker id之間產生衝突,自動產生的broker一般是從reserved.broker.max.id + 1開始的。
int -1
high
compression.type Specify the final compression type for a given topic. This configuration accepts the standard compression codecs ('gzip', 'snappy', 'lz4'). It additionally accepts 'uncompressed' which is equivalent to no compression; and 'producer' which means retain the original compression codec set by the producer.

指定某個topic消息壓縮類型。此配置接受標準壓縮編碼器(’gzip‘,’snappy‘,’lz4‘)。另外也接受非壓縮模式。‘producer'是指壓縮編碼器由producer指定。
string producer
high
delete.topic.enable Enables delete topic. Delete topic through the admin tool will have no effect if this config is turned off

是否允許刪除topic。如果設置爲否,則官方版本的工具將無法刪除topic
boolean false
high
host.name DEPRECATED: only used when `listeners` is not set. Use `listeners` instead. hostname of broker. If this is set, it will only bind to this address. If this is not set, it will bind to all interfaces

已廢棄:
只有當’listeners'沒有設置時,才使用這個值。目前採用‘listeners'作爲替代。如果設置了這個選項,broker只會綁定到這個地址,如果沒有設置這個值,broker將會綁定到所有對外host name。
string ""
high
leader.imbalance.check.interval.seconds The frequency with which the partition rebalance check is triggered by the controller

controlles檢查是否進行partitions重新負載均衡的頻率,單位爲秒
long 300
high
leader.imbalance.per.broker.percentage The ratio of leader imbalance allowed per broker. The controller would trigger a leader balance if it goes above this value per broker. The value is specified in percentage.

每個broker允許的leader失衡比例。如果某個broker的leader失衡數已經大於這個數值,則controller會觸發leader的負載均衡。這個值以百分比的方式給出。
int 10
high
listeners Listener List - Comma-separated list of URIs we will listen on and their protocols. Specify hostname as 0.0.0.0 to bind to all interfaces. Leave hostname empty to bind to default interface. Examples of legal listener lists: PLAINTEXT://myhost:9092,TRACE://:9091 PLAINTEXT://0.0.0.0:9092, TRACE://localhost:9093

監聽列表-以逗號分隔的URIs列表,指明瞭broker需要監聽的hostname以及協議。需要指出的是,當指定hostname爲0.0.0.0時,就是綁定此broker到所有hostname。如果留空hostname,則綁定到默認hostname。合法監聽列表爲:
PLAINTEXT://myhost:9092,TRACE://:9091 PLAINTEXT://0.0.0.0:9092, TRACE://localhost:9093
string null
high
log.dir The directory in which the log data is kept (supplemental for log.dirs property)

日誌存儲的目錄,log.dirs作爲此配置的補充選項
string /tmp/kafka-logs
high
log.dirs The directories in which the log data is kept. If not set, the value in log.dir is used

日誌存儲的多個目錄列表。如果沒有配置此選項,則使用log.dir配置
string null
high
log.flush.interval.messages The number of messages accumulated on a log partition before messages are flushed to disk

消息回刷到磁盤之前,內存所保存的每個partition的消息總數
long 9223372036854775807 [1,...] high
log.flush.interval.ms The maximum time in ms that a message in any topic is kept in memory before flushed to disk. If not set, the value in log.flush.scheduler.interval.ms is used

消息回刷到磁盤之前,消息在內存中保存的最長時間。如果沒有設置,則使用log.flush.scheduler.interval.ms的值。
long null
high
log.flush.offset.checkpoint.interval.ms The frequency with which we update the persistent record of the last flush which acts as the log recovery point

由於內存中的日誌並不是立刻回刷到磁盤,所以確定回刷到磁盤的消息纔是在當前broker崩潰重啓之後可以恢復的點。查看broker日誌目錄,可以看到兩個文件,其中一個文件就是保存每個topic-partition的recover point的文件。因此,這個值就是更新這個恢復點的頻率間隔。

int 60000 [0,...] high
log.flush.scheduler.interval.ms The frequency in ms that the log flusher checks whether any log needs to be flushed to disk

日誌回刷器檢查是否將任何日誌回刷到磁盤的頻率。
long 9223372036854775807
high
log.retention.bytes The maximum size of the log before deleting it

日誌刪除之前的最大尺寸
long -1
high
log.retention.hours The number of hours to keep a log file before deleting it (in hours), tertiary to log.retention.ms property

日誌刪除之前保存的小時數,默認時168小時,即2周;優先級相對於log.retention.ms爲第三
int 168
high
log.retention.minutes The number of minutes to keep a log file before deleting it (in minutes), secondary to log.retention.ms property. If not set, the value in log.retention.hours is used

日誌刪除前保存的分鐘數。優先級相對於log.retention.ms爲第二,如果沒有設置這個值,則使用log.retention.hours
int null
high
log.retention.ms The number of milliseconds to keep a log file before deleting it (in milliseconds), If not set, the value in log.retention.minutes is used

日誌刪除之前保存的ms數。如果沒有設置,則使用log.retention.minutes
long null
high
log.roll.hours The maximum time before a new log segment is rolled out (in hours), secondary to log.roll.ms property

滾動生成新日誌的最大時間間隔,優先級相對於log.roll.ms爲第二
int 168 [1,...] high
log.roll.jitter.hours The maximum jitter to subtract from logRollTimeMillis (in hours), secondary to log.roll.jitter.ms property

相對於logRollTimeMillis出現的最大時間偏差,相對於log.poll.jitter.ms爲第二優先級。
int 0 [0,...] high
log.roll.jitter.ms The maximum jitter to subtract from logRollTimeMillis (in milliseconds). If not set, the value in log.roll.jitter.hours is used

相對於logRollTimeMillis出現的最大時間偏差,如果沒有設置此值,則使用log.roll.jitter.hours
long null
high
log.roll.ms The maximum time before a new log segment is rolled out (in milliseconds). If not set, the value in log.roll.hours is used

滾動生成新日誌的最大時間間隔,如果沒有設置此值,則使用log.roll.hours
long null
high
log.segment.bytes The maximum size of a single log file

單獨的日誌文件最大尺寸。
int 1073741824 [14,...] high
log.segment.delete.delay.ms The amount of time to wait before deleting a file from the filesystem

從文件系統中刪除文件所等待的最長時間。
long 60000 [0,...] high
message.max.bytes The maximum size of message that the server can receive

server可以接收的最大消息尺寸
int 1000012 [0,...] high
min.insync.replicas When a producer sets acks to "all" (or "-1"), min.insync.replicas specifies the minimum number of replicas that must acknowledge a write for the write to be considered successful. If this minimum cannot be met, then the producer will raise an exception (either NotEnoughReplicas or NotEnoughReplicasAfterAppend).
When used together, min.insync.replicas and acks allow you to enforce greater durability guarantees. A typical scenario would be to create a topic with a replication factor of 3, set min.insync.replicas to 2, and produce with acks of "all". This will ensure that the producer raises an exception if a majority of replicas do not receive a write.

當producer設置ack選項爲‘all'或者’-1‘時,此值指定了server成功寫入的最少備份數,只有寫入達到了此備份數,server才能返回正確寫入的確認消息。如果沒有實現成功寫入這個最少備份數,server會拋出異常(either NotEnoughReplicas or NotEnoughReplicasAfterAppend)。一塊使用min.sync.replicas和acks可以提高寫入消息可用性。典型的用法是,將topic的備份數設置爲3,將此值設置爲2,然後producer可以設置ack爲‘all’。這將使得server在大部分備份節點沒有成功寫入消息拋出異常。
int 1 [1,...] high
num.io.threads The number of io threads that the server uses for carrying out network requests

server用來獲取網絡請求的io線程數。
int 8 [1,...] high
num.network.threads the number of network threads that the server uses for handling network requests

server用來處理網絡請求的網絡線程數
int 3 [1,...] high
num.recovery.threads.per.data.dir The number of threads per data directory to be used for log recovery at startup and flushing at shutdown

在啓動和正常終止期間,用於每個數據目錄進行日誌恢復的線程數
int 1 [1,...] high
num.replica.fetchers Number of fetcher threads used to replicate messages from a source broker. Increasing this value can increase the degree of I/O parallelism in the follower broker.

用於從leader broker獲取消息的線程數。提高這個值可以提高follower broker的並行處理能力。
int 1
high
offset.metadata.max.bytes The maximum size for a metadata entry associated with an offset commit

與offset提交相關聯的元數據條目的最大大小
int 4096
high
offsets.commit.required.acks The required acks before the commit can be accepted. In general, the default (-1) should not be overridden

提交接受之前所要求的acks。一般來說。默認值-1不應當改變。
注:日誌發送到broker,雖然broker成功接收到,但是並沒有提交到日誌中去,所以在真正提交到日誌之前,需要所有的broker都真正收到這條日誌。
short -1
high
offsets.commit.timeout.ms Offset commit will be delayed until all replicas for the offsets topic receive the commit or this timeout is reached. This is similar to the producer request timeout.

在topics的備份接收到這次提交之前或者超時之前,此次offset提交可以等待的時間。這個和producer請求的超時時間比較相似。
int 5000 [1,...] high
offsets.load.buffer.size Batch size for reading from the offsets segments when loading offsets into the cache.

加載offsets到緩存時從offsets段中批量讀取的數量
int 5242880 [1,...] high
offsets.retention.check.interval.ms Frequency at which to check for stale offsets

檢查穩定offset的頻率
long 600000 [1,...] high
offsets.retention.minutes Log retention window in minutes for offsets topic

對offsets topic來說,日誌刪除窗口時間
int 1440 [1,...] high
offsets.topic.compression.codec Compression codec for the offsets topic - compression may be used to achieve "atomic" commits

對於offsets topic的壓縮編碼器-壓縮可以實現原子提交
int 0
high
offsets.topic.num.partitions The number of partitions for the offset commit topic (should not change after deployment)

offset提交topic的partitions數目(一旦部署,不應該改變)
int 50 [1,...] high
offsets.topic.replication.factor The replication factor for the offsets topic (set higher to ensure availability). To ensure that the effective replication factor of the offsets topic is the configured value, the number of alive brokers has to be at least the replication factor at the time of the first request for the offsets topic. If not, either the offsets topic creation will fail or it will get a replication factor of min(alive brokers, configured replication factor)

offsets topic的備份數,值越大可靠性越高。爲保證offsets topic有效備份數是配置的數值,活躍brokers的數目最低爲備份數目。如果達不到這個數值,offsets topic會創建失敗,或者只能獲得二者之中較小者(活躍的brokers,所配置的備份數目)
short 3 [1,...] high
offsets.topic.segment.bytes The offsets topic segment bytes should be kept relatively small in order to facilitate faster log compaction and cache loads

offsets topic段字節應當相對比較小,以便於獲取更快的日誌壓縮以及緩存負載。
int 104857600 [1,...] high
port DEPRECATED: only used when `listeners` is not set. Use `listeners` instead. the port to listen and accept connections on

已廢棄:
只有當‘listeners'沒有設置時才使用。使用’listeners'作爲替代。監聽的端口號以及接受鏈接的端口號。
int 9092
high
queued.max.requests The number of queued requests allowed before blocking the network threads

隊列中請求的最大個數,超過這個值就會阻塞網絡請求。
int 500 [1,...] high
quota.consumer.default DEPRECATED: Used only when dynamic default quotas are not configured for or in Zookeeper. Any consumer distinguished by clientId/consumer group will get throttled if it fetches more bytes than this value per-second

已廢棄:
只有沒有爲zookeeper或者在zookeeper中沒有配置默認的動態配額時纔會使用。任何由clientid或者consumer group區分的consumer只要每秒獲取的數據會小於這個值。
long 9223372036854775807 [1,...] high
quota.producer.default DEPRECATED: Used only when dynamic default quotas are not configured for , or in Zookeeper. Any producer distinguished by clientId will get throttled if it produces more bytes than this value per-second

已廢棄:
只有當沒有爲zookeeper或者在zookeeper中沒有配置動態的配額時纔回使用。任何以clientid區分的producer在每秒中獲取的字節數會小於這個值。
long 9223372036854775807 [1,...] high
replica.fetch.min.bytes Minimum bytes expected for each fetch response. If not enough bytes, wait up to replicaMaxWaitTimeMs

每次抓取消息時所期待應答的最小尺寸。如果沒有足夠的字節,等待 replicaMaxWaitTimeMs長的時間。
int 1
high
replica.fetch.wait.max.ms max wait time for each fetcher request issued by follower replicas. This value should always be less than the replica.lag.time.max.ms at all times to prevent frequent shrinking of ISR for low throughput topics

followers備份時抓取消息等待的最長時間。這個值一般小於replica.lag.time.max.ms,以防止ISR列表由於follower的超時的不斷變化
int 500
high
replica.high.watermark.checkpoint.interval.ms The frequency with which the high watermark is saved out to disk

高水印保存到磁盤的頻率。這個涉及到kafka的內存管理,由於寫入kafka的數據分爲兩種:一種是寫入kafka broker內存的,但是並沒有寫入磁盤,這種數據是不可恢復的;一種是寫入內存也寫入磁盤的,這種數據是可以恢復的,高水印其實就是這兩種數據的分界線。
long 5000
high
replica.lag.time.max.ms If a follower hasn't sent any fetch requests or hasn't consumed up to the leaders log end offset for at least this time, the leader will remove the follower from isr

如果follower沒有發送任何同步請求或者沒有從leader沒有同步到最新offset,如果上述情況持續了這個值代表的時間,那麼leader會從isr將這個follower移除。
long 10000
high
replica.socket.receive.buffer.bytes The socket receive buffer for network requests

網絡請求中socket 收到緩存的最大尺寸。
int 65536
high
replica.socket.timeout.ms The socket timeout for network requests. Its value should be at least replica.fetch.wait.max.ms

網絡請求中socket超市時間。它的值最小是replica.fetch.wait.max.ms
int 30000
high
request.timeout.ms The configuration controls the maximum amount of time the client will wait for the response of a request. If the response is not received before the timeout elapses the client will resend the request if necessary or fail the request if retries are exhausted.

客戶端等待broker應答的超時時間。如果超時了,客戶端沒有收到應答,如果必要的話可能會重發請求,如果重試都失敗了也可能會報請求失敗
int 30000
high
socket.receive.buffer.bytes The SO_RCVBUF buffer of the socket sever sockets. If the value is -1, the OS default will be used.

server 的socket緩存SO_RCVBUF。如果設置爲-1,將使用OS的默認值
int 102400
high
socket.request.max.bytes The maximum number of bytes in a socket request

socket請求的最大字節數
int 104857600 [1,...] high
socket.send.buffer.bytes The SO_SNDBUF buffer of the socket sever sockets. If the value is -1, the OS default will be used.

server的socket的SO_SNDBUF緩存。如果設置爲-1,將使用OS的默認值
int 102400
high
unclean.leader.election.enable 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

指明是否允許不在ISR列表中的備份節點稱爲新leader,即使這麼做會造成數據丟失
boolean true
high
zookeeper.connection.timeout.ms 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建立鏈接時等待的最長時間。如果沒有設置,將會使用zookeeper.session.timeout.ms的值
int null
high
zookeeper.session.timeout.ms Zookeeper session timeout

zookeeper回話超時時間
int 6000
high
zookeeper.set.acl Set client to use secure ACLs

設置客戶端使用安全的ACLs權限控制
boolean false
high
broker.id.generation.enable Enable automatic broker id generation on the server. When enabled the value configured for reserved.broker.max.id should be reviewed.

允許server自動分配broker id。當設置這個值時,需要仔細察看reserved.broker.max.id的值,以防止自動產生的broker.id和配置的broker.id衝突
boolean true
medium
broker.rack Rack of the broker. This will be used in rack aware replication assignment for fault tolerance. Examples: `RACK1`, `us-east-1d`

broker的支架?
用來在支架感知備份中的容錯;例如:
‘RACK1’, ‘us-east-1d'
string null
medium
connections.max.idle.ms Idle connections timeout: the server socket processor threads close the connections that idle more than this

空閒鏈接的超時時間:server socket處理線程會關閉超時的鏈接。
long 600000
medium
controlled.shutdown.enable Enable controlled shutdown of the server

是否允許server受控的終止。
boolean true
medium
controlled.shutdown.max.retries Controlled shutdown can fail for multiple reasons. This determines the number of retries when such failure happens

受控制的終止因爲多種原因失敗。這個決定了控制終止失敗時重試的次數
int 3
medium
controlled.shutdown.retry.backoff.ms 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.

在每次重試之前,系統需要時間從引發先前失敗的狀態恢復過來(控制失敗有可能因爲replica lag等)。這個配置決定了在重試之前等待的時間。
long 5000
medium
controller.socket.timeout.ms The socket timeout for controller-to-broker channels

controller-to-broker的信道socket的超時時間
int 30000
medium
default.replication.factor default replication factors for automatically created topics

自動創建的topic默認的備份數
int 1
medium
fetch.purgatory.purge.interval.requests The purge interval (in number of requests) of the fetch request purgatory

抓取請求的清除時間間隔
int 1000
medium
group.max.session.timeout.ms 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.

每個已註冊consumers的最大會話超時時間。超時越長,consumers在兩次心跳之間處理消息的時間就越長,同樣需要花費更多的時間去檢測失聯錯誤。
int 300000
medium
group.min.session.timeout.ms The minimum allowed session timeout for registered consumers. Shorter timeouts leader to quicker failure detection at the cost of more frequent consumer heartbeating, which can overwhelm broker resources.

已註冊的consumers最小的會話超市時間。超時越小,leader越快檢查失聯錯誤,同樣需要更多的consumers心跳鏈接,這可能過度耗費brokers的資源。
int 6000
medium
inter.broker.protocol.version 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.

指定了broker內部的協議版本。這個一般是在所有brokers都升級到新版本之後才能升級的。例如,正確的值是:
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.查看API版本可以獲取完整的版本列表
string 0.10.1-IV2
medium
log.cleaner.backoff.ms The amount of time to sleep when there are no logs to clean

當沒有日誌清除時,cleaner睡眠的時間
long 15000 [0,...] medium
log.cleaner.dedupe.buffer.size The total memory used for log deduplication across all cleaner threads

日誌刪除線程所需要的內存總大小
long 134217728
medium
log.cleaner.delete.retention.ms How long are delete records retained?

保存刪除日誌多長時間
long 86400000
medium
log.cleaner.enable 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.

是否允許server運行日誌刪除進程。如果內部offsets topic使用的cleanup.policy=compact,則需要允許。如果不允許的話,則topics的數據不會壓縮,並且越來越大
boolean true
medium
log.cleaner.io.buffer.load.factor 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

日誌清除器複製緩存的負載因子。??
更高的值
double 0.9
medium
log.cleaner.io.buffer.size The total memory used for log cleaner I/O buffers across all cleaner threads

所有日誌清除線程所使用的I/O緩存的總大小
int 524288 [0,...] medium
log.cleaner.io.max.bytes.per.second 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

日誌清除任務平均讀寫I/O的速度應該小於這個值
double 1.7976931348623157E308
medium
log.cleaner.min.cleanable.ratio The minimum ratio of dirty log to total log for a log to eligible for cleaning

需要清除的日誌佔總日誌大小的最小比例,達到這個值時,需要清理
double 0.5
medium
log.cleaner.min.compaction.lag.ms The minimum time a message will remain uncompacted in the log. Only applicable for logs that are being compacted.

未壓縮日誌等待的最短時間;只適用於待壓縮的日誌
long 0
medium
log.cleaner.threads The number of background threads to use for log cleaning

用於日誌清除的後臺線程數
int 1 [0,...] medium
log.cleanup.policy The default cleanup policy for segments beyond the retention window. A comma separated list of valid policies. Valid policies are: "delete" and "compact"

清除過期日誌的策略;後面使用逗號分隔的列表列舉出正確的策略。正確的策略爲:刪除和壓縮
list [delete] [compact, delete] medium
log.index.interval.bytes The interval with which we add an entry to the offset index

向offset索引添加條目的字節間隔:即每個多少個字節就新寫入一條信息記錄當前offset
int 4096 [0,...] medium
log.index.size.max.bytes The maximum size in bytes of the offset index

offset 索引的最大字節數
int 10485760 [4,...] medium
log.message.format.version 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.

指定broker上生成日誌的格式版本;版本號和kafka API版本號相同。例如:0.8.2,0.9.0.0,0.10.0,更多版本號需要查看ApiVersion。通過設置特定的消息格式版本,用戶可以確認所有磁盤上的消息格式都小於或者等於這個版本號。錯誤的設置這個版本號會導致低版本的consumer客戶端在收到高版本消息無法識別的現象。
string 0.10.1-IV2
medium
log.message.timestamp.difference.max.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.

當broker收到消息並在此消息中打上時間戳時,此值代表兩條消息時間戳之間的最大差值。如果log.message.timestamp.type=CreateTime,則當兩條消息時間戳之間差值大於這個值時,broker應當拒絕接收消息。如果log.message.timestamp.type=LogAppendTime時,則忽略此配置。
long 9223372036854775807 [0,...] medium
log.message.timestamp.type Define whether the timestamp in the message is message create time or log append time. The value should be either `CreateTime` or `LogAppendTime`

定義消息時間戳是使用消息創建時間還是使用日誌追加時間。可選值爲‘CreateTime’或者‘LogAppendTime'之一。
估計創建時間是producer的時間,日誌追加時間是broker的時間
string CreateTime [CreateTime, LogAppendTime] medium
log.preallocate Should pre allocate file when create new segment? If you are using Kafka on Windows, you probably need to set it to true.

是否預分配新日誌?如果在windows上使用kafka,需要預分配。
boolean false
medium
log.retention.check.interval.ms The frequency in milliseconds that the log cleaner checks whether any log is eligible for deletion

檢查日誌是否刪除的頻率間隔
long 300000 [1,...] medium
max.connections.per.ip The maximum number of connections we allow from each ip address

允許每個ip地址連接總數
int 2147483647 [1,...] medium
max.connections.per.ip.overrides Per-ip or hostname overrides to the default maximum number of connections

每個ip或者hostname覆蓋默認連接的最大個數?
string ""
medium
num.partitions The default number of log partitions per topic

每個topic的partition的默認個數
int 1 [1,...] medium
principal.builder.class The fully qualified name of a class that implements the PrincipalBuilder interface, which is currently used to build the Principal for connections with the SSL SecurityProtocol.

實現PrincipalBuilder接口的類的全名,目前用於創建符合SSL安全協議鏈接的Principal
class class org.apache.kafka.common.security.auth.DefaultPrincipalBuilder
medium
producer.purgatory.purge.interval.requests The purge interval (in number of requests) of the producer request purgatory

用於清除生產者無效鏈接的間隔(請求的個數)
int 1000
medium
replica.fetch.backoff.ms The amount of time to sleep when fetch partition error occurs.

每當遇到抓取partition消息錯誤時需要sleep的時間總數
int 1000 [0,...] medium
replica.fetch.max.bytes The number of bytes of messages to attempt to fetch for each partition. This is not an absolute maximum, if the first message in the first non-empty partition of the fetch is larger than this value, the message will still be returned to ensure that progress can be made. The maximum message size accepted by the broker is defined viamessage.max.bytes (broker config) ormax.message.bytes (topic config).

嘗試抓取每個partition消息的字節數。這個不是絕對的最大值,如果某次消息抓取中發現第一個非空partition的第一條消息大於這個值,則消息依然會返回給consumer以保證繼續進行。broker可以接受的消息最大字節數位message.max.bytes(broker.config)或者max.message.bytes(topic config)
int 1048576 [0,...] medium
replica.fetch.response.max.bytes Maximum bytes expected for the entire fetch response. This is not an absolute maximum, if the first message in the first non-empty partition of the fetch is larger than this value, the message will still be returned to ensure that progress can be made. The maximum message size accepted by the broker is defined viamessage.max.bytes (broker config) ormax.message.bytes (topic config).

針對抓取消息請求的完整應答所包含的最大字節數。這個不是絕對的最大值,如果請求中的第一個非空partition的第一條消息大小大於這個值,消息依然會返回給客戶端,以保證繼續進行。broker可以接受的最大消息通過message.max.bytes(broker.config)或者max.message.bytes(topic config)設定
int 10485760 [0,...] medium
reserved.broker.max.id Max number that can be used for a broker.id

可以用於broker.id的最大個數
int 1000 [0,...] medium
sasl.enabled.mechanisms The 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機制列表。這個列表可能包含任何可用的機制。默認只支持GSSAPI
list [GSSAPI]
medium
sasl.kerberos.kinit.cmd Kerberos kinit command path.

Kerberos kinit命令路徑
string /usr/bin/kinit
medium
sasl.kerberos.min.time.before.relogin Login thread sleep time between refresh attempts.

在重試之間登陸線程的睡眠時間
long 60000
medium
sasl.kerberos.principal.to.local.rules 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 see security authorization and acls.

從主機名映射到短名字(一般是操作系統用戶名)的規則列表。規則按照順序進行匹配,第一個可以匹配上主機名的規則將使用它來映射主機名到短名字。後面其它的規則都將忽略。默認情況下,從{username}/{hostname}@{REALM}將映射到{username}。更多細節請查看security authorization and acls.
list [DEFAULT]
medium
sasl.kerberos.service.name The Kerberos principal name that Kafka runs as. This can be defined either in Kafka's JAAS config or in Kafka's config.

kafka運行的Kerberos主機名。可以在Kafka's JAAS配置或者Kafka's 配置中定義。
string null
medium
sasl.kerberos.ticket.renew.jitter Percentage of random jitter added to the renewal time.

添加到更新時間的隨機抖動的百分比。
double 0.05
medium
sasl.kerberos.ticket.renew.window.factor 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.

重新進行登錄驗證刷新之前,登錄線程的睡眠時間
double 0.8
medium
sasl.mechanism.inter.broker.protocol SASL mechanism used for inter-broker communication. Default is GSSAPI.

broker內部進行通信的SASL機制。默認時GSSAPI
string GSSAPI
medium
security.inter.broker.protocol Security protocol used to communicate between brokers. Valid values are: PLAINTEXT, SSL, SASL_PLAINTEXT, SASL_SSL.

brokers之間通信使用的安全協議。正確值爲:PLAINTEXT, SSL, SASL_PLAINTEXT, SASL_SSL.
string PLAINTEXT
medium
ssl.cipher.suites 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.

密碼套件列表。 這是一種集認證,加密,MAC和密鑰交換算法一塊的命名組合,用於使用TLS或SSL網絡協議協商網絡連接的安全設置。 默認情況下,支持所有可用的密碼套件。
list null
medium
ssl.client.auth Configures kafka broker to request client authentication. The following settings are common:
kafka broker應對客戶端請求的授權。下面爲具體配置:
  • 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意味着授權是可選的。不像requested,如果這樣設置,客戶端可以選擇不提供授權信息
  • ssl.client.auth=none This means client authentication is not needed.不需要授權
none [required, requested, none] medium medium
ssl.enabled.protocols The list of protocols enabled for SSL connections.

SSL鏈接的協議
list [TLSv1.2, TLSv1.1, TLSv1]
medium
ssl.key.password The password of the private key in the key store file. This is optional for client.

存儲在密鑰文件中私有密鑰。這個是可選的
password null
medium
ssl.keymanager.algorithm 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連接的算法。 默認值是爲Java虛擬機配置的密鑰管理器工廠算法。
string SunX509
medium
ssl.keystore.location The location of the key store file. This is optional for client and can be used for two-way authentication for client.

密鑰文件路徑。這個是可選的
string null
medium
ssl.keystore.password The store password for the key store file. This is optional for client and only needed if ssl.keystore.location is configured.

密鑰文件的密碼。對於客戶端來說是可選的,只有當ssl.keystore.location配置時纔有用。
password null
medium
ssl.keystore.type The file format of the key store file. This is optional for client.

密鑰文件的文件格式。對客戶端來說是可選的。
string JKS
medium
ssl.protocol 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.

生成SSLContext的SSL協議。默認配置時TLS,適用於大部分情況。最近JVMS支持的協議包括:TLS,TLSv1.1,TLSv1.2.
SSL,SSLv2,SSLv3在老版本的JVMS中可用,但是由於知名的安全漏洞,它們並不受歡迎。
string TLS
medium
ssl.provider The name of the security provider used for SSL connections. Default value is the default security provider of the JVM.

SSL鏈接安全提供者名字。默認是JVM
string null
medium
ssl.trustmanager.algorithm 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鏈接信任管理者工廠的算法。默認時JVM支持的算法。
string PKIX
medium
ssl.truststore.location The location of the trust store file.

信任文件的路徑
string null
medium
ssl.truststore.password The password for the trust store file.

信任文件的密碼
password null
medium
ssl.truststore.type The file format of the trust store file.

信任文件的格式
string JKS
medium
authorizer.class.name The authorizer class that should be used for authorization

用於授權的授權類名
string ""
low
metric.reporters A list of classes to use as metrics reporters. Implementing the MetricReporter interface allows plugging in classes that will be notified of new metric creation. The JmxReporter is always included to register JMX statistics.

用作度量報告器的類的列表。 實現MetricReporter接口允許插入將被通知新度量標準創建的類。 總是包括JmxReporter以註冊JMX統計信息。

[]   low  
metrics.num.samples The number of samples maintained to compute metrics.

維持計算度量的樣本數
int 2 [1,...] low
metrics.sample.window.ms The window of time a metrics sample is computed over.

度量樣本的計算的時長
long 30000 [1,...] low
quota.window.num The number of samples to retain in memory for client quotas

在內存中爲客戶端配額保存的樣本個數。
int 11 [1,...] low
quota.window.size.seconds The time span of each sample for client quotas


客戶端配額的每個樣本的時間跨度
int 1 [1,...] low
replication.quota.window.num The number of samples to retain in memory for replication quotas

要在備份配額的內存中保留的樣本數
int 11 [1,...] low
replication.quota.window.size.seconds The time span of each sample for replication quotas
備份配額的每個樣本的時間跨度
int 1 [1,...] low
ssl.endpoint.identification.algorithm The endpoint identification algorithm to validate server hostname using server certificate.

端點標識算法,使用服務器證書驗證服務器主機名。
string null
low
ssl.secure.random.implementation The SecureRandom PRNG implementation to use for SSL cryptography operations.

用於SSL加密操作的SecureRandom PRNG實現。
string null
low
zookeeper.sync.time.ms How far a ZK follower can be behind a ZK leader

zk follower落後zk leader的時間
int 2000   low


More details about broker configuration can be found in the scala class kafka.server.KafkaConfig.

Topic-level configuration Configurations pertinent to topics have both a server default as well an optional per-topic override. If no per-topic configuration is given the server default is used. The override can be set at topic creation time by giving one or more --config options. This example creates a topic named my-topic with a custom max message size and flush rate:
   > bin/kafka-topics.sh --zookeeper localhost:2181 --create --topic my-topic --partitions 1
          --replication-factor 1 --config max.message.bytes=64000 --config flush.messages=1
  
更多有關broker 配置信息可以在scala類kafka.server.KafkaConfig中找到。

Topic-level配置中有關topics的配置既可以使用server級別的默認配置,也可以針對每個topic自己的配置。如果沒有給定topic級別的配置,則默認使用server級別的。在topic創建時可以指定一個或者多個個性的配置以覆蓋server級別的默認配置,具體方法是通過--config選項。以下爲創建一個名爲my-topic的topic,個性化配置最大消息尺寸和回刷磁盤速率爲:

> bin/kafka-topics.sh --zookeeper localhost:2181 --create --topic my-topic --partitions 1

          --replication-factor 1 --config max.message.bytes=64000 --config flush.messages=1


Overrides can also be changed or set later using the alter configs command. This example updates the max message size for my-topic:
   > bin/kafka-configs.sh --zookeeper localhost:2181 --entity-type topics --entity-name my-topic --alter --add-config max.message.bytes=128000

這些個性化設置也可以通過alter配置命令進行移除。例如更新my-topic的最大消息:

> bin/kafka-configs.sh --zookeeper localhost:2181 --entity-type topics --entity-name my-topic --alter --add-config max.message.bytes=128000


To check overrides set on the topic you can do

   > bin/kafka-configs.sh --zookeeper localhost:2181 --entity-type topics --entity-name my-topic --describe
可以通過以下命令檢查topic配置:

> bin/kafka-configs.sh --zookeeper localhost:2181 --entity-type topics --entity-name my-topic --describe


To remove an override you can do

   > bin/kafka-configs.sh --zookeeper localhost:2181  --entity-type topics --entity-name my-topic --alter --delete-config max.message.bytes
  
可以通過以下命令移除個性化配置:

> bin/kafka-configs.sh --zookeeper localhost:2181  --entity-type topics --entity-name my-topic --alter --delete-config max.message.bytes
  



The following are the topic-level configurations. The server's default configuration for this property is given under the Server Default Property heading. A given server default config value only applies to a topic if it does not have an explicit topic config override.

以下是topic級別的配置。每個選項的server級別的默認配置在前面server配置表中已經給出。如果某個topic級別已經顯式設定,則server級別的默認值不在起作用。

NAME DESCRIPTION TYPE DEFAULT VALID VALUES SERVER DEFAULT PROPERTY IMPORTANCE
cleanup.policy

A string that is either "delete" or "compact". This string designates the retention policy to use on old log segments. The default policy ("delete") will discard old segments when their retention time or size limit has been reached. The "compact" setting will enable log compaction on the topic.


使用字符串表示,要麼是“delete”要麼是“compact”;此值表明了針對老日誌的清除策略。默認策略是刪除,即丟棄過期日誌,一旦刪除時間或者尺寸限制到了就會執行。“compact”設置會壓縮待刪除日誌。

list [delete] [compact, delete] log.cleanup.policy medium
compression.type

Specify the final compression type for a given topic. This configuration accepts the standard compression codecs ('gzip', 'snappy', lz4). It additionally accepts 'uncompressed' which is equivalent to no compression; and 'producer' which means retain the original compression codec set by the producer.


指定某個topic的消息的壓縮格式。此配置接受標準化壓縮編碼器(‘gzip',’snappy',lz4)。也接受非壓縮模式。’producer'意味着壓縮編碼器由producer設置。

string producer [uncompressed, snappy, lz4, gzip, producer] compression.type medium
delete.retention.ms

The amount of time to retain delete tombstone markers for log compacted topics. This setting also gives a bound on the time in which a consumer must complete a read if they begin from offset 0 to ensure that they get a valid snapshot of the final stage (otherwise delete tombstones may be collected before they complete their scan)


對進行日誌壓縮的topics保存刪除標記的時間長度.此設置給出了consumer必須從0開始閱讀消息的時間區間,在此區間內,consumer可以閱讀正確的消息快照,否則刪除標記到了之後消息有可能已經刪除,consumer也就無法獲取正確的消息了。

long 86400000 [0,...] log.cleaner.delete.retention.ms medium
file.delete.delay.ms

The time to wait before deleting a file from the filesystem


從文件系統中刪除前的等待時間

long 60000 [0,...] log.segment.delete.delay.ms medium
flush.messages

This setting allows specifying an interval at which we will force an fsync of data written to the log. For example if this was set to 1 we would fsync after every message; if it were 5 we would fsync after every five messages. In general we recommend you not set this and use replication for durability and allow the operating system's background flush capabilities as it is more efficient. This setting can be overridden on a per-topic basis (see the per-topic configuration section).


broker強制將消息回刷到磁盤日誌文件的消息條數間隔。例如,如果設置爲1,則每來一條消息都需要立刻寫入磁盤。如果設置爲5,則每來5條消息就會回刷消息進磁盤。一般來說,建議你不要更改這個值來確保消息可用性,而是使用備份機制提高消息可用性,允許操作系統的後臺回刷能力更有效。這個設置可以是topic級別的。

long 9223372036854775807 [0,...] log.flush.interval.messages medium
flush.ms

This setting allows specifying a time interval at which we will force an fsync of data written to the log. For example if this was set to 1000 we would fsync after 1000 ms had passed. In general we recommend you not set this and use replication for durability and allow the operating system's background flush capabilities as it is more efficient.


強制broker將消息回刷到磁盤日誌的時間間隔。例如,如果設置爲1000,即每隔1000ms,回刷一次。一般來說,不建議你通過更改這個值來提供消息可用性,而是允許操作系統後臺回刷能力,這樣效率更高

long 9223372036854775807 [0,...] log.flush.interval.ms medium
follower.replication.throttled.replicas

A list of replicas for which log replication should be throttled on the follower side. The list should describe a set of replicas in the form [PartitionId]:[BrokerId],[PartitionId]:[BrokerId]:... or alternatively the wildcard '*' can be used to throttle all replicas for this topic.


在follower端進行限制的日誌備份的備份列表。此表通過一個備份的集合展示:[PartitionId]:[BrokerId],[PartitionId]:[BrokerId]:... 或者是通配符‘*’,可以用來限制topic的所有備份

list [] kafka.server.ThrottledReplicaListValidator$@59d57c39 follower.replication.throttled.replicas medium
index.interval.bytes

This setting controls how frequently Kafka adds an index entry to it's offset index. The default setting ensures that we index a message roughly every 4096 bytes. More indexing allows reads to jump closer to the exact position in the log but makes the index larger. You probably don't need to change this


kafka向offset索引添加條目的頻率。默認設置保證我們妹4096個字節對一條消息進行加索引。索引越多,在跳轉時越容易跳轉到正確的位置,但是也會增大索引的空間。一般不需要改變這個值

int 4096 [0,...] log.index.interval.bytes medium
leader.replication.throttled.replicas

A list of replicas for which log replication should be throttled on the leader side. The list should describe a set of replicas in the form [PartitionId]:[BrokerId],[PartitionId]:[BrokerId]:... or alternatively the wildcard '*' can be used to throttle all replicas for this topic.


leader端進行限制的日誌備份的備份列表。這個列表可以通過一個集合來展示:[PartittionId]:[BrokerId],[PartitionId]:[BrokerId],....或者通過通配符‘*’來限制topic的所有的備份

list [] kafka.server.ThrottledReplicaListValidator$@59d57c39 leader.replication.throttled.replicas medium
max.message.bytes

This is largest message size Kafka will allow to be appended. Note that if you increase this size you must also increase your consumer's fetch size so they can fetch messages this large.


kafka broker可以追加的最大消息。注意,你可以提高這個值,與此同時,你也必須提高consumer可以消費的最大消息。

int 1000012 [0,...] message.max.bytes medium
message.format.version

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


指定broker可以追加的消息格式版本。此值應該是一個合法的APIVersion。一些例子如下:0.8.2,0.9.0.0,0.10.0,查看APIVersion可以獲取更多細節。通過設置特定的消息格式版本,用戶可以確認現存的消息格式版本都小於或者等於此版本號。設置不正確可能導致consumer無法解析消息。

string 0.10.1-IV2   log.message.format.version medium
message.timestamp.difference.max.ms

The maximum difference allowed between the timestamp when a broker receives a message and the timestamp specified in the message. If message.timestamp.type=CreateTime, a message will be rejected if the difference in timestamp exceeds this threshold. This configuration is ignored if message.timestamp.type=LogAppendTime


broker收到消息的時間戳和消息中指定的時間戳之間的最大差值。如果message.timestamp.type=CreateTime,如果這個差值大於此配置的話,消息會被拒收。如果message.timestamp.type=LogAppendTIme,則此配置會被忽略

long 9223372036854775807 [0,...] log.message.timestamp.difference.max.ms medium
message.timestamp.type

Define whether the timestamp in the message is message create time or log append time. The value should be either `CreateTime` or `LogAppendTime`


設定消息中的時間戳是創建時間還是日誌追加時間。合法設置爲‘CreateTime’或者‘LogAppendTime'

string CreateTime   log.message.timestamp.type medium
min.cleanable.dirty.ratio

This configuration controls how frequently the log compactor will attempt to clean the log (assuminglog compaction is enabled). By default we will avoid cleaning a log where more than 50% of the log has been compacted. This ratio bounds the maximum space wasted in the log by duplicates (at 50% at most 50% of the log could be duplicates). A higher ratio will mean fewer, more efficient cleanings but will mean more wasted space in the log.


控制壓縮器清除日誌的頻率(假定採用壓縮機制)。more 情況下,如果超過50%的日誌已經被壓縮了,就暫時不用清除。這個比例控制日誌浪費空間的大小(當壓縮比例爲50%時,最多浪費50%的空間)。此值越大,則清除效率越高,但是可能浪費更多空間。

double 0.5 [0,...,1] log.cleaner.min.cleanable.ratio medium
min.compaction.lag.ms

The minimum time a message will remain uncompacted in the log. Only applicable for logs that are being compacted


保留爲壓縮日誌的最短時間。只有日誌壓縮時才起作用

long 0 [0,...] log.cleaner.min.compaction.lag.ms medium
min.insync.replicas When a producer sets acks to "all" (or "-1"), min.insync.replicas specifies the minimum number of replicas that must acknowledge a write for the write to be considered successful. If this minimum cannot be met, then the producer will raise an exception (either NotEnoughReplicas or NotEnoughReplicasAfterAppend).

When used together, min.insync.replicas and acks allow you to enforce greater durability guarantees. A typical scenario would be to create a topic with a replication factor of 3, set min.insync.replicas to 2, and produce with acks of "all". This will ensure that the producer raises an exception if a majority of replicas do not receive a write.


當producer設置acks爲‘all’或者‘-1’,min.insync.replicas指定備份的最小值:即一次寫入需要多少個備份確認寫入時才能被認爲寫入成功。如果沒有達到這個最小值,則producer可能會出現異常(或者是NoEnoughReplicas或者是NotEnoughReplicasAfterAppend)。

當min.insync.replicas和acks一塊使用時,可以提高可用性保證。典型的用法是備份數設置爲3,min.insync.replicas設置爲2,producer的‘acks’設置爲‘all’,這樣將保證producer在沒有收到大多數備份成功寫入消息時會拋出異常。

int 1 [1,...] min.insync.replicas medium
preallocate

Should pre allocate file when create new segment?


是否預分配新日誌文件

boolean false   log.preallocate medium
retention.bytes

This configuration controls the maximum size a log can grow to before we will discard old log segments to free up space if we are using the "delete" retention policy. By default there is no size limit only a time limit.


日誌刪除之前的最大字節數。默認情況下沒有尺寸限制

long -1   log.retention.bytes medium
retention.ms

This configuration controls the maximum time we will retain a log before we will discard old log segments to free up space if we are using the "delete" retention policy. This represents an SLA on how soon consumers must read their data


日誌刪除之前保存的最長時間。

long 604800000   log.retention.ms medium
segment.bytes

This configuration controls the segment file size for the log. Retention and cleaning is always done a file at a time so a larger segment size means fewer files but less granular control over retention


每個日誌文件的最大字節數。刪除和清除一般是在單個日誌文件上展開的,如果日誌文件越大,雖然可以減少文件數目,但是刪除方面無法精確控制。

int 1073741824 [14,...] log.segment.bytes medium
segment.index.bytes

This configuration controls the size of the index that maps offsets to file positions. We preallocate this index file and shrink it only after log rolls. You generally should not need to change this setting


有關offsets和文件中位置的映射文件。一般是預分配這個文件,所以在存儲目錄中會發現無論何時,存儲offsets和文件中位置的索引文件總是爲10m。一般不需要更改這個文件。

int 10485760 [0,...] log.index.size.max.bytes medium
segment.jitter.ms

The maximum random jitter subtracted from the scheduled segment roll time to avoid thundering herds of segment rolling


控制日誌滾動時間時允許出現的最大隨機抖動時間,這是因爲日誌滾動沒有辦法精確控制,因爲涉及到檢查日誌滾動有時間間隔以及刪除日誌的原因。

long 0 [0,...] log.roll.jitter.ms medium
segment.ms

This configuration controls the period of time after which Kafka will force the log to roll even if the segment file isn't full to ensure that retention can delete or compact old data


日誌滾動的時間間隔,即使日誌大小沒有達到日誌滾動時的大小限制。這個有利於過期日誌刪除以及日誌壓縮。

long 604800000 [0,...] log.roll.ms medium
unclean.leader.election.enable

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


指明是否允許不在ISR中的備份節點是否允許被選爲leader節點,當然這樣有可能造成日誌丟失

boolean true   unclean.leader.election.enable medium


發佈了130 篇原創文章 · 獲贊 40 · 訪問量 82萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章