Skip to content

Latest commit

 

History

History
197 lines (151 loc) · 11.4 KB

README.md

File metadata and controls

197 lines (151 loc) · 11.4 KB

Docker compose environment for VictoriaMetrics

Docker compose environment for VictoriaLogs includes VictoriaLogs components, Alertmanager and Grafana.

For starting the docker-compose environment ensure that you have docker installed and running, and that you have access to the Internet. All commands should be executed from the root directory of the VictoriaLogs repo.

vmagent

vmagent is used for scraping and pushing time series to VictoriaMetrics instance. It accepts Prometheus-compatible configuration with listed targets for scraping:

Web interface link is http://localhost:8429/.

VictoriaLogs server

To spin-up single-node VictoriaLogs run the following command:

make docker-vl-single-up

See compose-vl-single.yml

VictoriaLogs is available at http://localhost:9428. In addition to VictoriaLogs server, the docker compose contains the following components:

  • vector service for collecting docker logs and sending them to VictoriaLogs;
  • VictoriaMetrics single-node to collect metrics from all the components;
  • Grafana is configured with VictoriaLogs datasource.
  • vmauth proxies select queries to VictoriaLogs;
  • vmalert is configured to query VictoriaLogs single-node, and send alerts state and recording rules results to VictoriaMetrics single-node;
  • alertmanager is configured to receive notifications from vmalert.
VictoriaLogs single-server deployment

Grafana is available at http://localhost:3000. Use admin username and admin password for logging in into Grafana.

To access VictoriaLogs UI use link http://localhost:8427/select/vmui/.

Please, also see how to monitor VictoriaLogs installations.

To shutdown environment execute the following command:

make docker-vl-single-down

See troubleshooting in case if issues.

VictoriaLogs cluster

To spin-up VictoriaLogs cluster run the following command:

make docker-vl-cluster-up

See compose-vl-cluster.yml

VictoriaLogs cluster environment consists of vlinsert, vlstorage and vlselect components. vlinsert and vlselect are available through vmauth at http://localhost:8427. For example, vector pushes logs via http://localhost:8427/insert/elasticsearch/ path, and Grafana queries http://localhost:8427 for datasource queries.

In addition to VictoriaLogs cluster, the docker compose contains the following components:

  • vector service for collecting docker logs and sending them to vlinsert;
  • Grafana is configured with VictoriaLogs datasource and pointing to vmauth.
  • VictoriaMetrics single-node to collect metrics from all the components;
  • vlinsert fo sending the ingested logs to vlstorage;
  • vlselect for querying vlstorage;
  • vmauth balances incoming read and write requests among vlselects and vlinserts;
  • vmalert is configured to query vlselects, and send alerts state and recording rules results to VictoriaMetrics single-node;
  • alertmanager is configured to receive notifications from vmalert.
VictoriaLogs cluster deployment

Grafana is available at http://localhost:3000. Use admin username and admin password for logging in into Grafana.

To access VictoriaLogs UI use link http://localhost:8427/select/vmui/.

Please, also see how to monitor VictoriaLogs installations.

To shutdown environment execute the following command:

make docker-vl-cluster-down

See troubleshooting in case if issues.

Please see more examples on integration of VictoriaLogs with other log shippers below:

Common components

vmauth

vmauth acts as a load balancer to spread the load across vlselect nodes. Grafana and vmalert use vmauth for read queries. vmauth routes read queries to VictoriaLogs depending on requested path. See vmauth config for VictoriaLogs single-server and for VictoriaLogs cluster.

vmalert

vmalert evaluates these alerting rules. It queries VictoriaLogs and sends alerts to AlertManager. It also stores alerting state to VictoriaMetrics.

vmalert is available at http://localhost:8880/.

alertmanager

AlertManager accepts notifications from vmalert and fires alerts. All notifications are blackholed according to alertmanager.yml config.

AlertManager is available at http://localhost:9093/.

Grafana

Grafana is available at http://localhost:3000.

Default credentials:

  • login: admin
  • password: admin

Grafana is provisioned with default dashboards and datasources.

Alerts

See below a list of recommended alerting rules for VictoriaLogs components for running in production. Some alerting rules thresholds are just recommendations and could require an adjustment. The list of alerting rules is the following:

Please, also see how to monitor VictoriaLogs installations.

Troubleshooting

This environment has the following requirements:

Containers are started in --detach mode, meaning they run in the background. As a result, you won't see their logs or exit status directly in the terminal.

If something isn’t working as expected, try the following troubleshooting steps:

  1. Run from the correct directory. Make sure you're running the command from the root of the VictoriaLogs repository.
  2. Check container status. Run docker ps -a to list all containers and their status. Healthy and running containers should have STATUS set to Up.
  3. View container logs. To inspect logs for a specific container, get its container ID from step p2 and run: docker logs -f <containerID>.
  4. Read the logs carefully and follow any suggested actions.
  5. Check for port conflicts. Some containers (e.g., Grafana) expose HTTP ports. If a port (like :3000) is already in use, the container may fail to start. Stop the conflicting process or change the exposed port in the Docker Compose file.
  6. Shut down the deployment. To tear down the environment, run: make <environment>-down (i.e. make docker-vl-single-down). Note, this command also removes all attached volumes, so all the temporary created data will be removed too (i.e. Grafana dashboards or collected metrics).