Jeff

0 声望

这家伙太懒,什么都没留下

个人动态
  • 【爰』 贬了 在 kafka 发送消息报错:LEADER_NOT_AVAILABLE 的评论!

    只要增加

    advertised.listeners=PLAINTEXT://服务器外网ip:9092

    这项配置,就会上面的错误

    3年前
  • 半兽人 回复 Jeffkafka 发送消息报错:LEADER_NOT_AVAILABLE 中 :

    麻烦了,简单点用域名吧,配host就行了。

    5年前
  • Jeff 回复 半兽人kafka 发送消息报错:LEADER_NOT_AVAILABLE 中 :

    在服务器上用命令收发消息都正常的。命令:

    ./kafka-console-consumer.sh --bootstrap-server 172.17.108.105:9092 --topic testq --from-beginning

    刚看到springboot工程启动日志,kafka服务返回的地址是:172.17.108.105:9092。说明,kafka服务返回的地址是个内网地址,所有连接不上。怎样才能返回外网连接的地址?

    [Consumer clientId=consumer-4, groupId=testq] Group coordinator 172.17.108.105:9092 (id: 2147483647 rack: null) is unavailable or invalid, will attempt rediscovery

    5年前
  • 半兽人 回复 Jeffkafka 发送消息报错:LEADER_NOT_AVAILABLE 中 :

    先用命令进行生产和发送,看看集群是否正常。

    5年前
  • Jeff 回复 半兽人kafka 发送消息报错:LEADER_NOT_AVAILABLE 中 :

    按spring的文档,kafka_2.11-2.1.0 可以使用spring-kafka:1.0.2 的版本,所以应该不是版本的问题。

    服务启动日志看:先报了下面的错误,

    [Consumer clientId=consumer-10, groupId=testq] Error while fetching metadata with correlation id 2 : {testq=LEADER_NOT_AVAILABLE}

    之后就周期报下面的错误:

    10:03:40.851 [org.springframework.kafka.KafkaListenerEndpointContainer#0-7-C-1] WARN o.apache.kafka.clients.NetworkClient :
    [Consumer clientId=consumer-8, groupId=testq] Connection to node 0 could not be established. Broker may not be available.
    10:03:40.885 [org.springframework.kafka.KafkaListenerEndpointContainer#0-3-C-1] WARN o.apache.kafka.clients.NetworkClient :
    [Consumer clientId=consumer-4, groupId=testq] Connection to node 0 could not be established. Broker may not be available.
    10:03:41.089 [org.springframework.kafka.KafkaListenerEndpointContainer#0-6-C-1] WARN o.apache.kafka.clients.NetworkClient :
    [Consumer clientId=consumer-7, groupId=testq] Connection to node 0 could not be established. Broker may not be available.
    10:03:41.416 [org.springframework.kafka.KafkaListenerEndpointContainer#0-1-C-1] WARN o.apache.kafka.clients.NetworkClient :
    [Consumer clientId=consumer-2, groupId=testq] Connection to node 0 could not be established. Broker may not be available.

    5年前