Unable to set-up Kafka cluster in the - Event Streaming with Kafka course

Hello everyone, I’m taking the “Event Streaming with Kafka” course and in the demo for setting up a Kafka cluster and Kafka UI using Docker, I couldn’t go pass the second step. IE. after I created the the network and I tried to pull the docker image with this command below, I got a docker: Invalid Reference error. This is the command that generated the error below:

docker run --rm -d \ 
--network kafka-net \ 
-p 2181:2181 \ 
-p 3030:3030 \ 
-p 9092:9092 \ 
-p 8081:8081 \ 
-p 8082:8082 \ 
-e ADV_HOST=kafak-cluster \ 
--name kafka-cluster \ 
lensesio/fast-data-dev

Please, how can I resolve this issue? Thanks for any help in advance.

To help us find this exact lecture, could you please include a link to the lecture i question? With that information, one of us can give it a look for you.

Hello sir, thanks a lot for your swift response, I really appreciate it. This is a link to the lecture - https://learn.kodekloud.com/user/courses/event-streaming-with-kafka/module/2359e80d-66f6-4080-8e9c-d81a6a1600fe/lesson/745d2f7b-c59f-441c-9203-554e09cb90b4

I’m not sure where this repo he’s using is from, but I got your command to run as long as I ran “docker network create kafka-network” first. So that would be my guess – the network needs to exist before the command will run.

Hello sir, thanks once more for your swift response. I’ve already created the network and I ran the command again but it still didn’t work. I used Gemini to check what the error could be and it suggested that the backslash (\) could be the reason why the command isn’t working because Docker might be reading the space after each backslash as End-Of-Line and the commands after each backslash is seen as an invalid command. Gemini stated that this could be the issue if I copied and pasted the command from a Window’s text based editor, which I did. So, running the command without backslash worked - docker run --rm -d --network kafka-net -p 2181:2181 -p 3030:3030 -p 9092:9092 -p 8081:8081 -p 8082:8082 -e ADV_HOST=kafka-cluster --name kafka-cluster lensesio/fast-data-dev Thanks a lot for your help sir.

Yeah, the \ as continuation character MUST be the last thing on the line – any spaces after will prevent it from working correctly. I copied your code when I tested it, and did indeed find that there were extra spaces at EOL. When I removed them, the container launched.

Okay sir, thanks a lot.