-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Jack Baldry <[email protected]>
- Loading branch information
Showing
4 changed files
with
139 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,23 @@ | ||
{ | ||
"title": "Loki Quickstart Demo", | ||
"description": "This sandbox provides an online enviroment for testing the Loki quickstart demo.", | ||
"details": { | ||
"intro": { | ||
"text": "intro.md" | ||
"title": "Loki Quickstart Demo", | ||
"description": "This sandbox provides an online enviroment for testing the Loki quickstart demo.", | ||
"details": { | ||
"intro": { | ||
"text": "intro.md" | ||
}, | ||
"steps": [ | ||
{ | ||
"text": "step1.md" | ||
}, | ||
"steps": [ | ||
{ | ||
"text": "step1.md" | ||
}, | ||
{ | ||
"text": "step2.md" | ||
} | ||
], | ||
"finish": { | ||
"text": "finished.md" | ||
{ | ||
"text": "step2.md" | ||
} | ||
], | ||
"finish": { | ||
"text": "finished.md" | ||
} | ||
, | ||
"backend": { | ||
"imageid": "ubuntu" | ||
} | ||
} | ||
}, | ||
"backend": { | ||
"imageid": "ubuntu" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,20 @@ | ||
![Loki Quickstart](../../assets/loki-ile.png) | ||
|
||
|
||
# Quickstart to run Loki locally | ||
|
||
If you want to experiment with Loki, you can run Loki locally using the Docker Compose file that ships with Loki. It runs Loki in a [monolithic deployment](https://grafana.com/docs/loki/latest/get-started/deployment-modes/#monolithic-mode) mode and includes a sample application to generate logs. | ||
If you want to experiment with Loki, you can run Loki locally using the Docker Compose file that ships with Loki. It runs Loki in a [monolithic deployment](https://grafana.com/docs/loki/<LOKI_VERSION>/get-started/deployment-modes/#monolithic-mode) mode and includes a sample application to generate logs. | ||
|
||
The Docker Compose configuration instantiates the following components, each in its own container: | ||
|
||
- **flog** a sample application which generates log lines. [flog](https://github.com/mingrammer/flog) is a log generator for common log formats. | ||
- **flog** a sample application which generates log lines. | ||
[flog](https://github.com/mingrammer/flog) is a log generator for common log formats. | ||
- **Grafana Alloy** which scrapes the log lines from flog, and pushes them to Loki through the gateway. | ||
- **Gateway** (NGINX) which receives requests and redirects them to the appropriate container based on the request's URL. | ||
- **Gateway** (nginx) which receives requests and redirects them to the appropriate container based on the request's URL. | ||
- One Loki **read** component (Query Frontend, Querier). | ||
- One Loki **write** component (Distributor, Ingester). | ||
- One Loki **backend** component (Index Gateway, Compactor, Ruler, Bloom Compactor (Experimental), Bloom Gateway (Experimental)). | ||
- **Minio** an S3-compatible object store which Loki uses to store its index and chunks. | ||
- **Grafana** which provides visualization of the log lines captured within Loki. | ||
|
||
![Loki Quickstart](https://grafana.com/media/docs/loki/get-started-flog-v3.png) | ||
{{< figure max-width="75%" src="/media/docs/loki/get-started-flog-v3.png" caption="Getting started sample application" alt="Getting started sample application">}} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,56 @@ | ||
|
||
# Step 1: Installing Loki and collecting sample logs | ||
|
||
## Install Loki and collecting sample logs | ||
|
||
|
||
|
||
**To install Loki locally, follow these steps:** | ||
|
||
1. Create a directory called `evaluate-loki` for the demo environment. Make `evaluate-loki` your current working directory: | ||
1. Create a directory called `evaluate-loki` for the demo environment. | ||
Make `evaluate-loki` your current working directory: | ||
|
||
```bash | ||
mkdir evaluate-loki | ||
cd evaluate-loki | ||
```{{execute}} | ||
```bash | ||
mkdir evaluate-loki | ||
cd evaluate-loki | ||
```{{execute}} | ||
1. Download `loki-config.yaml`, `alloy-local-config.yaml`, and `docker-compose.yaml`: | ||
2. Download `loki-config.yaml`, `alloy-local-config.yaml`, and `docker-compose.yaml`: | ||
```bash | ||
wget https://raw.githubusercontent.com/grafana/loki/main/examples/getting-started/loki-config.yaml -O loki-config.yaml | ||
wget https://raw.githubusercontent.com/grafana/loki/main/examples/getting-started/alloy-local-config.yaml -O alloy-local-config.yaml | ||
wget https://raw.githubusercontent.com/grafana/loki/main/examples/getting-started/docker-compose.yaml -O docker-compose.yaml | ||
```{{execute}} | ||
```bash | ||
wget https://raw.githubusercontent.com/grafana/loki/main/examples/getting-started/loki-config.yaml -O loki-config.yaml | ||
wget https://raw.githubusercontent.com/grafana/loki/main/examples/getting-started/alloy-local-config.yaml -O alloy-local-config.yaml | ||
wget https://raw.githubusercontent.com/grafana/loki/main/examples/getting-started/docker-compose.yaml -O docker-compose.yaml | ||
```{{execute}} | ||
1. Deploy the sample Docker image. | ||
3. Deploy the sample Docker image. | ||
With `evaluate-loki` as the current working directory, start the demo environment using `docker compose`: | ||
With `evaluate-loki` as the current working directory, start the demo environment using `docker compose`: | ||
```bash | ||
docker compose up -d | ||
```{{execute}} | ||
```bash | ||
docker-compose up -d | ||
```{{execute}} | ||
You should see something similar to the following: | ||
You should see something similar to the following: | ||
```bash | ||
✔ Network evaluate-loki_loki Created 0.1s | ||
✔ Container evaluate-loki-minio-1 Started 0.6s | ||
✔ Container evaluate-loki-flog-1 Started 0.6s | ||
✔ Container evaluate-loki-backend-1 Started 0.8s | ||
✔ Container evaluate-loki-write-1 Started 0.8s | ||
✔ Container evaluate-loki-read-1 Started 0.8s | ||
✔ Container evaluate-loki-gateway-1 Started 1.1s | ||
✔ Container evaluate-loki-grafana-1 Started 1.4s | ||
✔ Container evaluate-loki-alloy-1 Started 1.4s | ||
``` | ||
|
||
```bash | ||
✔ Network evaluate-loki_loki Created 0.1s | ||
✔ Container evaluate-loki-minio-1 Started 0.6s | ||
✔ Container evaluate-loki-flog-1 Started 0.6s | ||
✔ Container evaluate-loki-backend-1 Started 0.8s | ||
✔ Container evaluate-loki-write-1 Started 0.8s | ||
✔ Container evaluate-loki-read-1 Started 0.8s | ||
✔ Container evaluate-loki-gateway-1 Started 1.1s | ||
✔ Container evaluate-loki-grafana-1 Started 1.4s | ||
✔ Container evaluate-loki-alloy-1 Started 1.4s | ||
``` | ||
1. (Optional) Verify that the Loki cluster is up and running. | ||
|
||
4. (Optional) Verify that the Loki cluster is up and running. | ||
- The read component returns `ready` when you point a web browser at [http://localhost:3101/ready]({{TRAFFIC_HOST1_3101}}/ready). The message `Query Frontend not ready: not ready: number of schedulers this worker is connected to is 0` will show prior to the read component being ready. | ||
- The write component returns `ready` when you point a web browser at [http://localhost:3102/ready]({{TRAFFIC_HOST1_3102}}/ready). The message `Ingester not ready: waiting for 15s after being ready` will show prior to the write component being ready. | ||
- The read component returns `ready` when you browse to [http://localhost:3101/ready](http://localhost:3101/ready). | ||
The message `Query Frontend not ready: not ready: number of schedulers this worker is connected to is 0` shows until the read component is ready. | ||
- The write component returns `ready` when you browse to [http://localhost:3102/ready](http://localhost:3102/ready). | ||
The message `Ingester not ready: waiting for 15s after being ready` shows until the write component is ready. | ||
|
||
5. (Optional) Verify that Grafana Alloy is running. | ||
- Grafana Alloy's UI can be accessed at [http://localhost:12345]({{TRAFFIC_HOST1_12345}}). | ||
1. (Optional) Verify that Grafana Alloy is running. | ||
- You can access the Grafana Alloy UI at [http://localhost:12345](http://localhost:12345). | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters