https://github.com/tix-factory/local-elk
Everything needed to run the ELK stack locally via docker.
https://github.com/tix-factory/local-elk
docker elk-stack grafana kafka nginx prometheus
Last synced: 3 months ago
JSON representation
Everything needed to run the ELK stack locally via docker.
- Host: GitHub
- URL: https://github.com/tix-factory/local-elk
- Owner: tix-factory
- License: cc0-1.0
- Created: 2022-09-17T17:09:57.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-10-23T23:50:39.000Z (over 3 years ago)
- Last Synced: 2025-03-30T23:41:29.242Z (over 1 year ago)
- Topics: docker, elk-stack, grafana, kafka, nginx, prometheus
- Language: JavaScript
- Homepage:
- Size: 37.1 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Local ELK
This repository contains everything you need to run a local single server architecture with visibility (logs, metrics, etc).
This repository was created with the intention of running all of this in docker on Windows.
## Application Stack
This is a list of all the applications you will run with this template, and their purposes:
- [ElasticSearch](https://www.elastic.co/elasticsearch/): Log storage
- [logstash](https://www.elastic.co/logstash/): Collect logs from docker containers
- [Kibana](https://www.elastic.co/kibana/): Logs visualizer
- [Grafana](https://grafana.com/): Charts
- [Prometheus](https://prometheus.io/): Metrics collection
- [nginx](https://www.nginx.com): HTTP Server
- [certbot](https://certbot.eff.org/): TLS certificate renewals
- [RabbitMQ](https://www.rabbitmq.com/): Message Queues
# Setup
## Prerequisites
1. Install [Docker Desktop](https://www.docker.com/products/docker-desktop)
2. Install [WSL2](https://aka.ms/wsl2kernel), and run `wsl --set-default-version 2`
3. Ensure `openssl` exists in the `PATH` environment variable (see: [stackoverflow](https://stackoverflow.com/a/51757939/1663648))
## Repository Setup
Commands are intended to be run in the cloned repository root.
1. Move the `.wslconfig` file to `%USERPROFILE%`, and run `wsl --shutdown`, then use Docker Desktop to restart WSL2, in the troubleshoot panel.
2. Run `docker network create tix-factory`
3. Run `[guid]::NewGuid().ToString() | Out-File -FilePath .\secrets\prometheus-bearer-token.txt -NoNewline -Encoding UTF8`
4. Run `docker-compose up -d`
5. Run `node index.js { email }` in the [http/certbot](./http/certbot) directory. Recommended to setup a recurring task for this one.
6. Save the password output by this command, it will be used to connect to kibana.
7. Run `docker-compose restart nginx`
## Kibana
Configure the index in kibana by going to `Stack Management` -> `Data Views`.
Create a data view for the `logstash-*` index to visualize the logs from all the docker containers.
## Grafana
Log into grafana (username: `admin`, password: `admin`), and set the email + username + password.
To add more hosts for prometheus to scrape for metrics, update the [prometheus.yml](./metrics/prometheus.yml) `targets`.