springboot 消费 kafka sasl SCRAM 有问题

Shine 发表于: 2022-05-05   最后更新时间: 2022-05-06 15:32:15   79 游览

1、kafka 2.2.0版本 内网集群 设置了 SASL SCRAM 模式
2、springboot 2.6.3 版本消费 异常, 程序启动会报连不上broker
3、然后过一会儿就会开始消费,感觉不知道是kafka集群问题还是springboot问题

kafka配置如下
# The address the socket server listens on. It will get the value returned from 
# java.net.InetAddress.getCanonicalHostName() if not configured.
#   FORMAT:
#     listeners = listener_name://host_name:port
#   EXAMPLE:
#     listeners = PLAINTEXT://your.host.name:9092
listeners=SASL_PLAINTEXT://132.46.109.57:9092

# Hostname and port the broker will advertise to producers and consumers. If not set, 
# it uses the value for "listeners" if configured.  Otherwise, it will use the value
# returned from java.net.InetAddress.getCanonicalHostName().
#advertised.listeners=PLAINTEXT://your.host.name:9092
#advertised.listeners=SASL_PLAINTEXT://132.46.109.57:9092

security.inter.broker.protocol=SASL_PLAINTEXT
sasl.mechanism.inter.broker.protocol=SCRAM-SHA-256
sasl.enabled.mechanisms=SCRAM-SHA-256
allow.everyone.if.no.acl.found=false
authorizer.class.name=kafka.security.auth.SimpleAclAuthorizer

spring配置如下
spring:
  application:
    name: kafka
  kafka:
    bootstrap-servers: 132.46.109.57:9092,132.46.109.58:9092,132.46.109.59:9092 # kafka集群信息
    producer: # 生产者配置
      retries: 3 # 设置大于0的值,则客户端会将发送失败的记录重新发送
      batch-size: 16384 #16K
      buffer-memory: 33554432 #32M
      acks: 1
      # 指定消息key和消息体的编解码方式
      key-serializer: org.apache.kafka.common.serialization.StringSerializer
      value-serializer: org.apache.kafka.common.serialization.StringSerializer
    consumer:
      group-id: shine # 消费者组
      enable-auto-commit: false # 关闭自动提交
      auto-offset-reset: earliest # 当各分区下有已提交的offset时,从提交的offset开始消费;无提交的offset时,从头开始消费
      key-deserializer: org.apache.kafka.common.serialization.StringDeserializer
      value-deserializer: org.apache.kafka.common.serialization.StringDeserializer
      properties:
        sasl.mechanism: SCRAM-SHA-256
        security.protocol: SASL_PLAINTEXT
        sasl.jaas.config: org.apache.kafka.common.security.scram.ScramLoginModule required username="shine**" password="shine****";

