jaeger 使用ElasticSearch 作为后端存储

jaeger 支持es 作为后端存储,这样对于查询、以及系统扩展是比较方便的

使用docker-compose 运行

环境准备

参考项目: https://github.com/rongfengliang/nginx-opentracing-demo

  • docker-compose file
version: '3'
services:
  nginx:
    image: opentracing/nginx-opentracing
    networks:
      trivial_example:
        aliases:
          - nginx
    volumes:
      - ./nginx.conf:/etc/nginx/nginx.conf
      - ./jaeger-config.json:/etc/jaeger-config.json
    expose:
      - "8080"
    ports:
      - "8080:8080"
  elasticsearch:
   image: elasticsearch:5.6.12
   ulimits:
      memlock:
        soft: -1
        hard: -1
   ports:
    - 9200:9200
   volumes:
    - ./es-data:/usr/share/elasticsearch/data
   environment:
    - transport.host=0.0.0.0
    - http.cors.enabled=true
    - http.cors.allow-origin="*"
    - discovery.zen.minimum_master_nodes=1
   networks:
    trivial_example:
     aliases:
      - elasticsearch
  app-service:
    build:
      context: .
      dockerfile: ./Dockerfile
    networks:
      trivial_example:
        aliases:
          - app-service
    expose:
      - "9001"
    ports:
      - "9001:9001"
    command:
      - /app/server
      - -collector_host
      - jaeger
  deps:
    image: jaegertracing/spark-dependencies
    environment:
     - STORAGE=elasticsearch
     - ES_NODES=http://elasticsearch:9200
    networks:
      trivial_example:
        aliases:
          - deps
  jaeger:
    image: jaegertracing/all-in-one:1.7
    environment:
      - COLLECTOR_ZIPKIN_HTTP_PORT=9411
      - ES_SERVER_URLS=http://elasticsearch:9200
      - SPAN_STORAGE_TYPE=elasticsearch
      - ES_TAGS_AS_FIELDS=true
    networks:
      trivial_example:
        aliases:
          - jaeger
    expose:
      - "9411"
      - "16686"
    ports:
      - "9411:9411"
      - "16686:16686"
networks:
  trivial_example: {}
  • 说明
    主要是通过环境变量指定存储类型以及es 服务器集群的地址,注意对于依赖关系需要有一个单独的服务

启动&&测试

  • 启动
docker-compose up -d
  • 效果



说明

关于依赖的显示,需要使用spark-dependencies处理,参考docker-compose file
同时需要配置为定时任务

参考资料

https://www.jaegertracing.io/docs/1.7/architecture/
https://www.jaegertracing.io/docs/1.7/deployment/
https://github.com/rongfengliang/nginx-opentracing-demo
https://github.com/jaegertracing/jaeger/blob/master/plugin/storage/es/README.md
https://hub.docker.com/r/jaegertracing/spark-dependencies/
https://my.oschina.net/u/2548090/blog/1821372

posted on   荣锋亮  阅读(3942)  评论(0编辑  收藏  举报

编辑推荐:
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· .NET10 - 预览版1新功能体验(一)
历史上的今天:
2017-10-08 openfaas 架构介绍
2017-10-08 openfaas 简单试用
2017-10-08 openfaas cli 安装
2017-10-08 openfaas 安装(docker swarm 模式)
2017-10-08 openfaas 了解
2016-10-08 jsonpath
2016-10-08 java bean 转换工具

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示