docker-compose安装jaegertracing

基于docker-compose一键启动安装jaeger组件,es,zk及kafka

version: "3"

services:
  zk01:
    image: zookeeper:latest
    container_name: zk01
    restart: always
    hostname: zook1
    environment:
      - ZOO_MY_ID=1
      - "ZOO_SERVERS=server.1=zk01:2888:3888;2181 server.2=zk02:2888:3888;2181 server.3=zk03:2888:3888;2181"
    networks:
      - jaeger-net
      #jaeger-net:
      #  ipv4_address: 172.21.0.2
    ports:
      - 2181:2181
      - 2888:2881
      - 3888:3888
    volumes:
      - /Users/xxx/data/kafka-zk/zk1/conf:/opt/zookeeper-3.4.13/conf
      - /Users/xxx/data/kafka-zk/zk1/data:/opt/zookeeper-3.4.13/data
  zk02:
    image: zookeeper:latest
    container_name: zk02
    restart: always
    hostname: zook2
    environment:
      - ZOO_MY_ID=2
      - "ZOO_SERVERS=server.1=zk01:2888:3888;2181 server.2=zk02:2888:3888;2181 server.3=zk03:2888:3888;2181"
    networks:
      - jaeger-net
    ports:
      - 2182:2181
      - 2889:2881
      - 3889:3888
    volumes:
      - /Users/xxx/data/kafka-zk/zk2/conf:/opt/zookeeper-3.4.13/conf
      - /Users/xxx/data/kafka-zk/zk2/data:/opt/zookeeper-3.4.13/data
  zk03:
    image: zookeeper:latest
    container_name: zk03
    restart: always
    hostname: zook3
    environment:
      - ZOO_MY_ID=3
      - "ZOO_SERVERS=server.1=zk01:2888:3888;2181 server.2=zk02:2888:3888;2181 server.3=zk03:2888:3888;2181"
    networks:
      - jaeger-net
    ports:
      - 2183:2181
      - 2890:2881
      - 3890:3888
    volumes:
      - /Users/xxx/data/kafka-zk/zk3/conf:/opt/zookeeper-3.4.13/conf
      - /Users/xxx/data/kafka-zk/zk3/data:/opt/zookeeper-3.4.13/data
  kafka01:
    image: wurstmeister/kafka:latest
    container_name: kafka01
    restart: always
    hostname: kafka01
    environment:
     - KAFKA_BROKER_ID=1
     - KAFKA_ZOOKEEPER_CONNECT=zk01:2181,zk02:2181,zk03:2181
     - SKAFKA_ADVERTISED_LISTENERS=INSIDE://kafka01:9093,OUTSIDE://localhost:9193
     - KAFKA_LISTENERS=INSIDE://:9093,OUTSIDE://:9193
     - KAFKA_LISTENER_SECURITY_PROTOCOL_MAP=INSIDE:PLAINTEXT,OUTSIDE:PLAINTEXT
     - KAFKA_INTER_BROKER_LISTENER_NAME=INSIDE
     - KAFKA_HEAP_OPTS="-Xmx256m -Xms256m"
     - ALLOW_PLAINTEXT_LISTENER="yes"
    networks:
      - jaeger-net
    ports:
      - 9093:9093
      - 9193:9193
    volumes:
      - /Users/xxx/data/kafka-zk/zk1/conf:/opt/zookeeper-3.4.13/conf
      - /Users/xxx/data/kafka-zk/zk1/data:/opt/zookeeper-3.4.13/data
  kafka02:
    image: wurstmeister/kafka:latest
    container_name: kafka02
    restart: always
    hostname: kafka02
    environment:
     - KAFKA_BROKER_ID=2
     - KAFKA_ZOOKEEPER_CONNECT=zk01:2181,zk02:2181,zk03:2181
     - SKAFKA_ADVERTISED_LISTENERS=INSIDE://kafka02:9093,OUTSIDE://localhost:9193
     - KAFKA_LISTENERS=INSIDE://:9093,OUTSIDE://:9193
     - KAFKA_LISTENER_SECURITY_PROTOCOL_MAP=INSIDE:PLAINTEXT,OUTSIDE:PLAINTEXT
     - KAFKA_INTER_BROKER_LISTENER_NAME=INSIDE
     - KAFKA_HEAP_OPTS="-Xmx256m -Xms256m"
     - ALLOW_PLAINTEXT_LISTENER="yes"
    networks:
      - jaeger-net
    ports:
      - 9094:9093
      - 9194:9193
    volumes:
      - /Users/xxx/data/kafka-zk/zk2/conf:/opt/zookeeper-3.4.13/conf
      - /Users/xxx/data/kafka-zk/zk2/data:/opt/zookeeper-3.4.13/data
  kafka03:
    image: wurstmeister/kafka:latest
    container_name: kafka03
    restart: always
    hostname: kafka03
    environment:
     - KAFKA_BROKER_ID=3
     - KAFKA_ZOOKEEPER_CONNECT=zk01:2181,zk02:2181,zk03:2181
     - SKAFKA_ADVERTISED_LISTENERS=INSIDE://kafka03:9093,OUTSIDE://localhost:9193
     - KAFKA_LISTENERS=INSIDE://:9093,OUTSIDE://:9193
     - KAFKA_LISTENER_SECURITY_PROTOCOL_MAP=INSIDE:PLAINTEXT,OUTSIDE:PLAINTEXT
     - KAFKA_INTER_BROKER_LISTENER_NAME=INSIDE
     - KAFKA_HEAP_OPTS="-Xmx256m -Xms256m"
     - ALLOW_PLAINTEXT_LISTENER="yes"
    networks:
      - jaeger-net
    ports:
      - 9095:9093
      - 9195:9193
    volumes:
      - /Users/xxx/data/kafka-zk/zk3/conf:/opt/zookeeper-3.4.13/conf
      - /Users/xxx/data/kafka-zk/zk3/data:/opt/zookeeper-3.4.13/data
  es:
    image: elasticsearch:7.9.3
    container_name: es
    restart: always
    environment:
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    volumes:
      - /Users/xxx/data/es/config/es1.yml:/usr/share/elasticsearch/config/elasticsearch.yml
      - /Users/xxx/data/es/node1/logs:/usr/share/elasticsearch/logs
      - /Users/xxx/data/es/node1/data:/usr/share/elasticsearch/data
      - /Users/xxx/data/es/plugins:/usr/share/elasticsearch/plugins
    ports:
      - "9200:9200"
      - "9300:9300"
    networks:
      - jaeger-net
  kibana:
    image: kibana:7.9.3
    container_name: kibana
    restart: always
    environment:
      - SERVER_NAME=kibana
      - ELASTICSEARCH_HOSTS=http://es:9200
      - I18N_LOCALE=zh-CN
    volumes:
      - /Users/xxx/data/kibana/config/kibana.yml:/usr/share/kibana/config/kibana.yml
    ports:
     - "5601:5601"
    depends_on:
      - es
    networks:
     - jaeger-net
  headPlugin:
    image: mobz/elasticsearch-head:5
    container_name: head
    restart: always
    ports:
     - "9100:9100"
    networks:
     - jaeger-net
  collector:
    # 直连es
    image: jaegertracing/jaeger-collector:1.35
    container_name: collector
    restart: always
    environment:
      - SPAN_STORAGE_TYPE=elasticsearch
      - ES_ARCHIVE_SERVER_URLS=http://es:9200
      - ES_SERVER_URLS=http://es:9200
      - LOG_LEVEL=debug
    ulimits:
      memlock:
        soft: -1
        hard: -1
    networks:
      - jaeger-net
    ports:
      - "14269:14269"
      - "14268:14268"
      - "14267:14267"
      - "14250:14250"
      - "9411:9411"
    depends_on:
      - es
  collector-kfk-1:
    image: jaegertracing/jaeger-collector:1.35
    container_name: collector-kfk-1
    restart: always
    environment:
      - SPAN_STORAGE_TYPE=kafka
      - KAFKA_PRODUCER_BROKERS=kafka01:9093,kafka02:9093,kafka03:9093
      - KAFKA_TOPIC=jaeger-spans
      - LOG_LEVEL=debug
    ulimits:
      memlock:
        soft: -1
        hard: -1
    networks:
      - jaeger-net
    ports:
      - "14369:14269"
      - "14368:14268"
      - "14367:14267"
      - "14350:14250"
    depends_on:
      - kafka01
      - kafka02
      - kafka03
  collector-kfk-2:
    image: jaegertracing/jaeger-collector:1.35
    container_name: collector-kfk-2
    restart: always
    environment:
      - SPAN_STORAGE_TYPE=kafka
      - KAFKA_PRODUCER_BROKERS=kafka01:9093,kafka02:9093,kafka03:9093
      - KAFKA_TOPIC=jaeger-spans
    ulimits:
      memlock:
        soft: -1
        hard: -1
    networks:
      - jaeger-net
    ports:
      - "14169:14269"
      - "14168:14268"
      - "14167:14267"
      - "14150:14250"
    depends_on:
      - kafka01
      - kafka02
      - kafka03
  collector-kfk-3:
    image: jaegertracing/jaeger-collector:1.35
    container_name: collector-kfk-3
    restart: always
    environment:
      - SPAN_STORAGE_TYPE=kafka
      - KAFKA_PRODUCER_BROKERS=kafka01:9093,kafka02:9093,kafka03:9093
      - KAFKA_TOPIC=jaeger-spans
    ulimits:
      memlock:
        soft: -1
        hard: -1
    networks:
      - jaeger-net
    ports:
      - "14069:14269"
      - "14068:14268"
      - "14067:14267"
      - "14050:14250"
    depends_on:
      - kafka01
      - kafka02
      - kafka03

  ingester-kfk1:
    image: jaegertracing/jaeger-ingester:1.35
    container_name: ingester-kfk1
    restart: always
    environment:
      - SPAN_STORAGE_TYPE=elasticsearch
      - ES_SERVER_URLS=http://es:9200
      - LOG_LEVEL=debug
      - KAFKA_CONSUMER_BROKERS=kafka01:9093,kafka02:9093,kafka03:9093
      - KAFKA_CONSUMER_TOPIC=jaeger-spans
    ulimits:
      memlock:
        soft: -1
        hard: -1
    networks:
      - jaeger-net
    depends_on:
      - kafka01
      - kafka02
      - kafka03
      - es
  ingester-kfk2:
    image: jaegertracing/jaeger-ingester:1.35
    container_name: ingester-kfk2
    restart: always
    environment:
      - SPAN_STORAGE_TYPE=elasticsearch
      - ES_SERVER_URLS=http://es:9200
      - LOG_LEVEL=debug
      - KAFKA_CONSUMER_BROKERS=kafka01:9093,kafka02:9093,kafka03:9093
      - KAFKA_CONSUMER_TOPIC=jaeger-spans
    ulimits:
      memlock:
        soft: -1
        hard: -1
    depends_on:
      - kafka01
      - kafka02
      - kafka03
      - es
    networks:
      - jaeger-net
  ingester-kfk3:
    image: jaegertracing/jaeger-ingester:1.35
    container_name: ingester-kfk3
    restart: always
    environment:
      - SPAN_STORAGE_TYPE=elasticsearch
      - ES_SERVER_URLS=http://es:9200
      - LOG_LEVEL=debug
      - KAFKA_CONSUMER_BROKERS=kafka01:9093,kafka02:9093,kafka03:9093
      - KAFKA_CONSUMER_TOPIC=jaeger-spans
    ulimits:
      memlock:
        soft: -1
        hard: -1
    depends_on:
      - kafka01
      - kafka02
      - kafka03
      - es
    networks:
      - jaeger-net
  agent:
    image: jaegertracing/jaeger-agent:1.35
    container_name: agent
    restart: always
    environment:
      - REPORTER_GRPC_HOST_PORT=collector-kfk-1:14250,collector-kfk-2:14250,collector-kfk-3:14250
      - LOG_LEVEL=debug
    ulimits:
      memlock:
        soft: -1
        hard: -1
    ports:
      - "6831:6831/udp"
      - "6832:6832/udp"
      - "5778:5778/tcp"
      - "5775:5775/udp"
    networks:
      - jaeger-net
    depends_on:
      - collector-kfk-1
      - collector-kfk-2
      - collector-kfk-3
  query:
    image: jaegertracing/jaeger-query:1.35
    restart: always
    container_name: query
    environment:
      - SPAN_STORAGE_TYPE=elasticsearch
      - ES_SERVER_URLS=http://es:9200
      - LOG_LEVEL=debug
    ports:
      - 16685:16685
      - 16686:16686
      - 16687:16687
    networks:
      - jaeger-net
    depends_on:
      - es
volumes:
  esdata1:
    driver: local
  esdata2:
    driver: local
networks:
  jaeger-net:
  default:
    driver: jaeger-net
    ipam:
      driver: jaeger-net
      config:
        - subnet: 172.21.0.0/24


你可能感兴趣的:(jaeger,链路追踪,docker-compose,docker,kafka,elasticsearch,zookeeper)