Why can't I run Kafka on an Azure virtual machine using port 80

%3CLINGO-SUB%20id%3D%22lingo-sub-1634611%22%20slang%3D%22en-US%22%3EWhy%20can't%20I%20run%20Kafka%20on%20an%20Azure%20virtual%20machine%20using%20port%2080%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1634611%22%20slang%3D%22en-US%22%3E%3CP%20class%3D%22p1%22%3E%26nbsp%3B%3C%2FP%3E%3CP%20class%3D%22p2%22%3EI%20would%20like%20to%20connect%20to%20Kafka%20using%20port%2080%20on%20my%20Azure%20virtual%20machine.%20I%20installed%20Java%20and%20Kafka%20on%20the%20virtual%20machine.%20I%20added%20inbound%20port%20rule%20for%20port%2080.%3C%2FP%3E%3CP%20class%3D%22p1%22%3E%26nbsp%3B%3C%2FP%3E%3CP%20class%3D%22p2%22%3EI%20added%20port%3D80%20to%20Kafka%E2%80%99s%20config%2Fserver.properties%20file.%20I%20ran%20zookeeper%20succesfully.%3C%2FP%3E%3CP%20class%3D%22p1%22%3E%26nbsp%3B%3C%2FP%3E%3CP%20class%3D%22p2%22%3EWhen%20I%20try%20to%20connect%20to%20kafka%20I%20get%20this%20error%3A%3C%2FP%3E%3CP%20class%3D%22p2%22%3EERROR%20%5BKafkaServer%20id%3D0%5D%20Fatal%20error%20during%20KafkaServer%20startup.%20Prepare%20to%20shutdown%20(kafka.server.KafkaServer)%3C%2FP%3E%3CP%20class%3D%22p2%22%3Eorg.apache.kafka.common.KafkaException%3A%20Socket%20server%20failed%20to%20bind%20to%200.0.0.0%3A80%3A%20Permission%20denied%3C%2FP%3E%3CP%20class%3D%22p1%22%3E%26nbsp%3B%3C%2FP%3E%3CP%20class%3D%22p1%22%3E%26nbsp%3B%3C%2FP%3E%3CP%20class%3D%22p2%22%3EI%20can%20connect%20to%20kafka%20using%20other%20ports%2C%20I%20tried%209092%2C%208000%2C%208080%2C%204430%3C%2FP%3E%3CP%20class%3D%22p1%22%3E%26nbsp%3B%3C%2FP%3E%3CP%20class%3D%22p2%22%3EBut%20I%20can%E2%80%99t%20connect%20to%20it%20using%20port%2080%20or%20443.%20The%20problem%20is%20I%20want%20to%20access%20Kafka%20using%20port%2080%20or%20443%20because%20I%20want%20to%20produce%20messages%20using%20a%20web%20server%20which%20is%20only%20allowed%20to%20use%20port%2080%20or%20443.%3C%2FP%3E%3CP%20class%3D%22p1%22%3E%26nbsp%3B%3C%2FP%3E%3CP%20class%3D%22p2%22%3EWhy%20can%E2%80%99t%20I%20connect%20to%20kafka%20using%20port%2080%20on%20an%20Azure%20virtual%20machine%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1638797%22%20slang%3D%22en-US%22%3ERe%3A%20Why%20can't%20I%20run%20Kafka%20on%20an%20Azure%20virtual%20machine%20using%20port%2080%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1638797%22%20slang%3D%22en-US%22%3EHi%3CBR%20%2F%3E%3CBR%20%2F%3EAre%20you%20running%20an%20Azure%20Web%20App%20%3F%3C%2FLINGO-BODY%3E
Highlighted
Occasional Visitor

 

I would like to connect to Kafka using port 80 on my Azure virtual machine. I installed Java and Kafka on the virtual machine. I added inbound port rule for port 80.

 

I added port=80 to Kafka’s config/server.properties file. I ran zookeeper succesfully.

 

When I try to connect to kafka I get this error:

ERROR [KafkaServer id=0] Fatal error during KafkaServer startup. Prepare to shutdown (kafka.server.KafkaServer)

org.apache.kafka.common.KafkaException: Socket server failed to bind to 0.0.0.0:80: Permission denied

 

 

I can connect to kafka using other ports, I tried 9092, 8000, 8080, 4430

 

But I can’t connect to it using port 80 or 443. The problem is I want to access Kafka using port 80 or 443 because I want to produce messages using a web server which is only allowed to use port 80 or 443.

 

Why can’t I connect to kafka using port 80 on an Azure virtual machine?

1 Reply
Highlighted
Hi

Are you running an Azure Web App ?