返回到文章

采纳

编辑于 4年前

kafka启动失败,查询日志报Socket server failed to bind to 192.168.3.72:9192: Address not available

kafka

通过docker-compose启动kafka配置信息如下

version: "2"
services:
  zookeeper:
    image: wurstmeister/zookeeper:latest
    ports:
      - "3181:2181"
    network_mode: "bridge"
  kafka:
    image: wurstmeister/kafka:2.12-2.2.0
    ports:
      - "9192:9192"
    environment:
      KAFKA_LISTENERS: PLAINTEXT://192.111.1.1:9192
      KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
      KAFKA_DELETE_TOPIC_ENABLE: "true"
    network_mode: "bridge"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    links:
      - zookeeper

查看docker日志报错:

ERROR [KafkaServer id=1008] Fatal error during KafkaServer startup. Prepare to shutdown (kafka.server.KafkaServer)
kafka_1 | org.apache.kafka.common.KafkaException: Socket server failed to bind to 192.111.1.1:9192: Address not available

前几天我发的是broker创建失败,我删除了好几遍容器、还卸载过镜像和docker重装,最后还是不行,然后我就升级啦kafka的版本,所有地址用

KAFKA_LISTENERS: PLAINTEXT://192.111.1.1:9192

但是配置后,kafka启动失败 博主能不能给看下 让kafka搞得没脾气了