Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kafka image (0.10.1.0) not working if /data is mounted from a volume #57

Open
anuragw opened this issue Jun 1, 2018 · 0 comments
Open

Comments

@anuragw
Copy link

anuragw commented Jun 1, 2018

I'm encountering a strange issue with your docker image. Without using a volume for /data, everything works just fine - no issues for several months now.

However, as soon as I create my kafka container using a volume mounted on /data, kafka becomes unusable. Have you encountered this issue, or could you look into it?

Other images such as hbase/elasticsearch etc. (for which I also use volumes) work just fine, so its not a problem with Docker toolbox/VBox/permissions etc.

Steps to reproduce:
Create a container using (running this using VBox + git-bash + docker toolbox for windows:
docker run -d -p 9092:9092 --link zookeeper:zookeeper
-e "KAFKA_ADVERTISED_HOST_NAME=192.168.99.100" -e "KAFKA_DELETE_TOPIC_ENABLE=true" -e "KAFKA_HEAP_OPTS=-Xmx512m"
*-v /c/Users/"$USERNAME"/data/kafka:/data *
--name kafka ches/kafka:0.10.1.0

(Zookeeper previously started using:
docker run -d -p 2181:2181 -v /c/Users/"$USERNAME"/data/zookeeper:/data
--name zookeeper zookeeper)

Subsequently, create a topic named "mytopic".

Now, try to connect to kafka (I use http://www.kafkatool.com/). The client throws the error:
org.apache.kafka.common.errors.NotLeaderForPartitionException: This server is not the leader for that topic-partition.

Docker logs for kafka container show:
[2018-06-01 16:28:15,108] ERROR [KafkaApi-0] Error when handling request {controller_id=0,controller_epoch=1,partition_states=[{topic=mytopic,partition=0,controller_epoch=1,leader=0,leader_epoch=0,isr=[0],zk_version=0,replicas=[0]}],live_leaders=[{id=0,host=192.168.99.100,port=9092}]} (kafka.server.KafkaApis)
java.io.IOException: Invalid argument
at sun.nio.ch.FileChannelImpl.map0(Native Method)
...
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant