gpt4 book ai didi

apache-kafka - Jaeger/Opentracing 与 Kafka 和 docker compose

转载 作者:行者123 更新时间:2023-12-04 08:44:36 26 4
gpt4 key购买 nike

我只能找到在 Kafka 中使用 opentracing/jaeger 的旧的和不完整的例子。我想在本地运行一个示例作为概念证明 - opentracing spans to kafka。
我设法让其中的一些工作,但在 jeager-query我不断得到的服务:

"msg":"Failed to init storage factory","error":"kafka: client has run out of available brokers to talk to (Is your cluster reachable?)"
我不确定是否也需要使用某种存储,即 cassandra?
version: '3.8'

services:

zookeeper:
image: confluentinc/cp-zookeeper
networks:
- kafka-net
container_name: zookeeper
environment:
- ZOOKEEPER_CLIENT_PORT=2181
ports:
- 2181:2181

kafka:
image: confluentinc/cp-kafka
networks:
- kafka-net
container_name: kafka
environment:
- KAFKA_ZOOKEEPER_CONNECT=zookeeper:2181
- KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR=1
- ALLOW_PLAINTEXT_LISTENER=yes
- KAFKA_LISTENERS-INTERNAL://kafka:29092,EXTERNAL://localhost:9092
- KAFKA_ADVERTISED=INTERNAL://kafka:29092,EXTERNAL://localhost:9092
- KAFKA_ADVERTISED_LISTENERS=INTERNAL://kafka:29092,EXTERNAL://localhost:9092
- KAFKA_LISTENER_SECURITY_PROTOCOL_MAP=INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT
- KAFKA_INTER_BROKER_LISTENER_NAME=INTERNAL
ports:
- 9092:9092
depends_on:
- zookeeper
restart: on-failure

jaeger-collector:
image: jaegertracing/jaeger-collector
container_name: jaeger-collector
networks:
- kafka-net
ports:
- "14250:14250"
# - "14267:14267"
- "14268:14268" # HTTP collector port to receive spans
- "14269:14269" # HTTP health check port
restart: on-failure
environment:
LOG_LEVEL: "debug"
SPAN_STORAGE_TYPE: "kafka"
KAFKA_TOPIC: "somekafkatag"
KAFKA_BROKERS: "kafka:9092"
KAFKA_PRODUCER_BROKERS: "kafka:29092"

jaeger-agent:
image: jaegertracing/jaeger-agent
container_name: jaeger-agent
networks:
- kafka-net
command: ["--reporter.grpc.host-port=jaeger-collector:14250"]
ports:
- "5775:5775/udp"
- "6831:6831/udp"
- "6832:6832/udp"
- "5778:5778"
environment:
LOG_LEVEL: "debug"
SPAN_STORAGE_TYPE: "kafka"
restart: on-failure
depends_on:
- jaeger-collector

jaeger-ingester:
image: jaegertracing/jaeger-ingester
container_name: jaeger-ingester
networks:
- kafka-net
ports:
- "14270:14270" # HTTP health check port: http://localhost:14270/
- "14271:14271" # Metrics port: http://localhost:14271/metrics
restart: on-failure
command: ["--kafka.producer.brokers=kafka:9092"]
environment:
LOG_LEVEL: "debug"
INGESTER_PARALLELISM: "1"
INGESTER_DEADLOCKINTERVAL: "0ms"
SPAN_STORAGE_TYPE: "kafka"
KAFKA_CONSUMER_BROKERS: "kafka:9092"
METRICS_BACKEND: "expvar"
KAFKA_BROKERS: "kafka:29092"

jaeger-query:
image: jaegertracing/jaeger-query
container_name: jaeger-query
networks:
- kafka-net
ports:
- "16686:16686" # Jaeger UI port
- "16687:16687" # HTTP health check port: http://localhost:16687/
restart: on-failure
environment:
LOG_LEVEL: "debug"
SPAN_STORAGE_TYPE: "kafka"
KAFKA_CONSUMER_BROKERS: "kafka:9092"
KAFKA_BROKERS: "kafka:29092"

networks:
kafka-net:
driver: bridge

最佳答案

可以看到 jaeger-query 配置包括: SPAN_STORAGE_TYPE: "kafka"
该错误表示jaeger-query用于在Kafka中存储span的kafka客户端实际上无法到达Kafka,因此jaeger存储工厂无法初始化。
这可能是因为 Kafka 无法启动(您是否检查过)?或者 docker 中的网络配置错误。

关于apache-kafka - Jaeger/Opentracing 与 Kafka 和 docker compose,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64391505/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com