How to install Kafka on Windows?

前端 未结 11 1909
無奈伤痛
無奈伤痛 2020-12-02 09:27

I\'m trying to install Kafka message queue on Windows for testing purposes (not for production).

I found this article on how to install Apache Kafka

11条回答
  •  借酒劲吻你
    2020-12-02 09:49

    With Chocolatey and Powershell:

    1. chocolatey.exe install kafka -> installs Kafka into C:\ProgramData\chocolatey\lib\kafka\tools\kafka_2.11-1.0.0\ - your version might differ of course
    2. add C:\ProgramData\chocolatey\lib\kafka\tools\kafka_2.11-1.0.0\ to your powershell path using notepad $PROFILE

    After restarting powershell kafka-console-consumer should work as a command.

    You also need to install ssl.properties with keystore and truststore. Put them e.g. into C:\ProgramData\kafka and put that into ssl.properties (please note the escaping of the backslashes):

    security.protocol=SSL
    
    ssl.truststore.location=C:\\ProgramData\\kafka\\kafka-truststore.jks
    ssl.truststore.password=PASSWORD
    
    ssl.keystore.location=C:\\ProgramData\\kafka\\kafka-keystore.jks
    ssl.keystore.password=PASSWORD
    ssl.key.password=PASSWORD
    
    client.id=console-test
    

    Now things like kafka-consumer-groups --bootstrap-server SERVERNAME:9094 --command-config C:\ProgramData\kafka\ssl.properties --list should first pop up a firewall warning which you'd need to accept and then output a list of groups.

提交回复
热议问题