I'm using kafka 0.8.2, I want to use the fetch and commit offset API, as the document said:
The offsets for a given consumer group are maintained by a specific broker called the offset coordinator. i.e., a consumer needs to issue its offset commit and fetch requests to this specific broker. It can discover the current offset coordinator by issuing a consumer metadata request
So I send a ConsumerMetadataRequest
, instead of getting the correct response, I'm always get ConsumerCoordinatorNotAvailableCode
The broker returns this error code for consumer metadata requests or offset commit requests if the offsets topic has not yet been created.
If I use the kafka 0.8.2beta version, which doesn't have the issue.
Also I use the go client sarama, I have create the __consumer_offsets
topic before fetch metadata. And here is my config:
broker.id=1
port=9091
host.name=192.168.33.10
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=data/9091
num.partitions=1
num.recovery.threads.per.data.dir=1
log.retention.hours=168
log.segment.bytes=1073741824
log.retention.check.interval.ms=300000
log.cleaner.enable=false
zookeeper.connect=localhost:2181
zookeeper.connection.timeout.ms=6000