Kafka代理抛出ConfigException无效值配置log.segment.bytes:不是INT类型的数量

时间:2018-02-19 17:29:22

标签: java apache-kafka

我有一个单节点kafka代理和单节点zookeeper,server.properties如下所示

broker.id=0
num.network.threads=3
num.io.threads=8
socket.send.buffer.bytes=102400
socket.receive.buffer.bytes=102400
socket.request.max.bytes=104857600
log.dirs=/tmp/kafka-logs
num.partitions=1
num.recovery.threads.per.data.dir=1
log.retention.hours=168
log.retention.check.interval.ms=300000
zookeeper.connect=localhost:2181
zookeeper.connection.timeout.ms=6000
num.network.threads=20
log.roll.hours=24
log.retention.bytes=107374182400
listeners=PLAINTEXT://172.36.0.72:9092
log.segment.bytes=10737418240
advertised.listeners=PLAINTEXT://172.36.0.72:9092

zookeeper.properties如下所示

dataDir=/tmp/zookeeper
clientPort=2181
maxClientCnxns=0

但是每当我启动经纪人时,我都会遇到如下的异常

FATAL [2018-02-19 17:01:10,772] kafka.Kafka$:[Logging$class:fatal:113] - [main] -
org.apache.kafka.common.config.ConfigException: Invalid value 10737418240 for configuration log.segment.bytes: Not a number of type INT
        at org.apache.kafka.common.config.ConfigDef.parseType(ConfigDef.java:670)
        at org.apache.kafka.common.config.ConfigDef.parse(ConfigDef.java:418)
        at org.apache.kafka.common.config.AbstractConfig.<init>(AbstractConfig.java:55)
        at kafka.server.KafkaConfig.<init>(KafkaConfig.scala:759)
        at kafka.server.KafkaConfig$.fromProps(KafkaConfig.scala:743)
        at kafka.server.KafkaConfig$.fromProps(KafkaConfig.scala:740)
        at kafka.server.KafkaServerStartable$.fromProps(KafkaServerStartable.scala:28)
        at kafka.Kafka$.main(Kafka.scala:58)
        at kafka.Kafka.main(Kafka.scala)

在Ubuntu 14上运行Kafka Server 0.10.1。

有人能让我知道出了什么问题吗?

1 个答案:

答案 0 :(得分:1)

here所述,Int.MaxInt的值为2147483647。 10737418240正在超过允许的最大值。