Skip to content

Instantly share code, notes, and snippets.

@brian9206
Last active September 23, 2022 19:11
Show Gist options
  • Save brian9206/2f97a9dbe4960f7b82d90ff9e0cb9956 to your computer and use it in GitHub Desktop.
Save brian9206/2f97a9dbe4960f7b82d90ff9e0cb9956 to your computer and use it in GitHub Desktop.
Single-node small & lightweight Grafana Loki deployment
auth_enabled: false
analytics:
reporting_enabled: false
server:
http_listen_port: 3100
common:
path_prefix: /var/loki
storage:
filesystem:
chunks_directory: /var/loki/chunks
rules_directory: /var/loki/rules
replication_factor: 1
ring:
instance_addr: 127.0.0.1
kvstore:
store: inmemory
ingester:
wal:
enabled: true
dir: /var/loki/ingester
lifecycler:
address: 127.0.0.1
ring:
kvstore:
store: inmemory
replication_factor: 1
final_sleep: 0s
chunk_idle_period: 1h # Any chunk not receiving new logs in this time will be flushed
max_chunk_age: 1h # All chunks will be flushed when they hit this age, default is 1h
chunk_target_size: 1048576 # Loki will attempt to build chunks up to 1.5MB, flushing first if chunk_idle_period or max_chunk_age is reached first
chunk_retain_period: 30s # Must be greater than index read cache TTL if using an index cache (Default index read cache TTL is 5m)
max_transfer_retries: 0 # Chunk transfers disabled
compactor:
working_directory: /var/loki/retention
shared_store: filesystem
compaction_interval: 10m
retention_enabled: true
retention_delete_delay: 2h
retention_delete_worker_count: 150
schema_config:
configs:
- from: 2020-10-24
store: boltdb-shipper
object_store: filesystem
schema: v11
index:
prefix: index_
period: 24h
storage_config:
boltdb_shipper:
active_index_directory: /var/loki/index
cache_location: /var/loki/boltdb-cache
shared_store: filesystem
gcs:
bucket_name: loki
limits_config:
max_streams_per_user: 0
max_global_streams_per_user: 0
retention_period: 24h
table_manager:
retention_deletes_enabled: true
retention_period: 24h
query_range:
parallelise_shardable_queries: false
split_queries_by_interval: 0
@brian9206
Copy link
Author

Systemd config /etc/systemd/system/loki.yml

[Unit]
Description=Loki service
After=network.target

[Service]
Type=simple
User=loki
ExecStart=/bin/loki -config.file /etc/loki.yml

[Install]
WantedBy=multi-user.target
useradd --system loki
mkdir /var/loki
chown loki:loki /var/loki
systemctl enable --now loki

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment