Skip to content

Quickstart - using docker compose

You can easily run the agents using docker compose. Be sure to have created a transport and an agent on Agoora. After the agent creation you have the possibility do download the docker-compose template. You will need to adapt it a bit to be able to connect to your transport.

Then just run using docker-compose up and you should be good to go.

Prerequisites

  • be able to run docker / docker-compose successfully (docker > 19.0, docker-compose > 1.25)
  • access to a transport (can be a Kafka cluster for example)
  • filled the blank in the docker-compose.yml file

Preparing the docker-compose file

The docker-compose file below is an example of what you will be able to download from Agoora. In this case it's for kafka.

Be sure to adapt the environment to your cluster.

version: '3.7'
services:
  kafka-agent:
    image: spoud/agoora-kafka-agent
    environment:
      - "AGOORA_PROFILER_ENDPOINT=agoora-profiler-service:8089"
      - "AGOORA_ENDPOINT=${AGOORA_ENDPOINT}"
      - "AGOORA_TRANSPORT_PATH=${AGOORA_AGENT_TRANSPORT_ABSOLUTE_PATH}"
      - "AGOORA_AUTH_USER_NAME=${AGOORA_AUTH_USER_NAME}"
      - "AGOORA_AUTH_USER_TOKEN=${AGOORA_AUTH_USER_TOKEN}"
      - "AGOORA_KAFKA_BOOTSTRAP_SERVERS=${AGOORA_KAFKA_BOOTSTRAP_SERVERS:-kafka-host:9092}"

  agoora-profiler-service:
    image: spoud/agoora-profiler-service

Run it

Simply run

docker-compose up

Troubleshoot

If there are warnings from the Kafka library in the agoora-kafka-agent component about not being able to connect to Kafka, please check the following:

  • don't use localhost as bootstrap servers because we're in docker (except you know what you're doing)
  • do you have access to Apache Kafka by kafkacat? Examples with AGOORA_KAFKA_BOOTSTRAP_SERVERS=192.168.1.23:9092:
  • for Kafka admin API, example: docker run -it --rm solsson/kafkacat kafkacat -b 192.168.1.23:9092 -L
  • for Kafka consumer API, example: docker run -it --rm solsson/kafkacat kafkacat -b 192.168.1.23:9092 -C -t test-010

If you can't figure out what's wrong, just get in touch with us via email or on GitHub.