Turns out, Zipkin, when run "simply" with something like docker run openzipkin/zipkin:latest
, dies out of OOM very soon,
under any meaningful load. To prevent this from happening, one would want to run it together with a storage backend, like Elasticsearch
.
Unfortunately, Zipkin docs are probably hopelessly outdated, at least, I could not achieve this based on their README alone.
Create this docker-compose.yaml
:
version: "3.9"
services:
zipkin-elasticsearch:
image: ghcr.io/openzipkin/zipkin-elasticsearch7
networks:
- backend
ports:
- "9200:9200"
zipkin:
image: openzipkin/zipkin:latest
networks:
- backend
ports:
- "9411:9411"
environment:
JAVA_OPTS: -XX:+ExitOnOutOfMemoryError
links:
- "zipkin-elasticsearch:storage"
command:
- --zipkin.storage.type=elasticsearch
- --zipkin.storage.elasticsearch.hosts=storage
depends_on:
- zipkin-elasticsearch
networks:
backend:
and then you can run it with docker compose up -d
, as usual
Beware! In order for an Elasticsearch to get started successfully, a following hack needs to be applied on the "docker-desktop" VM: vm.max_map_count
system property must be not less than 262144.
On Windows 10 with WSL2-backed Docker Desktop, you can do it as follows:
wsl -d docker-desktop (shell terminal opens)
sysctl -w vm.max_map_count=262144
This will set the value until next reboot. If you want to apply it statically, refer to here: https://stackoverflow.com/questions/69214301/using-docker-desktop-for-windows-how-can-sysctl-parameters-be-configured-to-per