我试图开始一些Kafka演示项目在我的机器MacOS Monterey ,苹果芯片。
下面是docker-compose
文件的内容:
version: '3.7'
services:
zookeeper:
container_name: demo-zookeeper
image: bitnami/zookeeper:3.4.14
ports:
- "2181:2181"
environment:
ALLOW_ANONYMOUS_LOGIN: 'yes'
kafka:
container_name: demo-kafka
image: wurstmeister/kafka:2.12-2.4.1
depends_on:
- zookeeper
ports:
- "9092:9092"
environment:
KAFKA_LISTENERS: PLAINTEXT://:9092
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://demo-kafka:9092
KAFKA_BROKER_ID: 1
KAFKA_PORT: 9092
KAFKA_ADVERTISED_PORT: 9092
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
但是,运行它会失败:
demo-zookeeper | Starting zookeeper ... STARTED
demo-kafka | [2022-08-13 18:15:21,133] INFO Opening socket connection to server zookeeper/172.18.0.2:2181. Will not attempt to authenticate using SASL (unknown error) (org.apache.zookeeper.ClientCnxn)
demo-kafka | [2022-08-13 18:15:21,134] INFO Socket error occurred: zookeeper/172.18.0.2:2181: Connection refused (org.apache.zookeeper.ClientCnxn)
demo-kafka | [2022-08-13 18:15:21,597] INFO [ZooKeeperClient Kafka server] Closing. (kafka.zookeeper.ZooKeeperClient)
demo-kafka | [2022-08-13 18:15:22,239] INFO Opening socket connection to server zookeeper/172.18.0.2:2181. Will not attempt to authenticate using SASL (unknown error) (org.apache.zookeeper.ClientCnxn)
demo-kafka | [2022-08-13 18:15:22,346] INFO Session: 0x0 closed (org.apache.zookeeper.ZooKeeper)
demo-kafka | [2022-08-13 18:15:22,347] INFO EventThread shut down for session: 0x0 (org.apache.zookeeper.ClientCnxn)
demo-kafka | [2022-08-13 18:15:22,348] INFO [ZooKeeperClient Kafka server] Closed. (kafka.zookeeper.ZooKeeperClient)
demo-kafka | [2022-08-13 18:15:22,350] ERROR Fatal error during KafkaServer startup. Prepare to shutdown (kafka.server.KafkaServer)
demo-kafka | kafka.zookeeper.ZooKeeperClientTimeoutException: Timed out waiting for connection while in state: CONNECTING
demo-kafka | at kafka.zookeeper.ZooKeeperClient.$anonfun$waitUntilConnected$3(ZooKeeperClient.scala:259)
demo-kafka | at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
demo-kafka | at kafka.utils.CoreUtils$.inLock(CoreUtils.scala:253)
demo-kafka | at kafka.zookeeper.ZooKeeperClient.waitUntilConnected(ZooKeeperClient.scala:255)
demo-kafka | at kafka.zookeeper.ZooKeeperClient.<init>(ZooKeeperClient.scala:113)
demo-kafka | at kafka.zk.KafkaZkClient$.apply(KafkaZkClient.scala:1858)
demo-kafka | at kafka.server.KafkaServer.createZkClient$1(KafkaServer.scala:375)
demo-kafka | at kafka.server.KafkaServer.initZkClient(KafkaServer.scala:399)
demo-kafka | at kafka.server.KafkaServer.startup(KafkaServer.scala:207)
demo-kafka | at kafka.server.KafkaServerStartable.startup(KafkaServerStartable.scala:44)
demo-kafka | at kafka.Kafka$.main(Kafka.scala:84)
demo-kafka | at kafka.Kafka.main(Kafka.scala)
demo-kafka | [2022-08-13 18:15:22,352] INFO shutting down (kafka.server.KafkaServer)
demo-kafka | [2022-08-13 18:15:22,356] INFO shut down completed (kafka.server.KafkaServer)
demo-kafka | [2022-08-13 18:15:22,356] ERROR Exiting Kafka. (kafka.server.KafkaServerStartable)
demo-kafka | [2022-08-13 18:15:22,358] INFO shutting down (kafka.server.KafkaServer)
demo-kafka exited with code 1
以下是at pastebin完整输出内容
"Kafka错过了什么“
1条答案
按热度按时间lzfw57am1#
据我所知,这些容器都不支持ARM/M1
相反,您可以使用支持ARM映像的Confluent映像7.2.0或更高版本