Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default location 2 #7792

Closed
wants to merge 2 commits into from
Closed

Default location 2 #7792

wants to merge 2 commits into from

Conversation

KanishkaVerma054
Copy link

@KanishkaVerma054 KanishkaVerma054 commented Nov 28, 2022

What this PR does / why we need it:

Which issue(s) this PR fixes: cmd/loki/loki-local-config.yaml for not loosing any data
Fixes #7781

Special notes for your reviewer:

Checklist

  • Reviewed the CONTRIBUTING.md guide
  • Documentation added
  • Tests updated
  • CHANGELOG.md updated
  • Changes that require user attention or interaction to upgrade are documented in docs/sources/upgrading/_index.md

@KanishkaVerma054 KanishkaVerma054 requested a review from a team as a code owner November 28, 2022 13:12
@grafanabot
Copy link
Collaborator

./tools/diff_coverage.sh ../loki-target-branch/test_results.txt test_results.txt ingester,distributor,querier,querier/queryrange,iter,storage,chunkenc,logql,loki

Change in test coverage per package. Green indicates 0 or positive change, red indicates that test coverage for a package fell.

+           ingester	0%
+        distributor	0%
+            querier	0%
+ querier/queryrange	0%
+               iter	0%
+            storage	0%
+           chunkenc	0%
+              logql	0%
+               loki	0%

@chaudum
Copy link
Contributor

chaudum commented Nov 29, 2022

Changing the locations to /var/lib/loki would require to run Loki as a user with privileges writing to /var/lib.

$ ls -lash /var/lib/
total 220K
4.0K drwxr-xr-x 54 root          root          4.0K Nov 25 18:53 .
4.0K drwxr-xr-x 12 root          root          4.0K Sep 15 14:50 ..

Otherwise Loki will not start up due to missing privileges:

$ ./cmd/loki/loki -target=all -config.file=cmd/loki/loki-local-config.yaml
mkdir /var/lib/loki: permission denied
error initialising module: ruler-storage
github.com/grafana/dskit/modules.(*Manager).initModule
	/home/christian/sandbox/grafana/loki/vendor/github.com/grafana/dskit/modules/modules.go:122
github.com/grafana/dskit/modules.(*Manager).InitModuleServices
	/home/christian/sandbox/grafana/loki/vendor/github.com/grafana/dskit/modules/modules.go:92
github.com/grafana/loki/pkg/loki.(*Loki).Run
	/home/christian/sandbox/grafana/loki/pkg/loki/loki.go:419
main.main
	/home/christian/sandbox/grafana/loki/cmd/loki/main.go:105
runtime.main
	/usr/local/go-1.19/src/runtime/proc.go:250
runtime.goexit
	/usr/local/go-1.19/src/runtime/asm_amd64.s:1594

In my case, I would need to create and change ownership of /var/lib/loki, like so:

$ sudo mkdir -pv /var/lib/loki && sudo chown -R christian:christian /var/lib/loki
[sudo] password for christian: 
mkdir: created directory '/var/lib/loki'

Since this config file is referenced in a few places in the docs (and in the README), we need to make sure we don't break these examples, otherwise it's not a very good user experience.

@MasslessParticle
Copy link
Contributor

The loki-local configuration is intended to get up and running as soon as a possible and not for direct production use. I don't think we should change this.

Thank you for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants