With S3 compatible without dynamodb
There is no schema definition on the official doc, I try this and I still have a error
failed parsing config: /etc/loki/config/config.yaml: yaml: unmarshal errors:
line 42: field storage_config not found in type chunk.PeriodConfig
- from: 2020-05-15
I try this
- from: 2020-05-15
caller=server.go:239 http=[::]:3100 grpc=[::]:9095 msg=“server listening on addresses”
level=error ts=2021-10-27T14:24:38.121116838Z caller=log.go:106 msg=“error running loki” err="mkdir : no such file or directory\nerror
I ran into a number of these issues - there seems to be so much variability in how to do this (flexible) at the cost of concise clarity on documentation. Here’s what worked for me with key items annotated (may need to remove comments) - I can’t say this is THE precise way only that it worked for me.
- from: 2020-07-01
# period 24h is a key setting to AWS S3 use - see docs
# I was forced to add a compactor config as well - though this will become necessary anyway
# several samples showed both boltdb and shipper, since versions change so fast it's hard to verify proper use but latest examples and docs state shipper and this worked (as of 2.3 for me)
shared_store: s3 # I have seen both 'aws' and 's3' used here and other places
# cache_ttl: 168h
s3: s3://usxxxxx2/my-lokidata # I used IAM ROLE - you can put using creds but this is the more secure as the role is attached to this server and not usable from anywhere else
s3forcepathstyle: true # added from various examples - need to validate
sse_encryption: true # added from various examples - need to validate
# bucketnames: my-lokidata # not needed here if bucket in the s3 path above
reject_old_samples_max_age: 504h # I have this set high for testing log ingestion from client
Hope this help.
thank you for your answer but When use /tmp…
err="mkdir /tmp/loki: read-only file system\nerror creating index client\
That sounds like the local folders for that location are not owned by the user running loki. I assume you are running it as a service (linux I assume) - you must also give ownership of the /tmp/loki/ folder to that user assigned in the service. Here is a good link to follow - some sections are outdated but it it one of the better resources to get general config and process info on Gradana/Loki. Just make sure you are not running as root in the service. Follow that link on the linux side setup but not the config flie for Loki.
caller=log.go:106 msg=“error running loki” err="mkdir /loki/index: read-only file system\nerror creating index clien
I use the offcial charts loki-distributed
what OS is the install on?
go to the tmp dir and run a listing of contents (ls -l or ll) to show ownership paste screenshot or contents here.
Official image, from the official chart loki-distributed
I’m asking what operating system or are you saying you are using a Docker image or Helm to deploy?
If I use volumeclaim, it might be a good idea to point the index directory on it
as statefulset the mount point is /var/loki
the good setup
Yes, the documentation is not clear. It took a lot of trial and error to get the below configuration to work with Linode s3 compatible object storage
# -- Check https://grafana.com/docs/loki/latest/configuration/#schema_config for more info on how to configure schemas
- from: 2020-09-07
# -- Check https://grafana.com/docs/loki/latest/configuration/#storage_config for more info on how to configure storages
# region will always be US even if you have selected any other region
# use the actual region name below. For example, if you have used ap-south-1 the endpoint will be ap-south-1.linodeobjects.com