Skip to content

Files

Failed to load latest commit information.

Latest commit

 Cannot retrieve latest commit at this time.

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Monolithic mode (单体模式) - Logs

Monolithic mode

The simplest mode of operation sets -target=all. This is the default target, and it does not need to be specified. This is monolithic mode; it runs all of Loki’s microservice components inside a single process as a single binary or Docker image.

Loading
flowchart LR
    A  -->|writes| GW --> |writes| D   -->|writes| I  -->|writes| M
    G -.->|reads | GW -.->|reads | QF -.->|reads | Q -.->|reads | M

    subgraph Minio
        M{"Object Storage"}
    end
    subgraph Agent["Grafana Alloy"]
        A("alloy")
    end
    subgraph Grafana
        G("grafana")
    end
    subgraph Gateway["Load Balancer"]
        GW{"Nginx"}
    end

    subgraph Loki["loki -target=all"]
        I("ingester")
        D("distributor")
        R("ruler")
        Q("querier")
        QF("query-frontend")
    end

Scaling monolithic mode

Horizontally scale up a monolithic mode deployment to more instances by using a shared object store, and by configuring the ring section to share state between all instances.

High availability can be configured by running two Loki instances using memberlist_config configuration and a shared object store.

Loading
flowchart LR
    A  -->|writes| GW -->|writes| Loki -->|writes| M
    GW -->|writes| Loki2 -->|writes| M
    GW -->|writes| LokiN -->|writes| M

    G  -.->|reads| GW    -.->|reads| Loki -.->|reads| M
    GW -.->|reads| Loki2 -.->|reads| M
    GW -.->|reads| LokiN -.->|reads| M

    subgraph Minio
        M{"Object Storage"}
    end
    subgraph Agent["Grafana Alloy"]
        A("alloy")
    end
    subgraph Grafana
        G("grafana")
    end
    subgraph Gateway["Load Balancer"]
        GW{"Nginx"}
    end

    subgraph Loki["loki -target=all"]
        CP["Loki Components ..."]
    end
    subgraph Loki2["loki-2 -target=all"]
        CP-2["Loki Components ..."]
    end
    subgraph LokiN["loki-N -target=all"]
        CP-N["Loki Components ..."]
    end

Quick Start

Install dependencies tools

git clone https://github.com/qclaogui/codelab-monitoring.git && cd "$(basename "$_" .git)"

make install-build-deps

Create a cluster and mapping the ingress port 80 to localhost:8080

make cluster

Deploy manifests

make deploy-monolithic-mode-logs

Once all containers are up and running you can search for logs in Grafana.

Navigate to http://localhost:8080/explore and select the search tab.

Clean up

make delete-monolithic-mode-logs