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

Fix ruler s3 storage configuration #171

Merged
merged 2 commits into from
Sep 15, 2020

Conversation

forestsword
Copy link
Contributor

@forestsword forestsword commented Aug 31, 2020

What this PR does:
Fixes the s3.url parameter for the ruler, otherwise this would happen:

error running cortex err=at least one bucket name must be specified
github.com/cortexproject/cortex/pkg/chunk/aws.buildS3Config
        /go/src/github.com/cortexproject/cortex/pkg/chunk/aws/s3_storage_client.go:209
github.com/cortexproject/cortex/pkg/chunk/aws.NewS3ObjectClient
        /go/src/github.com/cortexproject/cortex/pkg/chunk/aws/s3_storage_client.go:103
github.com/cortexproject/cortex/pkg/ruler.NewRuleStorage
        /go/src/github.com/cortexproject/cortex/pkg/ruler/storage.go:81
github.com/cortexproject/cortex/pkg/cortex.(*Cortex).initRulerStorage
        /go/src/github.com/cortexproject/cortex/pkg/cortex/modules.go:474
github.com/cortexproject/cortex/pkg/util/modules.(*Manager).InitModuleServices
        /go/src/github.com/cortexproject/cortex/pkg/util/modules/modules.go:87
github.com/cortexproject/cortex/pkg/cortex.(*Cortex).Run
        /go/src/github.com/cortexproject/cortex/pkg/cortex/cortex.go:282
main.main
        /go/src/github.com/cortexproject/cortex/cmd/cortex/main.go:164
runtime.main
        /usr/local/go/src/runtime/proc.go:203
runtime.goexit
        /usr/local/go/src/runtime/asm_amd64.s:1373
failed to build s3 config
github.com/cortexproject/cortex/pkg/chunk/aws.NewS3ObjectClient
        /go/src/github.com/cortexproject/cortex/pkg/chunk/aws/s3_storage_client.go:105
github.com/cortexproject/cortex/pkg/ruler.NewRuleStorage
        /go/src/github.com/cortexproject/cortex/pkg/ruler/storage.go:81
github.com/cortexproject/cortex/pkg/cortex.(*Cortex).initRulerStorage
        /go/src/github.com/cortexproject/cortex/pkg/cortex/modules.go:474
github.com/cortexproject/cortex/pkg/util/modules.(*Manager).InitModuleServices
        /go/src/github.com/cortexproject/cortex/pkg/util/modules/modules.go:87
github.com/cortexproject/cortex/pkg/cortex.(*Cortex).Run
        /go/src/github.com/cortexproject/cortex/pkg/cortex/cortex.go:282
main.main
        /go/src/github.com/cortexproject/cortex/cmd/cortex/main.go:164
runtime.main
        /usr/local/go/src/runtime/proc.go:203
runtime.goexit
        /usr/local/go/src/runtime/asm_amd64.s:1373
error initialising module: ruler-storage
github.com/cortexproject/cortex/pkg/util/modules.(*Manager).InitModuleServices
        /go/src/github.com/cortexproject/cortex/pkg/util/modules/modules.go:89
github.com/cortexproject/cortex/pkg/cortex.(*Cortex).Run
        /go/src/github.com/cortexproject/cortex/pkg/cortex/cortex.go:282
main.main
        /go/src/github.com/cortexproject/cortex/cmd/cortex/main.go:164
runtime.main
        /usr/local/go/src/runtime/proc.go:203
runtime.goexit
        /usr/local/go/src/runtime/asm_amd64.s:1373

Checklist

  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

@forestsword forestsword requested a review from a team as a code owner August 31, 2020 13:42
@gotjosh
Copy link
Contributor

gotjosh commented Sep 4, 2020

Sorry @forestsword looks like #174 was merged first 😭 .

@gotjosh
Copy link
Contributor

gotjosh commented Sep 4, 2020

Thank you for your contribution though!

@gotjosh gotjosh closed this Sep 4, 2020
@forestsword
Copy link
Contributor Author

@gotjosh #174 didn't fix my issue. It's possibly because I'm configuring s3 block storage as well. My resulting args are:

