This guide uses Docker to run tcollector.
For Docker installation, see Docker.
tcollector does not have an official Docker image. You’ll need to build a custom image from source.
Create a directory to store your configuration and compose files.
mkdir -p /opt/tcollector
cd /opt/tcollector
Create a Dockerfile to build tcollector from source:
FROM python:3.9-slim
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
RUN git clone https://github.com/OpenTSDB/tcollector.git /opt/tcollector
WORKDIR /opt/tcollector
ENV OPENSTDB_HOST=opentsdb
ENV OPENSTDB_PORT=4242
CMD ["./startstop", "foreground"]
Define a container for tcollector.
services:
tcollector:
build: .
hostname: "${HOSTNAME}"
volumes:
- ./tcollector.conf:/opt/tcollector/etc/tcollector.conf:ro
- /proc:/host/proc:ro
- /sys:/host/sys:ro
environment:
- OPENSTDB_HOST=opentsdb
- OPENSTDB_PORT=4242
networks:
- monitoring
networks:
monitoring:
driver: bridge
Build the image and start the container.
docker compose build
docker compose up -d
4242/tcpAny questions?
Feel free to contact us. Find all contact information on our contact page.