sprinboot 报错如下
2022-05-05 22:40:00.788  INFO 27228 --- [  restartedMain] o.a.k.c.s.authenticator.AbstractLogin    : Successfully logged in.
2022-05-05 22:40:00.815  INFO 27228 --- [  restartedMain] o.a.kafka.common.utils.AppInfoParser     : Kafka version: 3.0.0
2022-05-05 22:40:00.816  INFO 27228 --- [  restartedMain] o.a.kafka.common.utils.AppInfoParser     : Kafka commitId: 8cb0a5e9d3441962
2022-05-05 22:40:00.816  INFO 27228 --- [  restartedMain] o.a.kafka.common.utils.AppInfoParser     : Kafka startTimeMs: 1651761600815
2022-05-05 22:40:00.817  INFO 27228 --- [  restartedMain] o.a.k.clients.consumer.KafkaConsumer     : [Consumer clientId=consumer-shine-1, groupId=shine] Subscribed to topic(s): fee_pay
2022-05-05 22:40:00.827  INFO 27228 --- [  restartedMain] c.e.kafkademo.KafkademoApplication       : Started KafkademoApplication in 0.764 seconds (JVM running for 1.713)
2022-05-05 22:40:10.265  WARN 27228 --- [ntainer#0-0-C-1] org.apache.kafka.clients.NetworkClient   : [Consumer clientId=consumer-shine-1, groupId=shine] Bootstrap broker 132.46.109.58:9092 (id: -2 rack: null) disconnected
2022-05-05 22:40:24.329  WARN 27228 --- [ntainer#0-0-C-1] org.apache.kafka.clients.NetworkClient   : [Consumer clientId=consumer-shine-1, groupId=shine] Bootstrap broker 132.46.109.59:9092 (id: -3 rack: null) disconnected
2022-05-05 22:40:33.532  INFO 27228 --- [ntainer#0-0-C-1] org.apache.kafka.clients.Metadata        : [Consumer clientId=consumer-shine-1, groupId=shine] Cluster ID: CQOJKmmlQHCUral2bo4CQA
2022-05-05 22:40:33.532  INFO 27228 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=consumer-shine-1, groupId=shine] Discovered group coordinator 132.46.109.59:9092 (id: 2147483645 rack: null)
2022-05-05 22:40:42.596  INFO 27228 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=consumer-shine-1, groupId=shine] (Re-)joining group
2022-05-05 22:40:42.683  INFO 27228 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=consumer-shine-1, groupId=shine] Request joining group due to: need to re-join with the given member-id
2022-05-05 22:40:42.684  INFO 27228 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=consumer-shine-1, groupId=shine] (Re-)joining group
2022-05-05 22:40:42.707  INFO 27228 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=consumer-shine-1, groupId=shine] Successfully joined group with generation Generation{generationId=29, memberId='consumer-shine-1-c76aa62a-0594-428b-954c-64b39ad62559', protocol='range'}
2022-05-05 22:40:42.709  INFO 27228 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=consumer-shine-1, groupId=shine] Finished assignment for group at generation 29: {consumer-shine-1-c76aa62a-0594-428b-954c-64b39ad62559=Assignment(partitions=[fee_pay-0, fee_pay-1, fee_pay-2, fee_pay-3, fee_pay-4, fee_pay-5])}
2022-05-05 22:40:42.721  INFO 27228 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=consumer-shine-1, groupId=shine] Successfully synced group in generation Generation{generationId=29, memberId='consumer-shine-1-c76aa62a-0594-428b-954c-64b39ad62559', protocol='range'}
2022-05-05 22:40:42.722  INFO 27228 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=consumer-shine-1, groupId=shine] Notifying assignor about the new Assignment(partitions=[fee_pay-0, fee_pay-1, fee_pay-2, fee_pay-3, fee_pay-4, fee_pay-5])
2022-05-05 22:40:42.723  INFO 27228 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=consumer-shine-1, groupId=shine] Adding newly assigned partitions: fee_pay-0, fee_pay-5, fee_pay-3, fee_pay-4, fee_pay-1, fee_pay-2
2022-05-05 22:40:42.736  INFO 27228 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=consumer-shine-1, groupId=shine] Found no committed offset for partition fee_pay-0
2022-05-05 22:40:42.736  INFO 27228 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=consumer-shine-1, groupId=shine] Found no committed offset for partition fee_pay-5
2022-05-05 22:40:42.736  INFO 27228 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=consumer-shine-1, groupId=shine] Found no committed offset for partition fee_pay-3
2022-05-05 22:40:42.736  INFO 27228 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=consumer-shine-1, groupId=shine] Found no committed offset for partition fee_pay-4
2022-05-05 22:40:42.736  INFO 27228 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=consumer-shine-1, groupId=shine] Found no committed offset for partition fee_pay-1
2022-05-05 22:40:42.736  INFO 27228 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=consumer-shine-1, groupId=shine] Found no committed offset for partition fee_pay-2
2022-05-05 22:41:40.337  INFO 27228 --- [-thread | shine] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=consumer-shine-1, groupId=shine] Group coordinator 132.46.109.59:9092 (id: 2147483645 rack: null) is unavailable or invalid due to cause: session timed out without receiving a heartbeat response.isDisconnected: false. Rediscovery will be attempted.
2022-05-05 22:41:40.343  INFO 27228 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=consumer-shine-1, groupId=shine] Attempt to heartbeat with Generation{generationId=29, memberId='consumer-shine-1-c76aa62a-0594-428b-954c-64b39ad62559', protocol='range'} and group instance id Optional.empty failed due to UNKNOWN_MEMBER_ID, resetting generation
2022-05-05 22:41:40.350  INFO 27228 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=consumer-shine-1, groupId=shine] Resetting generation due to: encountered UNKNOWN_MEMBER_ID from HEARTBEAT response
2022-05-05 22:41:40.351  INFO 27228 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=consumer-shine-1, groupId=shine] Request joining group due to: encountered UNKNOWN_MEMBER_ID from HEARTBEAT response
2022-05-05 22:41:58.550 ERROR 27228 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=consumer-shine-1, groupId=shine] User provided listener org.springframework.kafka.listener.KafkaMessageListenerContainer$ListenerConsumer$ListenerConsumerRebalanceListener failed on invocation of onPartitionsAssigned for partitions [fee_pay-0, fee_pay-5, fee_pay-3, fee_pay-4, fee_pay-1, fee_pay-2]