"args": [
    "-consul.hostname=consul.namespace.svc.cluster.local:8500",
    "-distributor.health-check-ingesters=true",
    "-distributor.replication-factor=3",
    "-distributor.shard-by-all-labels=true",
    "-dynamodb.api-limit=10",
    "-dynamodb.url=https://us-east-1",
    "-experimental.blocks-storage.backend=s3",
    "-experimental.blocks-storage.bucket-store.ignore-deletion-marks-delay=1h",
    "-experimental.blocks-storage.bucket-store.metadata-cache.backend=memcached",
    "-experimental.blocks-storage.bucket-store.metadata-cache.memcached.addresses=dnssrvnoa+memcached-metadata.namespace.svc.cluster.local:11211",
    "-experimental.blocks-storage.bucket-store.metadata-cache.memcached.max-async-buffer-size=25000",
    "-experimental.blocks-storage.bucket-store.metadata-cache.memcached.max-async-concurrency=50",
    "-experimental.blocks-storage.bucket-store.metadata-cache.memcached.max-get-multi-batch-size=100",
    "-experimental.blocks-storage.bucket-store.metadata-cache.memcached.max-item-size=1048576",
    "-experimental.blocks-storage.bucket-store.metadata-cache.memcached.timeout=200ms",
    "-experimental.blocks-storage.bucket-store.sync-dir=/data/tsdb",
    "-experimental.blocks-storage.s3.bucket-name=bucket",
    "-experimental.blocks-storage.s3.endpoint=s3.dualstack.us-east-1.amazonaws.com",
    "-experimental.blocks-storage.tsdb.block-ranges-period=2h",
    "-experimental.blocks-storage.tsdb.dir=/data/tsdb",
    "-experimental.blocks-storage.tsdb.retention-period=96h",
    "-experimental.blocks-storage.tsdb.ship-interval=1m",
    "-experimental.ruler.enable-api=true",
    "-experimental.store-gateway.replication-factor=3",
    "-experimental.store-gateway.sharding-enabled=true",
    "-experimental.store-gateway.sharding-ring.consul.hostname=consul.namespace.svc.cluster.local:8500",
    "-experimental.store-gateway.sharding-ring.prefix=",
    "-experimental.store-gateway.sharding-ring.store=consul",
    "-limits.per-user-override-config=/etc/cortex/overrides.yaml",
    "-querier.query-ingesters-within=13h",
    "-querier.query-store-after=12h",
    "-ring.heartbeat-timeout=10m",
    "-ring.prefix=",
    "-ruler.alertmanager-url=http://alertmanager.namespace.svc.cluster.local/alertmanager",
    "-ruler.enable-sharding=true",
    "-ruler.ring.consul.hostname=consul.namespace.svc.cluster.local:8500",
    "-ruler.storage.type=s3",
    "-s3.url=https://us-east-1/bucket",
    "-schema-config-file=/etc/cortex/schema/config.yaml",
    "-store.cardinality-limit=1000000",
    "-store.engine=blocks",
    "-store.max-query-length=768h",
    "-target=ruler"
],

This results in the stacktrace I originally posted. Please let me know if there's any other information you'd like. I am using 1.3.0.

If I set ruler.storage.s3.url instead of s3.url it comes up healthy.

@jpdstan
Copy link
Contributor

jpdstan commented Sep 9, 2020

+1, ruler.storage.s3.url is the correct key

@gotjosh gotjosh reopened this Sep 9, 2020
Copy link
Contributor

@gotjosh gotjosh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're completely right, it also needs to fix the key. Can you please rebase to pick up new changes?

CHANGELOG.md Outdated
@@ -5,6 +5,7 @@
* [CHANGE] The project is now licensed with Apache-2.0 license. #169
* [CHANGE] Add overrides config to tsdb store-gateway. #167
* [CHANGE] Ingesters now default to running as `StatefulSet` with WAL enabled. It is controlled by the config `$._config.ingester_deployment_without_wal` which is `false` by default. Setting the config to `true` will yeild the old behaviour (stateless `Deployment` without WAL enabled). #72
* [BUGFIX] Fixes `ruler.storage.s3.url` argument for the ruler.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps reword to: Fixes ruler.storage.s3.url in the Ruler, It used an incorrect key. #171

@forestsword
Copy link
Contributor Author

@gotjosh PTAL

Copy link
Collaborator

@pracucci pracucci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

CHANGELOG.md Outdated Show resolved Hide resolved
@pracucci pracucci merged commit 36b9442 into grafana:master Sep 15, 2020
@forestsword forestsword deleted the fix-ruler-s3-args branch September 15, 2020 10:54
simonswine pushed a commit to grafana/mimir that referenced this pull request Dec 20, 2021
…ler-s3-args

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

Successfully merging this pull request may close these issues.

4 participants