diff --git a/docs/sources/configuration/examples.md b/docs/sources/configuration/examples.md index 4d51158a05..6410a870c8 100644 --- a/docs/sources/configuration/examples.md +++ b/docs/sources/configuration/examples.md @@ -4,49 +4,58 @@ description: Loki Configuration Examples --- # Examples -## almost-zero-dependency.yaml +## 1-Local-Configuration-Example.yaml ```yaml -# This is a configuration to deploy Loki depending only on a storage solution -# for example, an S3-compatible API like MinIO. -# The ring configuration is based on the gossip memberlist and the index is shipped to storage -# via Single Store (boltdb-shipper) - auth_enabled: false server: http_listen_port: 3100 -distributor: +common: ring: + instance_addr: 127.0.0.1 kvstore: - store: memberlist + store: inmemory + replication_factor: 1 + path_prefix: /tmp/loki -ingester: - lifecycler: - ring: - kvstore: - store: memberlist - replication_factor: 1 - final_sleep: 0s - chunk_idle_period: 5m - chunk_retain_period: 30s +schema_config: + configs: + - from: 2020-05-15 + store: boltdb-shipper + object_store: filesystem + schema: v11 + index: + prefix: index_ + period: 24h +``` -memberlist: - abort_if_cluster_join_fails: false - # Expose this port on all distributor, ingester - # and querier replicas. - bind_port: 7946 +## 2-S3-Cluster-Example.yaml - # You can use a headless k8s service for all distributor, - # ingester and querier components. - join_members: - - loki-gossip-ring.loki.svc.cluster.local:7946 +```yaml +# This is a complete configuration to deploy Loki backed by a s3-Comaptible API +# like MinIO for storage. Loki components will use memberlist ring to shard and +# the index will be shipped to storage via boltdb-shipper. + +auth_enabled: false + +server: + http_listen_port: 3100 + +common: + ring: + instance_addr: 127.0.0.1 + kvstore: + store: memberlist + replication_factor: 1 + path_prefix: /loki # Update this accordingly, data will be stored here. - max_join_backoff: 1m - max_join_retries: 10 - min_join_backoff: 1s +memberlist: + join_members: + # You can use a headless k8s service for all distributor, ingester and querier components. + - loki-gossip-ring.loki.svc.cluster.local:7946 # :7946 is the default memberlist port. schema_config: configs: @@ -63,24 +72,18 @@ storage_config: active_index_directory: /loki/index cache_location: /loki/index_cache shared_store: s3 - aws: s3: s3://access_key:secret_access_key@custom_endpoint/bucket_name s3forcepathstyle: true -limits_config: - enforce_metric_name: false - reject_old_samples: true - reject_old_samples_max_age: 168h - compactor: - working_directory: /data/compactor + working_directory: /loki/compactor shared_store: s3 compaction_interval: 5m ``` -## aws-basic-config-no-creds.yaml +## 3-S3-Without-Credentials-Snippet.yaml ```yaml # If you don't wish to hard-code S3 credentials you can also configure an EC2 @@ -103,29 +106,7 @@ storage_config: ``` -## aws-basic-config.yaml - -```yaml -# This partial configuration uses S3 for chunk storage and uses DynamoDB for index storage - -schema_config: - configs: - - from: 2020-05-15 - store: aws - object_store: s3 - schema: v11 - index: - prefix: loki_ -storage_config: - aws: - s3: s3://access_key:secret_access_key@region/bucket_name - dynamodb: - dynamodb_url: dynamodb://access_key:secret_access_key@region - -``` - - -## bos-config.yaml +## 4-BOS-Example.yaml ```yaml schema_config: @@ -156,83 +137,60 @@ compactor: ``` -## cassandra-index.yaml +## 5-S3-And-DynamoDB-Snippet.yaml ```yaml -# This is a partial config that uses the local filesystem for chunk storage and Cassandra for index storage +# This partial configuration uses S3 for chunk storage and uses DynamoDB for index storage schema_config: configs: - from: 2020-05-15 - store: cassandra - object_store: filesystem + store: aws + object_store: s3 schema: v11 index: - prefix: cassandra_table - period: 168h - + prefix: loki_ storage_config: - cassandra: - username: cassandra - password: cassandra - addresses: 127.0.0.1 - auth: true - keyspace: lokiindex - - filesystem: - directory: /tmp/loki/chunks - + aws: + s3: s3://access_key:secret_access_key@region/bucket_name + dynamodb: + dynamodb_url: dynamodb://access_key:secret_access_key@region + ``` -## complete-local-config.yaml +## 6-Cassandra-Snippet.yaml ```yaml -auth_enabled: false - -server: - http_listen_port: 3100 - -ingester: - lifecycler: - address: 127.0.0.1 - ring: - kvstore: - store: inmemory - replication_factor: 1 - final_sleep: 0s - chunk_idle_period: 5m - chunk_retain_period: 30s +# This is a partial config that uses the local filesystem for chunk storage and Cassandra for index storage schema_config: configs: - from: 2020-05-15 - store: boltdb + store: cassandra object_store: filesystem schema: v11 index: - prefix: index_ + prefix: cassandra_table period: 168h storage_config: - boltdb: - directory: /tmp/loki/index + cassandra: + username: cassandra + password: cassandra + addresses: 127.0.0.1 + auth: true + keyspace: lokiindex filesystem: directory: /tmp/loki/chunks - -limits_config: - enforce_metric_name: false - reject_old_samples: true - reject_old_samples_max_age: 168h + ``` -## example-schema-config.yaml +## 7-Schema-Migration-Snippet.yaml ```yaml -# Additional example schema configuration for Cassandra - schema_config: configs: # Starting from 2018-04-15 Loki should store indexes on Cassandra @@ -258,7 +216,7 @@ schema_config: ``` -## google-cloud-storage-config.yaml +## 8-GCS-Snippet.yaml ```yaml # This partial configuration uses GCS for chunk storage and uses BigTable for index storage @@ -283,31 +241,7 @@ storage_config: ``` -## s3-compatible-apis.yaml - -```yaml -# S3-compatible APIs such as Ceph Object Storage with an S3-compatible API, can be used. -# If the API supports path-style URLs rather than virtual hosted bucket addressing, -# configure the URL in `storage_config` with the custom endpoint - -schema_config: - configs: - - from: 2020-05-15 - store: aws - object_store: s3 - schema: v11 - index: - prefix: loki_ -storage_config: - aws: - s3: s3://access_key:secret_access_key@region/bucket_name - dynamodb: - dynamodb_url: dynamodb://access_key:secret_access_key@region - -``` - - -## s3-expanded-config.yaml +## 9-Expanded-S3-Snippet.yaml ```yaml # S3 configuration supports an expanded configuration. diff --git a/docs/sources/configuration/examples/1-Local-Configuration-Example.yaml b/docs/sources/configuration/examples/1-Local-Configuration-Example.yaml new file mode 100644 index 0000000000..6385f22b2b --- /dev/null +++ b/docs/sources/configuration/examples/1-Local-Configuration-Example.yaml @@ -0,0 +1,22 @@ +auth_enabled: false + +server: + http_listen_port: 3100 + +common: + ring: + instance_addr: 127.0.0.1 + kvstore: + store: inmemory + replication_factor: 1 + path_prefix: /tmp/loki + +schema_config: + configs: + - from: 2020-05-15 + store: boltdb-shipper + object_store: filesystem + schema: v11 + index: + prefix: index_ + period: 24h \ No newline at end of file diff --git a/docs/sources/configuration/examples/2-S3-Cluster-Example.yaml b/docs/sources/configuration/examples/2-S3-Cluster-Example.yaml new file mode 100644 index 0000000000..5f76f79881 --- /dev/null +++ b/docs/sources/configuration/examples/2-S3-Cluster-Example.yaml @@ -0,0 +1,45 @@ +# This is a complete configuration to deploy Loki backed by a s3-Comaptible API +# like MinIO for storage. Loki components will use memberlist ring to shard and +# the index will be shipped to storage via boltdb-shipper. + +auth_enabled: false + +server: + http_listen_port: 3100 + +common: + ring: + instance_addr: 127.0.0.1 + kvstore: + store: memberlist + replication_factor: 1 + path_prefix: /loki # Update this accordingly, data will be stored here. + +memberlist: + join_members: + # You can use a headless k8s service for all distributor, ingester and querier components. + - loki-gossip-ring.loki.svc.cluster.local:7946 # :7946 is the default memberlist port. + +schema_config: + configs: + - from: 2020-05-15 + store: boltdb-shipper + object_store: s3 + schema: v11 + index: + prefix: index_ + period: 24h + +storage_config: + boltdb_shipper: + active_index_directory: /loki/index + cache_location: /loki/index_cache + shared_store: s3 + aws: + s3: s3://access_key:secret_access_key@custom_endpoint/bucket_name + s3forcepathstyle: true + +compactor: + working_directory: /loki/compactor + shared_store: s3 + compaction_interval: 5m \ No newline at end of file diff --git a/docs/sources/configuration/examples/aws-basic-config-no-creds.yaml b/docs/sources/configuration/examples/3-S3-Without-Credentials-Snippet.yaml similarity index 100% rename from docs/sources/configuration/examples/aws-basic-config-no-creds.yaml rename to docs/sources/configuration/examples/3-S3-Without-Credentials-Snippet.yaml diff --git a/docs/sources/configuration/examples/bos-config.yaml b/docs/sources/configuration/examples/4-BOS-Example.yaml similarity index 100% rename from docs/sources/configuration/examples/bos-config.yaml rename to docs/sources/configuration/examples/4-BOS-Example.yaml diff --git a/docs/sources/configuration/examples/aws-basic-config.yaml b/docs/sources/configuration/examples/5-S3-And-DynamoDB-Snippet.yaml similarity index 100% rename from docs/sources/configuration/examples/aws-basic-config.yaml rename to docs/sources/configuration/examples/5-S3-And-DynamoDB-Snippet.yaml diff --git a/docs/sources/configuration/examples/cassandra-index.yaml b/docs/sources/configuration/examples/6-Cassandra-Snippet.yaml similarity index 100% rename from docs/sources/configuration/examples/cassandra-index.yaml rename to docs/sources/configuration/examples/6-Cassandra-Snippet.yaml diff --git a/docs/sources/configuration/examples/example-schema-config.yaml b/docs/sources/configuration/examples/7-Schema-Migration-Snippet.yaml similarity index 89% rename from docs/sources/configuration/examples/example-schema-config.yaml rename to docs/sources/configuration/examples/7-Schema-Migration-Snippet.yaml index 618f8dafe4..0d72566c7e 100644 --- a/docs/sources/configuration/examples/example-schema-config.yaml +++ b/docs/sources/configuration/examples/7-Schema-Migration-Snippet.yaml @@ -1,5 +1,3 @@ -# Additional example schema configuration for Cassandra - schema_config: configs: # Starting from 2018-04-15 Loki should store indexes on Cassandra diff --git a/docs/sources/configuration/examples/google-cloud-storage-config.yaml b/docs/sources/configuration/examples/8-GCS-Snippet.yaml similarity index 100% rename from docs/sources/configuration/examples/google-cloud-storage-config.yaml rename to docs/sources/configuration/examples/8-GCS-Snippet.yaml diff --git a/docs/sources/configuration/examples/s3-expanded-config.yaml b/docs/sources/configuration/examples/9-Expanded-S3-Snippet.yaml similarity index 100% rename from docs/sources/configuration/examples/s3-expanded-config.yaml rename to docs/sources/configuration/examples/9-Expanded-S3-Snippet.yaml diff --git a/docs/sources/configuration/examples/almost-zero-dependency.yaml b/docs/sources/configuration/examples/almost-zero-dependency.yaml deleted file mode 100644 index c82a3abf89..0000000000 --- a/docs/sources/configuration/examples/almost-zero-dependency.yaml +++ /dev/null @@ -1,70 +0,0 @@ -# This is a configuration to deploy Loki depending only on a storage solution -# for example, an S3-compatible API like MinIO. -# The ring configuration is based on the gossip memberlist and the index is shipped to storage -# via Single Store (boltdb-shipper) - -auth_enabled: false - -server: - http_listen_port: 3100 - -distributor: - ring: - kvstore: - store: memberlist - -ingester: - lifecycler: - ring: - kvstore: - store: memberlist - replication_factor: 1 - final_sleep: 0s - chunk_idle_period: 5m - chunk_retain_period: 30s - -memberlist: - abort_if_cluster_join_fails: false - - # Expose this port on all distributor, ingester - # and querier replicas. - bind_port: 7946 - - # You can use a headless k8s service for all distributor, - # ingester and querier components. - join_members: - - loki-gossip-ring.loki.svc.cluster.local:7946 - - max_join_backoff: 1m - max_join_retries: 10 - min_join_backoff: 1s - -schema_config: - configs: - - from: 2020-05-15 - store: boltdb-shipper - object_store: s3 - schema: v11 - index: - prefix: index_ - period: 24h - -storage_config: - boltdb_shipper: - active_index_directory: /loki/index - cache_location: /loki/index_cache - shared_store: s3 - - aws: - s3: s3://access_key:secret_access_key@custom_endpoint/bucket_name - s3forcepathstyle: true - -limits_config: - enforce_metric_name: false - reject_old_samples: true - reject_old_samples_max_age: 168h - -compactor: - working_directory: /data/compactor - shared_store: s3 - compaction_interval: 5m diff --git a/docs/sources/configuration/examples/complete-local-config.yaml b/docs/sources/configuration/examples/complete-local-config.yaml deleted file mode 100644 index 16942b9694..0000000000 --- a/docs/sources/configuration/examples/complete-local-config.yaml +++ /dev/null @@ -1,37 +0,0 @@ -auth_enabled: false - -server: - http_listen_port: 3100 - -ingester: - lifecycler: - address: 127.0.0.1 - ring: - kvstore: - store: inmemory - replication_factor: 1 - final_sleep: 0s - chunk_idle_period: 5m - chunk_retain_period: 30s - -schema_config: - configs: - - from: 2020-05-15 - store: boltdb - object_store: filesystem - schema: v11 - index: - prefix: index_ - period: 168h - -storage_config: - boltdb: - directory: /tmp/loki/index - - filesystem: - directory: /tmp/loki/chunks - -limits_config: - enforce_metric_name: false - reject_old_samples: true - reject_old_samples_max_age: 168h diff --git a/docs/sources/configuration/examples/s3-compatible-apis.yaml b/docs/sources/configuration/examples/s3-compatible-apis.yaml deleted file mode 100644 index 6631cbb119..0000000000 --- a/docs/sources/configuration/examples/s3-compatible-apis.yaml +++ /dev/null @@ -1,18 +0,0 @@ -# S3-compatible APIs such as Ceph Object Storage with an S3-compatible API, can be used. -# If the API supports path-style URLs rather than virtual hosted bucket addressing, -# configure the URL in `storage_config` with the custom endpoint - -schema_config: - configs: - - from: 2020-05-15 - store: aws - object_store: s3 - schema: v11 - index: - prefix: loki_ -storage_config: - aws: - s3: s3://access_key:secret_access_key@region/bucket_name - dynamodb: - dynamodb_url: dynamodb://access_key:secret_access_key@region - \ No newline at end of file