loki icon indicating copy to clipboard operation
loki copied to clipboard

How to make log archive backups?

Open hooklab opened this issue 3 years ago • 3 comments

For example, you can regularly archive as a zip file, and you can also view historical log files。

hooklab avatar Dec 26 '22 02:12 hooklab

Do you mean backups of everything or just a log stream as described in #6840?

jeschkies avatar Jan 09 '23 14:01 jeschkies

How to make a backup of everything?

schema_config:
configs:
    - from: 2023-06-23                    
      store: tsdb
      object_store: aws
      schema: v12
      index:
        prefix: loki_
        period: 24h

As I understand it, I need to copy the indexes and chunks to a separate storage device, but it requires stopping Loki. Is there a way to make a backup without stopping the service?

Can I make a backup without stopping the service?

Dolbodrynya avatar Jun 22 '23 13:06 Dolbodrynya

@Dolbodrynya I think it would be good to stop the service and then copy everything. I use loki:2.9.0 in docker compose with

  loki:
    image: grafana/loki:2.9.0
    container_name: loki
    ports:
      - "3100:3100"
    volumes:
      - ./loki-config.yaml:/etc/loki/local-config.yaml
      - loki-data:/loki
    command: -config.file=/etc/loki/local-config.yaml
    depends_on:
      - grafana

configuration. I copy everything dir /loki in the container which have all the indexes (also use tsdb) with docker cp loki:/loki /tmp/loki_backup. Have not tried to restore the data to see if there would be any conflicts or errors but in theory it would work.

adamsocrat avatar Jul 01 '24 02:07 adamsocrat