Skip to content

Latest commit

 

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.

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
Loading

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.

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
Loading

Quick Start

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

make up-monolithic-mode-logs

That's it.

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

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

Clean up

make down-monolithic-mode-logs