Skip to content

Commit

Permalink
mimir-microservices-mode: Use default store-gateway replication factor
Browse files Browse the repository at this point in the history
  • Loading branch information
56quarters committed Jan 8, 2025
1 parent 758abec commit 05bf44a
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@ prometheus:
- 'ruler-2:8023'
- 'compactor:8006'
- 'query-frontend:8007'
- 'store-gateway-1:8008'
- 'store-gateway-2:8009'
- 'query-scheduler:8011'
- 'query-scheduler:8008'
- 'store-gateway-1:8011'
- 'store-gateway-2:8012'
- 'store-gateway-3:8013'
- 'memcached-exporter:9150'
- 'continuous-test:8090'
- 'load-generator:9900'
labels:
cluster: 'docker-compose'
Expand Down
2 changes: 1 addition & 1 deletion development/mimir-microservices-mode/config/mimir.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ compactor:

store_gateway:
sharding_ring:
replication_factor: 1
replication_factor: 3
heartbeat_period: 5s
heartbeat_timeout: 15s
wait_stability_min_duration: 0
Expand Down
12 changes: 6 additions & 6 deletions development/mimir-microservices-mode/config/otel-collector.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,20 +57,20 @@ receivers:
cluster: 'docker-compose'
namespace: 'mimir-microservices-mode'
container: 'query-frontend'
- job_name: mimir-microservices-mode/store-gateway
- job_name: mimir-microservices-mode/query-scheduler
static_configs:
- targets: ['store-gateway-1:8008', 'store-gateway-2:8009']
- targets: ['query-scheduler:8008']
labels:
cluster: 'docker-compose'
namespace: 'mimir-microservices-mode'
container: 'store-gateway'
- job_name: mimir-microservices-mode/query-scheduler
container: 'query-scheduler'
- job_name: mimir-microservices-mode/store-gateway
static_configs:
- targets: ['query-scheduler:8011']
- targets: ['store-gateway-1:8011', 'store-gateway-2:8012', 'store-gateway-3:8013']
labels:
cluster: 'docker-compose'
namespace: 'mimir-microservices-mode'
container: 'query-scheduler'
container: 'store-gateway'
- job_name: mimir-microservices-mode/memcached-exporter
static_configs:
- targets: ['memcached-exporter:9150']
Expand Down
9 changes: 6 additions & 3 deletions development/mimir-microservices-mode/config/prometheus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,13 @@ scrape_configs:
- 'ruler-2:8023'
- 'compactor:8006'
- 'query-frontend:8007'
- 'store-gateway-1:8008'
- 'store-gateway-2:8009'
- 'query-scheduler:8011'
- 'query-scheduler:8008'
- 'store-gateway-1:8011'
- 'store-gateway-2:8012'
- 'store-gateway-3:8013'
- 'memcached-exporter:9150'
- 'continuous-test:8090'
- 'load-generator:9900'
labels:
cluster: 'docker-compose'
namespace: 'mimir-microservices-mode'
Expand Down
28 changes: 11 additions & 17 deletions development/mimir-microservices-mode/docker-compose.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ std.manifestYamlDoc({
self.distributor +
self.ingesters +
self.read_components + // Querier, Frontend and query-scheduler, if enabled.
self.store_gateways +
self.store_gateways(3) +
self.compactor +
self.rulers(2) +
self.alertmanagers(3) +
Expand Down Expand Up @@ -113,7 +113,7 @@ std.manifestYamlDoc({
httpPort: 8005,
extraArguments:
// Use of scheduler is activated by `-querier.scheduler-address` option and setting -querier.frontend-address option to nothing.
if $._config.use_query_scheduler then '-querier.scheduler-address=query-scheduler:9011 -querier.frontend-address=' else '',
if $._config.use_query_scheduler then '-querier.scheduler-address=query-scheduler:9008 -querier.frontend-address=' else '',
}),

'query-frontend': mimirService({
Expand All @@ -124,14 +124,14 @@ std.manifestYamlDoc({
extraArguments:
'-query-frontend.max-total-query-length=8760h' +
// Use of scheduler is activated by `-query-frontend.scheduler-address` option.
(if $._config.use_query_scheduler then ' -query-frontend.scheduler-address=query-scheduler:9011' else ''),
(if $._config.use_query_scheduler then ' -query-frontend.scheduler-address=query-scheduler:9008' else ''),
}),
} + (
if $._config.use_query_scheduler then {
'query-scheduler': mimirService({
name: 'query-scheduler',
target: 'query-scheduler',
httpPort: 8011,
httpPort: 8008,
extraArguments: '-query-frontend.max-total-query-length=8760h',
}),
} else {}
Expand Down Expand Up @@ -167,20 +167,14 @@ std.manifestYamlDoc({
for id in std.range(1, count)
},

store_gateways:: {
'store-gateway-1': mimirService({
name: 'store-gateway-1',
store_gateways(count):: {
['store-gateway-%d' % id]: mimirService({
name: 'store-gateway-' + id,
target: 'store-gateway',
httpPort: 8008,
jaegerApp: 'store-gateway-1',
}),

'store-gateway-2': mimirService({
name: 'store-gateway-2',
target: 'store-gateway',
httpPort: 8009,
jaegerApp: 'store-gateway-2',
}),
httpPort: 8010 + id,
jaegerApp: 'store-gateway-%d' % id,
})
for id in std.range(1, count)
},

continuous_test:: {
Expand Down
48 changes: 37 additions & 11 deletions development/mimir-microservices-mode/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@
"command":
- "sh"
- "-c"
- "sleep 3 && exec ./mimir -config.file=./config/mimir.yaml -target=querier -server.http-listen-port=8005 -server.grpc-listen-port=9005 -activity-tracker.filepath=/activity/querier-8005 -querier.scheduler-address=query-scheduler:9011 -querier.frontend-address= -memberlist.nodename=querier -memberlist.bind-port=10005 -ingester.ring.store=memberlist -distributor.ring.store=memberlist -compactor.ring.store=memberlist -store-gateway.sharding-ring.store=memberlist -ruler.ring.store=memberlist -alertmanager.sharding-ring.store=memberlist -blocks-storage.bucket-store.index-cache.backend=memcached -blocks-storage.bucket-store.chunks-cache.backend=memcached -blocks-storage.bucket-store.metadata-cache.backend=memcached -query-frontend.results-cache.backend=memcached -ruler-storage.cache.backend=memcached -blocks-storage.bucket-store.index-cache.memcached.addresses=dns+memcached:11211 -blocks-storage.bucket-store.chunks-cache.memcached.addresses=dns+memcached:11211 -blocks-storage.bucket-store.metadata-cache.memcached.addresses=dns+memcached:11211 -query-frontend.results-cache.memcached.addresses=dns+memcached:11211 -ruler-storage.cache.memcached.addresses=dns+memcached:11211"
- "sleep 3 && exec ./mimir -config.file=./config/mimir.yaml -target=querier -server.http-listen-port=8005 -server.grpc-listen-port=9005 -activity-tracker.filepath=/activity/querier-8005 -querier.scheduler-address=query-scheduler:9008 -querier.frontend-address= -memberlist.nodename=querier -memberlist.bind-port=10005 -ingester.ring.store=memberlist -distributor.ring.store=memberlist -compactor.ring.store=memberlist -store-gateway.sharding-ring.store=memberlist -ruler.ring.store=memberlist -alertmanager.sharding-ring.store=memberlist -blocks-storage.bucket-store.index-cache.backend=memcached -blocks-storage.bucket-store.chunks-cache.backend=memcached -blocks-storage.bucket-store.metadata-cache.backend=memcached -query-frontend.results-cache.backend=memcached -ruler-storage.cache.backend=memcached -blocks-storage.bucket-store.index-cache.memcached.addresses=dns+memcached:11211 -blocks-storage.bucket-store.chunks-cache.memcached.addresses=dns+memcached:11211 -blocks-storage.bucket-store.metadata-cache.memcached.addresses=dns+memcached:11211 -query-frontend.results-cache.memcached.addresses=dns+memcached:11211 -ruler-storage.cache.memcached.addresses=dns+memcached:11211"
"depends_on":
- "minio"
- "distributor-1"
Expand All @@ -391,7 +391,7 @@
"command":
- "sh"
- "-c"
- "sleep 3 && exec ./mimir -config.file=./config/mimir.yaml -target=query-frontend -server.http-listen-port=8007 -server.grpc-listen-port=9007 -activity-tracker.filepath=/activity/query-frontend-8007 -query-frontend.max-total-query-length=8760h -query-frontend.scheduler-address=query-scheduler:9011 -memberlist.nodename=query-frontend -memberlist.bind-port=10007 -ingester.ring.store=memberlist -distributor.ring.store=memberlist -compactor.ring.store=memberlist -store-gateway.sharding-ring.store=memberlist -ruler.ring.store=memberlist -alertmanager.sharding-ring.store=memberlist -blocks-storage.bucket-store.index-cache.backend=memcached -blocks-storage.bucket-store.chunks-cache.backend=memcached -blocks-storage.bucket-store.metadata-cache.backend=memcached -query-frontend.results-cache.backend=memcached -ruler-storage.cache.backend=memcached -blocks-storage.bucket-store.index-cache.memcached.addresses=dns+memcached:11211 -blocks-storage.bucket-store.chunks-cache.memcached.addresses=dns+memcached:11211 -blocks-storage.bucket-store.metadata-cache.memcached.addresses=dns+memcached:11211 -query-frontend.results-cache.memcached.addresses=dns+memcached:11211 -ruler-storage.cache.memcached.addresses=dns+memcached:11211"
- "sleep 3 && exec ./mimir -config.file=./config/mimir.yaml -target=query-frontend -server.http-listen-port=8007 -server.grpc-listen-port=9007 -activity-tracker.filepath=/activity/query-frontend-8007 -query-frontend.max-total-query-length=8760h -query-frontend.scheduler-address=query-scheduler:9008 -memberlist.nodename=query-frontend -memberlist.bind-port=10007 -ingester.ring.store=memberlist -distributor.ring.store=memberlist -compactor.ring.store=memberlist -store-gateway.sharding-ring.store=memberlist -ruler.ring.store=memberlist -alertmanager.sharding-ring.store=memberlist -blocks-storage.bucket-store.index-cache.backend=memcached -blocks-storage.bucket-store.chunks-cache.backend=memcached -blocks-storage.bucket-store.metadata-cache.backend=memcached -query-frontend.results-cache.backend=memcached -ruler-storage.cache.backend=memcached -blocks-storage.bucket-store.index-cache.memcached.addresses=dns+memcached:11211 -blocks-storage.bucket-store.chunks-cache.memcached.addresses=dns+memcached:11211 -blocks-storage.bucket-store.metadata-cache.memcached.addresses=dns+memcached:11211 -query-frontend.results-cache.memcached.addresses=dns+memcached:11211 -ruler-storage.cache.memcached.addresses=dns+memcached:11211"
"depends_on":
- "minio"
- "distributor-1"
Expand All @@ -417,7 +417,7 @@
"command":
- "sh"
- "-c"
- "sleep 3 && exec ./mimir -config.file=./config/mimir.yaml -target=query-scheduler -server.http-listen-port=8011 -server.grpc-listen-port=9011 -activity-tracker.filepath=/activity/query-scheduler-8011 -query-frontend.max-total-query-length=8760h -memberlist.nodename=query-scheduler -memberlist.bind-port=10011 -ingester.ring.store=memberlist -distributor.ring.store=memberlist -compactor.ring.store=memberlist -store-gateway.sharding-ring.store=memberlist -ruler.ring.store=memberlist -alertmanager.sharding-ring.store=memberlist -blocks-storage.bucket-store.index-cache.backend=memcached -blocks-storage.bucket-store.chunks-cache.backend=memcached -blocks-storage.bucket-store.metadata-cache.backend=memcached -query-frontend.results-cache.backend=memcached -ruler-storage.cache.backend=memcached -blocks-storage.bucket-store.index-cache.memcached.addresses=dns+memcached:11211 -blocks-storage.bucket-store.chunks-cache.memcached.addresses=dns+memcached:11211 -blocks-storage.bucket-store.metadata-cache.memcached.addresses=dns+memcached:11211 -query-frontend.results-cache.memcached.addresses=dns+memcached:11211 -ruler-storage.cache.memcached.addresses=dns+memcached:11211"
- "sleep 3 && exec ./mimir -config.file=./config/mimir.yaml -target=query-scheduler -server.http-listen-port=8008 -server.grpc-listen-port=9008 -activity-tracker.filepath=/activity/query-scheduler-8008 -query-frontend.max-total-query-length=8760h -memberlist.nodename=query-scheduler -memberlist.bind-port=10008 -ingester.ring.store=memberlist -distributor.ring.store=memberlist -compactor.ring.store=memberlist -store-gateway.sharding-ring.store=memberlist -ruler.ring.store=memberlist -alertmanager.sharding-ring.store=memberlist -blocks-storage.bucket-store.index-cache.backend=memcached -blocks-storage.bucket-store.chunks-cache.backend=memcached -blocks-storage.bucket-store.metadata-cache.backend=memcached -query-frontend.results-cache.backend=memcached -ruler-storage.cache.backend=memcached -blocks-storage.bucket-store.index-cache.memcached.addresses=dns+memcached:11211 -blocks-storage.bucket-store.chunks-cache.memcached.addresses=dns+memcached:11211 -blocks-storage.bucket-store.metadata-cache.memcached.addresses=dns+memcached:11211 -query-frontend.results-cache.memcached.addresses=dns+memcached:11211 -ruler-storage.cache.memcached.addresses=dns+memcached:11211"
"depends_on":
- "minio"
- "distributor-1"
Expand All @@ -431,8 +431,8 @@
"hostname": "query-scheduler"
"image": "mimir"
"ports":
- "8011:8011"
- "10011:10011"
- "8008:8008"
- "10008:10008"
"volumes":
- "./config:/mimir/config"
- "./activity:/activity"
Expand Down Expand Up @@ -495,7 +495,7 @@
"command":
- "sh"
- "-c"
- "sleep 3 && exec ./mimir -config.file=./config/mimir.yaml -target=store-gateway -server.http-listen-port=8008 -server.grpc-listen-port=9008 -activity-tracker.filepath=/activity/store-gateway-8008 -memberlist.nodename=store-gateway-1 -memberlist.bind-port=10008 -ingester.ring.store=memberlist -distributor.ring.store=memberlist -compactor.ring.store=memberlist -store-gateway.sharding-ring.store=memberlist -ruler.ring.store=memberlist -alertmanager.sharding-ring.store=memberlist -blocks-storage.bucket-store.index-cache.backend=memcached -blocks-storage.bucket-store.chunks-cache.backend=memcached -blocks-storage.bucket-store.metadata-cache.backend=memcached -query-frontend.results-cache.backend=memcached -ruler-storage.cache.backend=memcached -blocks-storage.bucket-store.index-cache.memcached.addresses=dns+memcached:11211 -blocks-storage.bucket-store.chunks-cache.memcached.addresses=dns+memcached:11211 -blocks-storage.bucket-store.metadata-cache.memcached.addresses=dns+memcached:11211 -query-frontend.results-cache.memcached.addresses=dns+memcached:11211 -ruler-storage.cache.memcached.addresses=dns+memcached:11211"
- "sleep 3 && exec ./mimir -config.file=./config/mimir.yaml -target=store-gateway -server.http-listen-port=8011 -server.grpc-listen-port=9011 -activity-tracker.filepath=/activity/store-gateway-8011 -memberlist.nodename=store-gateway-1 -memberlist.bind-port=10011 -ingester.ring.store=memberlist -distributor.ring.store=memberlist -compactor.ring.store=memberlist -store-gateway.sharding-ring.store=memberlist -ruler.ring.store=memberlist -alertmanager.sharding-ring.store=memberlist -blocks-storage.bucket-store.index-cache.backend=memcached -blocks-storage.bucket-store.chunks-cache.backend=memcached -blocks-storage.bucket-store.metadata-cache.backend=memcached -query-frontend.results-cache.backend=memcached -ruler-storage.cache.backend=memcached -blocks-storage.bucket-store.index-cache.memcached.addresses=dns+memcached:11211 -blocks-storage.bucket-store.chunks-cache.memcached.addresses=dns+memcached:11211 -blocks-storage.bucket-store.metadata-cache.memcached.addresses=dns+memcached:11211 -query-frontend.results-cache.memcached.addresses=dns+memcached:11211 -ruler-storage.cache.memcached.addresses=dns+memcached:11211"
"depends_on":
- "minio"
- "distributor-1"
Expand All @@ -509,8 +509,8 @@
"hostname": "store-gateway-1"
"image": "mimir"
"ports":
- "8008:8008"
- "10008:10008"
- "8011:8011"
- "10011:10011"
"volumes":
- "./config:/mimir/config"
- "./activity:/activity"
Expand All @@ -521,7 +521,7 @@
"command":
- "sh"
- "-c"
- "sleep 3 && exec ./mimir -config.file=./config/mimir.yaml -target=store-gateway -server.http-listen-port=8009 -server.grpc-listen-port=9009 -activity-tracker.filepath=/activity/store-gateway-8009 -memberlist.nodename=store-gateway-2 -memberlist.bind-port=10009 -ingester.ring.store=memberlist -distributor.ring.store=memberlist -compactor.ring.store=memberlist -store-gateway.sharding-ring.store=memberlist -ruler.ring.store=memberlist -alertmanager.sharding-ring.store=memberlist -blocks-storage.bucket-store.index-cache.backend=memcached -blocks-storage.bucket-store.chunks-cache.backend=memcached -blocks-storage.bucket-store.metadata-cache.backend=memcached -query-frontend.results-cache.backend=memcached -ruler-storage.cache.backend=memcached -blocks-storage.bucket-store.index-cache.memcached.addresses=dns+memcached:11211 -blocks-storage.bucket-store.chunks-cache.memcached.addresses=dns+memcached:11211 -blocks-storage.bucket-store.metadata-cache.memcached.addresses=dns+memcached:11211 -query-frontend.results-cache.memcached.addresses=dns+memcached:11211 -ruler-storage.cache.memcached.addresses=dns+memcached:11211"
- "sleep 3 && exec ./mimir -config.file=./config/mimir.yaml -target=store-gateway -server.http-listen-port=8012 -server.grpc-listen-port=9012 -activity-tracker.filepath=/activity/store-gateway-8012 -memberlist.nodename=store-gateway-2 -memberlist.bind-port=10012 -ingester.ring.store=memberlist -distributor.ring.store=memberlist -compactor.ring.store=memberlist -store-gateway.sharding-ring.store=memberlist -ruler.ring.store=memberlist -alertmanager.sharding-ring.store=memberlist -blocks-storage.bucket-store.index-cache.backend=memcached -blocks-storage.bucket-store.chunks-cache.backend=memcached -blocks-storage.bucket-store.metadata-cache.backend=memcached -query-frontend.results-cache.backend=memcached -ruler-storage.cache.backend=memcached -blocks-storage.bucket-store.index-cache.memcached.addresses=dns+memcached:11211 -blocks-storage.bucket-store.chunks-cache.memcached.addresses=dns+memcached:11211 -blocks-storage.bucket-store.metadata-cache.memcached.addresses=dns+memcached:11211 -query-frontend.results-cache.memcached.addresses=dns+memcached:11211 -ruler-storage.cache.memcached.addresses=dns+memcached:11211"
"depends_on":
- "minio"
- "distributor-1"
Expand All @@ -535,8 +535,34 @@
"hostname": "store-gateway-2"
"image": "mimir"
"ports":
- "8009:8009"
- "10009:10009"
- "8012:8012"
- "10012:10012"
"volumes":
- "./config:/mimir/config"
- "./activity:/activity"
"store-gateway-3":
"build":
"context": "."
"dockerfile": "dev.dockerfile"
"command":
- "sh"
- "-c"
- "sleep 3 && exec ./mimir -config.file=./config/mimir.yaml -target=store-gateway -server.http-listen-port=8013 -server.grpc-listen-port=9013 -activity-tracker.filepath=/activity/store-gateway-8013 -memberlist.nodename=store-gateway-3 -memberlist.bind-port=10013 -ingester.ring.store=memberlist -distributor.ring.store=memberlist -compactor.ring.store=memberlist -store-gateway.sharding-ring.store=memberlist -ruler.ring.store=memberlist -alertmanager.sharding-ring.store=memberlist -blocks-storage.bucket-store.index-cache.backend=memcached -blocks-storage.bucket-store.chunks-cache.backend=memcached -blocks-storage.bucket-store.metadata-cache.backend=memcached -query-frontend.results-cache.backend=memcached -ruler-storage.cache.backend=memcached -blocks-storage.bucket-store.index-cache.memcached.addresses=dns+memcached:11211 -blocks-storage.bucket-store.chunks-cache.memcached.addresses=dns+memcached:11211 -blocks-storage.bucket-store.metadata-cache.memcached.addresses=dns+memcached:11211 -query-frontend.results-cache.memcached.addresses=dns+memcached:11211 -ruler-storage.cache.memcached.addresses=dns+memcached:11211"
"depends_on":
- "minio"
- "distributor-1"
"environment":
- "JAEGER_AGENT_HOST=jaeger"
- "JAEGER_AGENT_PORT=6831"
- "JAEGER_REPORTER_MAX_QUEUE_SIZE=1000"
- "JAEGER_SAMPLER_PARAM=1"
- "JAEGER_SAMPLER_TYPE=const"
- "JAEGER_TAGS=app=store-gateway-3"
"hostname": "store-gateway-3"
"image": "mimir"
"ports":
- "8013:8013"
- "10013:10013"
"volumes":
- "./config:/mimir/config"
- "./activity:/activity"

0 comments on commit 05bf44a

Please sign in to comment.