From 086f701f1b5f945832a64400d32862073f73fa10 Mon Sep 17 00:00:00 2001 From: Marco Pracucci Date: Thu, 25 Aug 2022 15:41:49 +0200 Subject: [PATCH] Use default HTTP and gRPC ports in the read-write local dev env Signed-off-by: Marco Pracucci --- .../config/grafana-agent.yaml | 8 ++-- .../mimir-read-write-mode/config/mimir.yaml | 6 +-- .../docker-compose.jsonnet | 26 +++++------- .../mimir-read-write-mode/docker-compose.yml | 42 +++++++------------ 4 files changed, 32 insertions(+), 50 deletions(-) diff --git a/development/mimir-read-write-mode/config/grafana-agent.yaml b/development/mimir-read-write-mode/config/grafana-agent.yaml index 5a03fd222f0..b3602e5f0ac 100644 --- a/development/mimir-read-write-mode/config/grafana-agent.yaml +++ b/development/mimir-read-write-mode/config/grafana-agent.yaml @@ -11,22 +11,22 @@ prometheus: scrape_configs: - job_name: mimir-read-write-mode/mimir-write static_configs: - - targets: ['mimir-write-1:8001', 'mimir-write-2:8002', 'mimir-write-3:8003'] + - targets: ['mimir-write-1:8080', 'mimir-write-2:8080', 'mimir-write-3:8080'] labels: cluster: 'docker-compose' namespace: 'mimir-read-write-mode' - job_name: mimir-read-write-mode/mimir-read static_configs: - - targets: ['mimir-read-1:8004', 'mimir-read-2:8005'] + - targets: ['mimir-read-1:8080', 'mimir-read-2:8080'] labels: cluster: 'docker-compose' namespace: 'mimir-read-write-mode' - job_name: mimir-read-write-mode/mimir-backend static_configs: - - targets: ['mimir-backend-1:8006', 'mimir-backend-2:8007'] + - targets: ['mimir-backend-1:8080', 'mimir-backend-2:8080'] labels: cluster: 'docker-compose' namespace: 'mimir-read-write-mode' remote_write: - - url: http://mimir-write-1:8001/api/v1/push + - url: http://mimir-write-1:8080/api/v1/push diff --git a/development/mimir-read-write-mode/config/mimir.yaml b/development/mimir-read-write-mode/config/mimir.yaml index ad89fb37978..d13206bf712 100644 --- a/development/mimir-read-write-mode/config/mimir.yaml +++ b/development/mimir-read-write-mode/config/mimir.yaml @@ -39,7 +39,7 @@ memberlist: ruler: rule_path: /data/ruler # Each ruler is configured to route alerts to the Alertmanager running within the same component. - alertmanager_url: http://mimir-backend-1:8006/alertmanager + alertmanager_url: http://localhost:8080/alertmanager ruler_storage: s3: @@ -48,12 +48,12 @@ ruler_storage: frontend: # Currently we can't specify multiple addresses, so we're just using a single replica for the query-scheduler. # See: https://github.com/grafana/mimir/issues/2012 - scheduler_address: "mimir-backend-1:9006" + scheduler_address: "mimir-backend-1:9095" frontend_worker: # Currently we can't specify multiple addresses, so we're just using a single replica for the query-scheduler. # See: https://github.com/grafana/mimir/issues/2012 - scheduler_address: "mimir-backend-1:9006" + scheduler_address: "mimir-backend-1:9095" alertmanager: data_dir: /data/alertmanager diff --git a/development/mimir-read-write-mode/docker-compose.jsonnet b/development/mimir-read-write-mode/docker-compose.jsonnet index 277349b9f34..305624e2f8d 100644 --- a/development/mimir-read-write-mode/docker-compose.jsonnet +++ b/development/mimir-read-write-mode/docker-compose.jsonnet @@ -13,19 +13,19 @@ std.manifestYamlDoc({ 'mimir-write-1': mimirService({ name: 'mimir-write-1', target: 'write', - httpPort: 8001, + publishedHttpPort: 8001, extraVolumes: ['.data-mimir-write-1:/data:delegated'], }), 'mimir-write-2': mimirService({ name: 'mimir-write-2', target: 'write', - httpPort: 8002, + publishedHttpPort: 8002, extraVolumes: ['.data-mimir-write-2:/data:delegated'], }), 'mimir-write-3': mimirService({ name: 'mimir-write-3', target: 'write', - httpPort: 8003, + publishedHttpPort: 8003, extraVolumes: ['.data-mimir-write-3:/data:delegated'], }), }, @@ -34,12 +34,12 @@ std.manifestYamlDoc({ 'mimir-read-1': mimirService({ name: 'mimir-read-1', target: 'read', - httpPort: 8004, + publishedHttpPort: 8004, }), 'mimir-read-2': mimirService({ name: 'mimir-read-2', target: 'read', - httpPort: 8005, + publishedHttpPort: 8005, }), }, @@ -47,12 +47,12 @@ std.manifestYamlDoc({ 'mimir-backend-1': mimirService({ name: 'mimir-backend-1', target: 'backend', - httpPort: 8006, + publishedHttpPort: 8006, }), 'mimir-backend-2': mimirService({ name: 'mimir-backend-2', target: 'backend', - httpPort: 8007, + publishedHttpPort: 8007, }), }, @@ -84,18 +84,16 @@ std.manifestYamlDoc({ }, // This function builds docker-compose declaration for Mimir service. - // Default grpcPort is (httpPort + 1000). local mimirService(serviceOptions) = { local defaultOptions = { local s = self, name: error 'missing name', target: error 'missing target', - httpPort: error 'missing httpPort', - grpcPort: self.httpPort + 1000, + publishedHttpPort: error 'missing publishedHttpPort', dependsOn: ['minio'], env: {}, extraVolumes: [], - memberlistBindPort: self.httpPort + 2000, + memberlistBindPort: self.publishedHttpPort + 2000, }, local options = defaultOptions + serviceOptions, @@ -109,9 +107,7 @@ std.manifestYamlDoc({ './mimir', '-config.file=./config/mimir.yaml' % options, '-target=%(target)s' % options, - '-server.http-listen-port=%(httpPort)d' % options, - '-server.grpc-listen-port=%(grpcPort)d' % options, - '-activity-tracker.filepath=/activity/%(target)s-%(httpPort)d' % options, + '-activity-tracker.filepath=/activity/%(name)s' % options, ], environment: [ '%s=%s' % [key, options.env[key]] @@ -120,7 +116,7 @@ std.manifestYamlDoc({ ], hostname: options.name, // Only publish HTTP port, but not gRPC one. - ports: ['%d:%d' % [options.httpPort, options.httpPort]], + ports: ['%d:8080' % options.publishedHttpPort], depends_on: options.dependsOn, volumes: ['./config:/mimir/config', './activity:/activity'] + options.extraVolumes, }, diff --git a/development/mimir-read-write-mode/docker-compose.yml b/development/mimir-read-write-mode/docker-compose.yml index c6ac517c49f..dc41af67cc8 100644 --- a/development/mimir-read-write-mode/docker-compose.yml +++ b/development/mimir-read-write-mode/docker-compose.yml @@ -18,16 +18,14 @@ - "./mimir" - "-config.file=./config/mimir.yaml" - "-target=backend" - - "-server.http-listen-port=8006" - - "-server.grpc-listen-port=9006" - - "-activity-tracker.filepath=/activity/backend-8006" + - "-activity-tracker.filepath=/activity/mimir-backend-1" "depends_on": - "minio" "environment": [] "hostname": "mimir-backend-1" "image": "mimir" "ports": - - "8006:8006" + - "8006:8080" "volumes": - "./config:/mimir/config" - "./activity:/activity" @@ -39,16 +37,14 @@ - "./mimir" - "-config.file=./config/mimir.yaml" - "-target=backend" - - "-server.http-listen-port=8007" - - "-server.grpc-listen-port=9007" - - "-activity-tracker.filepath=/activity/backend-8007" + - "-activity-tracker.filepath=/activity/mimir-backend-2" "depends_on": - "minio" "environment": [] "hostname": "mimir-backend-2" "image": "mimir" "ports": - - "8007:8007" + - "8007:8080" "volumes": - "./config:/mimir/config" - "./activity:/activity" @@ -60,16 +56,14 @@ - "./mimir" - "-config.file=./config/mimir.yaml" - "-target=read" - - "-server.http-listen-port=8004" - - "-server.grpc-listen-port=9004" - - "-activity-tracker.filepath=/activity/read-8004" + - "-activity-tracker.filepath=/activity/mimir-read-1" "depends_on": - "minio" "environment": [] "hostname": "mimir-read-1" "image": "mimir" "ports": - - "8004:8004" + - "8004:8080" "volumes": - "./config:/mimir/config" - "./activity:/activity" @@ -81,16 +75,14 @@ - "./mimir" - "-config.file=./config/mimir.yaml" - "-target=read" - - "-server.http-listen-port=8005" - - "-server.grpc-listen-port=9005" - - "-activity-tracker.filepath=/activity/read-8005" + - "-activity-tracker.filepath=/activity/mimir-read-2" "depends_on": - "minio" "environment": [] "hostname": "mimir-read-2" "image": "mimir" "ports": - - "8005:8005" + - "8005:8080" "volumes": - "./config:/mimir/config" - "./activity:/activity" @@ -102,16 +94,14 @@ - "./mimir" - "-config.file=./config/mimir.yaml" - "-target=write" - - "-server.http-listen-port=8001" - - "-server.grpc-listen-port=9001" - - "-activity-tracker.filepath=/activity/write-8001" + - "-activity-tracker.filepath=/activity/mimir-write-1" "depends_on": - "minio" "environment": [] "hostname": "mimir-write-1" "image": "mimir" "ports": - - "8001:8001" + - "8001:8080" "volumes": - "./config:/mimir/config" - "./activity:/activity" @@ -124,16 +114,14 @@ - "./mimir" - "-config.file=./config/mimir.yaml" - "-target=write" - - "-server.http-listen-port=8002" - - "-server.grpc-listen-port=9002" - - "-activity-tracker.filepath=/activity/write-8002" + - "-activity-tracker.filepath=/activity/mimir-write-2" "depends_on": - "minio" "environment": [] "hostname": "mimir-write-2" "image": "mimir" "ports": - - "8002:8002" + - "8002:8080" "volumes": - "./config:/mimir/config" - "./activity:/activity" @@ -146,16 +134,14 @@ - "./mimir" - "-config.file=./config/mimir.yaml" - "-target=write" - - "-server.http-listen-port=8003" - - "-server.grpc-listen-port=9003" - - "-activity-tracker.filepath=/activity/write-8003" + - "-activity-tracker.filepath=/activity/mimir-write-3" "depends_on": - "minio" "environment": [] "hostname": "mimir-write-3" "image": "mimir" "ports": - - "8003:8003" + - "8003:8080" "volumes": - "./config:/mimir/config" - "./activity:/activity"