docker kafka
时间: 2023-08-26 08:18:46 浏览: 175
Docker Kafka提供了一种方便的方法来在Docker容器中运行Kafka。您可以通过以下步骤启动Docker Kafka:
1. 首先,您需要下载并运行Zookeeper镜像。可以使用以下命令下载镜像:
```
docker pull wurstmeister/zookeeper
```
然后,使用以下命令启动Zookeeper容器:
```
docker run -d --name zookeeper -p 2181:2181 -t wurstmeister/zookeeper
```
2. 接下来,您需要下载并运行Kafka镜像。使用以下命令下载镜像:
```
docker pull wurstmeister/kafka
```
然后,使用以下命令启动Kafka容器:
```
docker run -d --name kafka --publish 9092:9092 --link zookeeper:zookeeper -e KAFKA_BROKER_ID=1 -e HOST_IP=192.168.65.7 -e KAFKA_ZOOKEEPER_CONNECT=zookeeper:2181 -e KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://192.168.65.7:9092 -e KAFKA_ADVERTISED_HOST_NAME=192.168.65.7 -e KAFKA_ADVERTISED_PORT=9082 --restart=always -t wurstmeister/kafka
```
另外,如果您想使用Kafka Manager来查看Kafka中的信息,您可以按照以下步骤操作:
1. 下载并运行Kafka Manager容器。使用以下命令下载镜像:
```
docker pull sheepkiller/kafka-manager
```
然后,使用以下命令启动Kafka Manager容器:
```
docker run --name kafka-manager -d --network app-tier -p 9000:9000 -e ZK_HOSTS="zookeeper-server:2181" sheepkiller/kafka-manager
```
请注意,以上命令中的IP地址和端口可能需要根据您的环境和配置进行相应的更改。希望这些信息对您有所帮助!<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [docker上启动kafka](https://blog.csdn.net/XIAOHUI_ID/article/details/122662020)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [Docker安装Kafka教程(超详细)](https://blog.csdn.net/y393016244/article/details/126405864)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [Docker安装kafka简单步骤](https://blog.csdn.net/q2422442709/article/details/128193826)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]
阅读全文