org.apache.kafka.common.errors.TimeoutException: Timeout of 60000ms expired before the position for partition fee_pay-0 could be determined

2022-05-05 22:41:58.552 ERROR 27228 --- [ntainer#0-0-C-1] o.s.k.l.KafkaMessageListenerContainer    : Consumer exception

java.lang.IllegalStateException: This error handler cannot process 'org.apache.kafka.common.errors.TimeoutException's; no record information is available
    at org.springframework.kafka.listener.DefaultErrorHandler.handleOtherException(DefaultErrorHandler.java:155) ~[spring-kafka-2.8.2.jar:2.8.2]
    at org.springframework.kafka.listener.KafkaMessageListenerContainer$ListenerConsumer.handleConsumerException(KafkaMessageListenerContainer.java:1762) [spring-kafka-2.8.2.jar:2.8.2]
    at org.springframework.kafka.listener.KafkaMessageListenerContainer$ListenerConsumer.run(KafkaMessageListenerContainer.java:1285) [spring-kafka-2.8.2.jar:2.8.2]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_321]
    at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266) [na:1.8.0_321]
    at java.util.concurrent.FutureTask.run(FutureTask.java) [na:1.8.0_321]
    at java.lang.Thread.run(Thread.java:750) [na:1.8.0_321]
Caused by: org.apache.kafka.common.errors.TimeoutException: Timeout of 60000ms expired before the position for partition fee_pay-0 could be determined

