Install Vector on Docker
Docker is an open platform for developing, shipping, and running applications and services. Docker enables you to separate your services from your infrastructure so you can ship quickly. With Docker, you can manage your infrastructure in the same ways you manage your services. By taking advantage of Docker's methodologies for shipping, testing, and deploying code quickly, you can significantly reduce the delay between writing code and running it in production. This page will cover installing and managing Vector on the Docker platform.
Install
- Agent Role
- Sidecar Role
- Aggregator Role
The agent role is designed to collect all Docker data on
a single host. Vector runs in its own container
interfacing with the Docker Engine API
for log via the docker_logs
source and
metrics via the host_metrics
source,
but it is recommended to adjust your pipeline as
necessary using Vector's sources,
transforms, and
sinks.
Configure Vector
cat <<-'VECTORCFG' > ~/vector.toml# Vector's API for introspection[api]enabled = trueaddress = "127.0.0.1:8686"# Host-level logs[sources.logs]type = "docker_logs"# --> Add transforms here to parse, enrich, and process data# print all events, replace this with your desired sink(s)# https://vector.dev/docs/reference/sinks/[sinks.out]type = "console"inputs = [ "logs" ]encoding.codec = "json"VECTORCFGStart Vector
docker run \-d \-v ~/vector.toml:/etc/vector/vector.toml:ro \-p 8383:8383 \timberio/vector:0.11.X-debianObserve Vector
- Logs
- Metrics
docker logs -f $(docker ps -aqf "name=vector")explain this command
Deployment
Vector is an end-to-end observability data platform designed to deploy under various roles. You mix and match these roles to create topologies. The intent is to make Vector as flexible as possible, allowing you to fluidly integrate Vector into your infrastructure over time. The deployment section demonstrates common Vector pipelines:
Administration
Start
docker run \-d \-v ~/vector.toml:/etc/vector/vector.toml:ro \-p 8383:8383 \timberio/vector:0.11.X-debian
Stop
docker stop timberio/vector
Reload
docker kill --signal=HUP timberio/vector
Restart
docker restart -f $(docker ps -aqf "name=vector")
Observe
- Logs
- Metrics
docker logs -f $(docker ps -aqf "name=vector")
Uninstall
docker rm timberio/vector timberio/vector