.net core &引用;处理组件pubsub错误:5s后超过组件pubsub的初始化超时;

.net core &引用;处理组件pubsub错误:5s后超过组件pubsub的初始化超时;,.net-core,apache-kafka,microservices,publish-subscribe,dapr,.net Core,Apache Kafka,Microservices,Publish Subscribe,Dapr,我在.net核心微服务中使用DAPR,Docker。 我在docker-compose.yml中进行了以下配置,以运行broker和dapr pubsub配置 PUBSUB.yml apiVersion: dapr.io/v1alpha1 kind: Component metadata: name: pubsub namespace: default spec: type: pubsub.kafka version: v1 metadata: # Kafka b

我在.net核心微服务中使用DAPR,Docker。 我在docker-compose.yml中进行了以下配置,以运行broker和dapr pubsub配置

PUBSUB.yml

apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
  name: pubsub
  namespace: default
spec:
  type: pubsub.kafka
  version: v1
  metadata:
      # Kafka broker connection setting
    - name: brokers
      value: local:9092
    - name: authRequired
      value: "false"
    - name: maxMessageBytes
      value: 1024
和Dockercompose.yml

  zookeeper:
     image: confluentinc/cp-zookeeper:6.1.1
     ports:
      - "2181:2181"
     environment:
      ZOOKEEPER_CLIENT_PORT: 2181
  broker:
    image: confluentinc/cp-kafka:6.1.1
    hostname: broker
    container_name: broker
    depends_on:
      - zookeeper
    ports:
      - "29092:29092"
      - "9092:9092"
      - "9101:9101"
      - "9090:9090"
    environment:
      KAFKA_BROKER_ID: 1
      KAFKA_ZOOKEEPER_CONNECT: 'zookeeper:2181'
      KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
      KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://broker:29092,PLAINTEXT_HOST://localhost:9092
      KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
      KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
      KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
      KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0
      KAFKA_JMX_PORT: 9101
      KAFKA_JMX_HOSTNAME: localhost
我的dapr车在本地环境中没有得到初始化,其抛出错误如下

形象

错误:


time="2021-04-12T07:05:26.9278616Z" level=info msg="starting Dapr Runtime -- version 1.0.0 -- commit 6314733" app_id=monitoringapi instance=43a8c7996e98 scope=dapr.runtime type=log ver=1.0.0

time="2021-04-12T07:05:26.9282174Z" level=info msg="log level set to: info" app_id=monitoringapi instance=43a8c7996e98 scope=dapr.runtime type=log ver=1.0.0

time="2021-04-12T07:05:26.9317538Z" level=info msg="metrics server started on :9090/" app_id=monitoringapi instance=43a8c7996e98 scope=dapr.metrics type=log ver=1.0.0

time="2021-04-12T07:05:26.9339347Z" level=info msg="loading default configuration" app_id=monitoringapi instance=43a8c7996e98 scope=dapr.runtime type=log ver=1.0.0

time="2021-04-12T07:05:26.9349457Z" level=info msg="standalone mode configured" app_id=monitoringapi instance=43a8c7996e98 scope=dapr.runtime type=log ver=1.0.0

time="2021-04-12T07:05:26.9350359Z" level=info msg="app id: monitoringapi" app_id=monitoringapi instance=43a8c7996e98 scope=dapr.runtime type=log ver=1.0.0

time="2021-04-12T07:05:26.9354469Z" level=info msg="mTLS is disabled. Skipping certificate request and tls validation" app_id=monitoringapi instance=43a8c7996e98 scope=dapr.runtime type=log ver=1.0.0

time="2021-04-12T07:05:26.9384313Z" level=info msg="local service entry announced: monitoringapi -> 172.28.0.11:37301" app_id=monitoringapi instance=43a8c7996e98 scope=dapr.contrib type=log ver=1.0.0

time="2021-04-12T07:05:26.9385462Z" level=info msg="Initialized name resolution to standalone" app_id=monitoringapi instance=43a8c7996e98 scope=dapr.runtime type=log ver=1.0.0

time="2021-04-12T07:05:32.3047616Z" level=fatal msg="process component pubsub error: init timeout for component pubsub exceeded after 5s" app_id=monitoringapi instance=43a8c7996e98 scope=dapr.runtime type=log ver=1.0.0

请帮助我解决此问题

此问题在简单配置解决此问题后得到解决

嗨,伙计,我也有同样的问题。这个问题解决了吗?谢谢。问题的标题没有说明发生了什么。改变它,这样你就有更多的机会得到答案。它需要更加直观。