2022-05-05 22:41:58.657  INFO 27228 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.SubscriptionState    : [Consumer clientId=consumer-shine-1, groupId=shine] Resetting offset for partition fee_pay-4 to position FetchPosition{offset=0, offsetEpoch=Optional.empty, currentLeader=LeaderAndEpoch{leader=Optional[132.46.109.58:9092 (id: 1 rack: null)], epoch=absent}}.
2022-05-05 22:41:58.658  INFO 27228 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.SubscriptionState    : [Consumer clientId=consumer-shine-1, groupId=shine] Resetting offset for partition fee_pay-1 to position FetchPosition{offset=0, offsetEpoch=Optional.empty, currentLeader=LeaderAndEpoch{leader=Optional[132.46.109.58:9092 (id: 1 rack: null)], epoch=absent}}.
2022-05-05 22:41:58.658  INFO 27228 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=consumer-shine-1, groupId=shine] Discovered group coordinator 132.46.109.59:9092 (id: 2147483645 rack: null)
2022-05-05 22:42:07.708  INFO 27228 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=consumer-shine-1, groupId=shine] Giving away all assigned partitions as lost since generation has been reset,indicating that consumer is no longer part of the group
2022-05-05 22:42:07.709  INFO 27228 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=consumer-shine-1, groupId=shine] Lost previously assigned partitions fee_pay-0, fee_pay-5, fee_pay-3, fee_pay-4, fee_pay-1, fee_pay-2
2022-05-05 22:42:07.709  INFO 27228 --- [ntainer#0-0-C-1] o.s.k.l.KafkaMessageListenerContainer    : shine: partitions lost: [fee_pay-0, fee_pay-5, fee_pay-3, fee_pay-4, fee_pay-1, fee_pay-2]
2022-05-05 22:42:07.710  INFO 27228 --- [ntainer#0-0-C-1] o.s.k.l.KafkaMessageListenerContainer    : shine: partitions revoked: [fee_pay-0, fee_pay-5, fee_pay-3, fee_pay-4, fee_pay-1, fee_pay-2]
2022-05-05 22:42:07.710  INFO 27228 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=consumer-shine-1, groupId=shine] Resetting generation due to: rebalance failed since the generation/state was modified by heartbeat thread to Generation{generationId=-1, memberId='', protocol='null'}/UNJOINED before the rebalance callback triggered
2022-05-05 22:42:07.710  INFO 27228 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=consumer-shine-1, groupId=shine] Request joining group due to: rebalance failed since the generation/state was modified by heartbeat thread to Generation{generationId=-1, memberId='', protocol='null'}/UNJOINED before the rebalance callback triggered
2022-05-05 22:42:07.711  INFO 27228 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=consumer-shine-1, groupId=shine] Group coordinator 132.46.109.59:9092 (id: 2147483645 rack: null) is unavailable or invalid due to cause: coordinator unavailable.isDisconnected: true. Rediscovery will be attempted.
2022-05-05 22:42:07.733  INFO 27228 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=consumer-shine-1, groupId=shine] Discovered group coordinator 132.46.109.59:9092 (id: 2147483645 rack: null)
2022-05-05 22:42:07.733  INFO 27228 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=consumer-shine-1, groupId=shine] Group coordinator 132.46.109.59:9092 (id: 2147483645 rack: null) is unavailable or invalid due to cause: coordinator unavailable.isDisconnected: false. Rediscovery will be attempted.
2022-05-05 22:42:07.859  INFO 27228 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=consumer-shine-1, groupId=shine] Discovered group coordinator 132.46.109.59:9092 (id: 2147483645 rack: null)
2022-05-05 22:42:16.905  INFO 27228 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=consumer-shine-1, groupId=shine] (Re-)joining group
2022-05-05 22:42:17.022  INFO 27228 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=consumer-shine-1, groupId=shine] Request joining group due to: need to re-join with the given member-id
2022-05-05 22:42:17.023  INFO 27228 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=consumer-shine-1, groupId=shine] (Re-)joining group
2022-05-05 22:42:17.045  INFO 27228 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=consumer-shine-1, groupId=shine] Successfully joined group with generation Generation{generationId=31, memberId='consumer-shine-1-86749fd2-c4fb-4201-b2dc-688792091df6', protocol='range'}
2022-05-05 22:42:17.045  INFO 27228 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=consumer-shine-1, groupId=shine] Finished assignment for group at generation 31: {consumer-shine-1-86749fd2-c4fb-4201-b2dc-688792091df6=Assignment(partitions=[fee_pay-0, fee_pay-1, fee_pay-2, fee_pay-3, fee_pay-4, fee_pay-5])}
2022-05-05 22:42:17.075  INFO 27228 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=consumer-shine-1, groupId=shine] Successfully synced group in generation Generation{generationId=31, memberId='consumer-shine-1-86749fd2-c4fb-4201-b2dc-688792091df6', protocol='range'}
2022-05-05 22:42:17.076  INFO 27228 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=consumer-shine-1, groupId=shine] Notifying assignor about the new Assignment(partitions=[fee_pay-0, fee_pay-1, fee_pay-2, fee_pay-3, fee_pay-4, fee_pay-5])
2022-05-05 22:42:17.076  INFO 27228 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=consumer-shine-1, groupId=shine] Adding newly assigned partitions: fee_pay-0, fee_pay-5, fee_pay-3, fee_pay-4, fee_pay-1, fee_pay-2
2022-05-05 22:42:17.104  INFO 27228 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=consumer-shine-1, groupId=shine] Found no committed offset for partition fee_pay-0
2022-05-05 22:42:17.105  INFO 27228 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=consumer-shine-1, groupId=shine] Found no committed offset for partition fee_pay-5
2022-05-05 22:42:17.105  INFO 27228 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=consumer-shine-1, groupId=shine] Found no committed offset for partition fee_pay-3
2022-05-05 22:42:17.105  INFO 27228 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=consumer-shine-1, groupId=shine] Found no committed offset for partition fee_pay-4
2022-05-05 22:42:17.105  INFO 27228 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=consumer-shine-1, groupId=shine] Found no committed offset for partition fee_pay-1
2022-05-05 22:42:17.105  INFO 27228 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=consumer-shine-1, groupId=shine] Found no committed offset for partition fee_pay-2
2022-05-05 22:42:26.167  INFO 27228 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.SubscriptionState    : [Consumer clientId=consumer-shine-1, groupId=shine] Resetting offset for partition fee_pay-4 to position FetchPosition{offset=0, offsetEpoch=Optional.empty, currentLeader=LeaderAndEpoch{leader=Optional[132.46.109.58:9092 (id: 1 rack: null)], epoch=absent}}.
2022-05-05 22:42:26.167  INFO 27228 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.SubscriptionState    : [Consumer clientId=consumer-shine-1, groupId=shine] Resetting offset for partition fee_pay-1 to position FetchPosition{offset=0, offsetEpoch=Optional.empty, currentLeader=LeaderAndEpoch{leader=Optional[132.46.109.58:9092 (id: 1 rack: null)], epoch=absent}}.
2022-05-05 22:42:26.169  INFO 27228 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.SubscriptionState    : [Consumer clientId=consumer-shine-1, groupId=shine] Resetting offset for partition fee_pay-5 to position FetchPosition{offset=0, offsetEpoch=Optional.empty, currentLeader=LeaderAndEpoch{leader=Optional[132.46.109.57:9092 (id: 0 rack: null)], epoch=absent}}.
2022-05-05 22:42:26.169  INFO 27228 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.SubscriptionState    : [Consumer clientId=consumer-shine-1, groupId=shine] Resetting offset for partition fee_pay-2 to position FetchPosition{offset=0, offsetEpoch=Optional.empty, currentLeader=LeaderAndEpoch{leader=Optional[132.46.109.57:9092 (id: 0 rack: null)], epoch=absent}}.
2022-05-05 22:42:26.234  INFO 27228 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.SubscriptionState    : [Consumer clientId=consumer-shine-1, groupId=shine] Resetting offset for partition fee_pay-0 to position FetchPosition{offset=0, offsetEpoch=Optional.empty, currentLeader=LeaderAndEpoch{leader=Optional[132.46.109.59:9092 (id: 2 rack: null)], epoch=absent}}.
2022-05-05 22:42:26.235  INFO 27228 --- [ntainer#0-0-C-1] o.a.k.c.c.internals.SubscriptionState    : [Consumer clientId=consumer-shine-1, groupId=shine] Resetting offset for partition fee_pay-3 to position FetchPosition{offset=0, offsetEpoch=Optional.empty, currentLeader=LeaderAndEpoch{leader=Optional[132.46.109.59:9092 (id: 2 rack: null)], epoch=absent}}.
2022-05-05 22:42:26.235  INFO 27228 --- [ntainer#0-0-C-1] o.s.k.l.KafkaMessageListenerContainer    : shine: partitions assigned: [fee_pay-0, fee_pay-5, fee_pay-3, fee_pay-4, fee_pay-1, fee_pay-2]

后面就会有正常的kafka消息消费,感觉消费者启动正常消费好慢。
4、我更换好多springboot 版本和spring-kafka 版本,都不行,请大佬看下是什么问题。谢谢。

发表于 2022-05-05
¥1.0

dubug 发现日志 kafka Resolved host 132.46.109.58 as 132.46.109.58
配置 host文件 132.46.109.58 132.46.109.58 居然神奇的正常消费了。
为什么会把ip当成hostname ?

半兽人 -> Shine 11天前

认证都是基于域名的,所以也会把ip认为域名,你把主机名也配置好解析,也会解决这个问题的。

Shine -> 半兽人 11天前

不带SASL认证的都是直接写ip就行了吧?否则都是要配置host的对吗?

半兽人 -> Shine 11天前

是的,认证是domain,领域模型,所以你也会也要养成用域名的习惯。这样不管ip换不换,都不影响。

Shine -> 半兽人 11天前

谢谢大佬

你的答案

查看kafka相关的其他问题或提一个您自己的问题
提问