• loki单机对接minio


    安装minio

    请参考minio官方文档部署

    创建Buckets

     

    配置Policy策略

    创建一个loki的policy,授权内容如下 (权限配置请参考aws的s3权限配置)

    {

        "Version": "2012-10-17",

        "Statement": [

            {

                "Effect": "Allow",

                "Action": [

                    "s3:*"

                ],

                "Resource": [

                    "arn:aws:s3:::loki/*",

                    "arn:aws:s3:::loki"

                ]

            }

        ]

    }

    注意:Resource字段配置,配置请参考https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-arn-format.html

     

    配置minio用户

    新建用户loki并将前面创建的policy授权

     

     

    Loki运行配置文件参考

    可以参考loki官方文档https://grafana.com/docs/loki/latest/configuration/examples/

    # 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: inmemory

          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: 2022-11-09

        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://loki:password@192.168.1.1:9000/loki

       s3forcepathstyle: true

    limits_config:

      enforce_metric_name: false

      reject_old_samples: true

      reject_old_samples_max_age: 168h

      retention_period: 1d

    compactor:

      working_directory: /loki/compactor

      shared_store: s3

      compaction_interval: 1m

      retention_enabled: true

    注意:标红周期必须为24小时

  • 相关阅读:
    NumPy 差分、最小公倍数、最大公约数、三角函数详解
    如何使用按图搜索(拍立淘)获取商品数据
    基于django电影推荐系统
    2021年03月 Python(四级)真题解析#中国电子学会#全国青少年软件编程等级考试
    C++Day4
    typescript21-接口和类型别名的对比
    CentOS7和CentOS8 Asterisk 20.0.0 简单图形化界面7--对接讯时FXO网关落地
    Python中的import和from import
    Unity API学习之消息机制理论与应用
    架构师面试必备:高并发限流算法全攻略
  • 原文地址:https://blog.csdn.net/u014331650/article/details/127889779