卓越飞翔博客卓越飞翔博客

卓越飞翔 - 您值得收藏的技术分享站
技术文章34092本站已运行391

jaeger-all-in-one docker-compose.yaml 配置用于将跟踪存储到 postgresql

jaeger-all-in-one docker-compose.yaml 配置用于将跟踪存储到 postgresql

问题内容

目前,我使用 docker-compose.yaml 文件和 Collector-gateway.yaml 文件作为 otel 收集器,将跟踪信息发送给 jaeger。我想要实现的是使用 postgresql 实现数据持久化,并且我正在尝试使用这个 github repo:text。但是,在使用 docker-compose up 启动 docker 容器时,我不断遇到此错误。

错误日志:

jaeger-postgresql-jaeger-all-in-one-1  | {"level":"fatal","ts":1696996008.1216166,"caller":"./main.go:110","msg":"Failed to init storage factory","error":"grpc-plugin builder failed to create a store: error attempting to connect to plugin rpc client: fork/exec /etc/cmd/jaeger-pg-store: exec format error","stacktrace":"main.main.func1nt./main.go:110ngithub.com/spf13/cobra.(*Command).executentgithub.com/spf13/[email protected]/command.go:940ngithub.com/spf13/cobra.(*Command).ExecuteCntgithub.com/spf13/[email protected]/command.go:1068ngithub.com/spf13/cobra.(*Command).Executentgithub.com/spf13/[email protected]/command.go:992nmain.mainnt./main.go:243nruntime.mainntruntime/proc.go:267"}

有关我的代码的更多上下文 docker-compose.yaml:

version: "3"
services:
  # Jaeger
  jaeger-all-in-one:
    image: jaegertracing/all-in-one:latest
    ports:
      - "16686:16686"
      - "14268"
      - "14250"
    environment:
      - SPAN_STORAGE_TYPE=grpc-plugin
      - COLLECTOR_OTLP_ENABLED=true
    volumes:
      - ./jaeger-pg-store:/etc/cmd/jaeger-pg-store
      - ./collector-gateway.yaml:/etc/collector-gateway.yaml
    command: ["--grpc-storage-plugin.binary=/etc/cmd/jaeger-pg-store", "--grpc-storage-plugin.configuration-file=/etc/collector-gateway.yaml"]
    
  # Collector
  collector-gateway:
    image: otel/opentelemetry-collector-contrib:0.53.0
    volumes:
      - ./collector-gateway.yaml:/etc/collector-gateway.yaml
      - ./jaeger-pg-store:/etc/cmd
    command: [ "--config=/etc/collector-gateway.yaml"]
    ports:
      - "1888:1888"   # pprof extension
      - "13133:13133" # health_check extension
      - "4317:4317"        # OTLP gRPC receiver
      - "4318:4318"        # OTLP HTTP receiver
      - "55670:55679" # zpages extension
    depends_on:
      - jaeger-all-in-one
    links:
      - jaeger-all-in-one

自从我在 mac 系统上使用以来,我尝试使用 CGO_ENABLED=0 GOARCH=amd64 GOOS=darwin 构建 jaeger-plugin-store 。总的来说,我还是比较新的。

奇怪的是,当我按照自述文件中的正常说明进行操作时,该说明从二进制文件中将 jaeger-all-in-one 作为可执行文件运行,而不是通过 docker-compose 运行,它可以工作,但无法检测到我的 postgres 数据库。但是,我最好想用我的 docker-compose 文件来运行它。


正确答案


相关错误是

fork/exec /etc/cmd/jaeger-pg-store: exec format error

这表明二进制格式不兼容。当您在 Docker 容器中运行时,您的二进制文件具有与本地计算机不同的操作系统视图,即您使用的 Docker 映像是为 Linux 构建的,但您试图将其指向为 MacOS 构建的插件二进制文件。您还需要为 Linux 构建插件二进制文件。

卓越飞翔博客
上一篇: 表单变量在测试中不可用
下一篇: 返回列表
留言与评论(共有 0 条评论)
   
验证码:
隐藏边栏