Docs: Add virtual targets docs (#4565)

* Add CHANGELOG entry and updated modes diagram.

* Update documentation with the new hybrid mode.

- Update targets with new 'read' and 'write' options
- Add new docker-compose yaml that exemplifies how to use new 'read' and
  'write' targets

* Add missing targets to configuration docs.

- Missing ones: index-gateway, ingester-querier, query-scheduler
pull/4575/head
Dylan Guedes 4 years ago committed by GitHub
parent 93a0b716d4
commit 331fa6d7b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      CHANGELOG.md
  2. 8
      docs/sources/configuration/_index.md
  3. 31
      docs/sources/fundamentals/architecture/_index.md
  4. BIN
      docs/sources/fundamentals/architecture/modes.png
  5. 3
      pkg/loki/loki.go

@ -10,6 +10,7 @@
* [4520](https://github.com/grafana/loki/pull/4520) **jordanrushing** and **owen-d**: Introduce overrides-exporter module for tenant limits
* [4453](https://github.com/grafana/loki/pull/4453) **liguozhong**: Loki: Implement retry to s3 chunk storage
* [4542](https://github.com/grafana/loki/pull/4542) **owen-d**: Introduce the `loki_overrides_defaults` metric and only export diffs for tenant limits.
* [4498](https://github.com/grafana/loki/pull/4498) **trevorwhitney**: Feature: add virtual read and write targets
# 2.3.0 (2021/08/06)

@ -78,9 +78,11 @@ Pass the `-config.expand-env` flag at the command line to enable this way of set
### Supported contents and default values of `loki.yaml`
```yaml
# A comma-separated list of components to run. The default value "all" runs
# Loki in single binary mode.
# Supported values: all, compactor, distributor, ingester, querier, query-frontend, table-manager.
# A comma-separated list of components to run.
# The default value "all" runs Loki in single binary mode.
# The value "read" is an alias to run only read-path related components (ex: querier, query-frontend, etc) but all in the same process.
# The value "write" is an alias to run only write-path related components (ex: distributor, compactor) but all in the same process.
# Supported values: all, compactor, distributor, ingester, querier, query-scheduler, ingester-querier, query-frontend, index-gateway, ruler, table-manager, read, write.
[target: <string> | default = "all"]
# Enables authentication through the X-Scope-OrgID header, which must be present

@ -16,7 +16,7 @@ index and in stored chunks.
## Modes of operation
![modes_diagram](modes_of_operation.png)
![modes_diagram](modes.png)
Loki has a set of [components](#components), which
are internally referred to as modules. Each component spawns a gRPC server for
@ -24,20 +24,22 @@ internal traffic and an HTTP/1 server for external API requests. All components
come with an HTTP/1 server, but most only expose readiness, health, and metrics
endpoints.
Loki can run as a single binary; all components are part of the same process.
Or, Loki can run components as microservices.
As microservices, the cluster is horizontally scalable.
Loki can run as:
When invoked, the `-target` flag on the
command line or the `target: <string>` configuration determines
the components' mode: single binary or microservices.
A `target` value of `all` runs Loki in single binary mode.
A `target` value of one of the components invokes that component
as its own microservice.
- A single binary, where all components are part of the same process
- Hybrid, where read-path components run separately from write-path components.
- As microservices, where every component run and scale separately
When invoked, the `-target` flag on the command line or the `target: <string>` configuration determines
the components' mode: monolythic, hybrid, or microservices.
A `target` value of `all` runs Loki in single binary/monolythic mode.
A `target` value of `read` runs all read-path related components (hybrid mode).
A `target` value of `write` runs all write-path related components (hybrid mode).
A `target` value of one of the components (ex: `compactor`) invokes that component as its own microservice (microservices mode).
Each component of Loki, such as the ingesters and distributors, communicate with
one another over gRPC using the gRPC listen port defined in the Loki configuration.
When running components as a single binary, this is still true: each component,
When running components with target `all`, `read` or `write`, this is still true: different components,
although running in the same process, will connect to each other over the local
network for inter-component communication.
@ -49,8 +51,11 @@ processes with the following limitations:
with more than one replica, as each replica must be able to
access the same storage backend, and local storage is not safe for concurrent
access.
1. Individual components cannot be scaled independently, so it is not possible
to have more read components than write components.
2. Individual components cannot be scaled independently
Another option is to run in hybrid mode, where Loki is composed of multiple `read` and `write` nodes.
By using this mode, one can scale the read path separately from the write path and vice-versa, but without
the overhead of managing all the different components separately.
## Components

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 MiB

@ -84,7 +84,8 @@ func (c *Config) RegisterFlags(f *flag.FlagSet) {
// Set the default module list to 'all'
c.Target = []string{All}
f.Var(&c.Target, "target", "Comma-separated list of Loki modules to load. "+
"The alias 'all' can be used in the list to load a number of core modules and will enable single-binary mode. ")
"The alias 'all' can be used in the list to load a number of core modules and will enable single-binary mode. "+
"The aliases 'read' and 'write' can be used to only run components related to the read path or write path, respectively.")
f.BoolVar(&c.AuthEnabled, "auth.enabled", true, "Set to false to disable auth.")
c.registerServerFlagsWithChangedDefaultValues(f)

Loading…
Cancel
Save