forked from cortexproject/cortex
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add docker-compose setup using gossip. (cortexproject#3578)
Signed-off-by: Peter Štibraný <[email protected]>
- Loading branch information
Showing
15 changed files
with
646 additions
and
0 deletions.
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
development/tsdb-blocks-storage-s3-gossip/.data-ingester-1/.gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
* | ||
!.gitignore |
2 changes: 2 additions & 0 deletions
2
development/tsdb-blocks-storage-s3-gossip/.data-ingester-2/.gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
* | ||
!.gitignore |
5 changes: 5 additions & 0 deletions
5
development/tsdb-blocks-storage-s3-gossip/.data-minio/.gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
* | ||
!.gitignore | ||
!cortex-tsdb | ||
!cortex-alertmanager | ||
!cortex-ruler |
2 changes: 2 additions & 0 deletions
2
development/tsdb-blocks-storage-s3-gossip/.data-minio/cortex-alertmanager/.gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
* | ||
!.gitignore |
2 changes: 2 additions & 0 deletions
2
development/tsdb-blocks-storage-s3-gossip/.data-minio/cortex-ruler/.gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
* | ||
!.gitignore |
2 changes: 2 additions & 0 deletions
2
development/tsdb-blocks-storage-s3-gossip/.data-minio/cortex-tsdb/.gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
* | ||
!.gitignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.data-configstore | ||
.data-ingester-1 | ||
.data-ingester-2 | ||
.data-minio |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
cortex |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
|
||
SCRIPT_DIR=$(cd `dirname $0` && pwd) | ||
|
||
docker-compose -f ${SCRIPT_DIR}/docker-compose.yml down |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
SCRIPT_DIR=$(cd `dirname $0` && pwd) | ||
|
||
# -gcflags "all=-N -l" disables optimizations that allow for better run with combination with Delve debugger. | ||
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -mod=vendor -gcflags "all=-N -l" -o ${SCRIPT_DIR}/cortex ${SCRIPT_DIR}/../../cmd/cortex | ||
docker-compose -f ${SCRIPT_DIR}/docker-compose.yml build distributor | ||
docker-compose -f ${SCRIPT_DIR}/docker-compose.yml up $@ |
142 changes: 142 additions & 0 deletions
142
development/tsdb-blocks-storage-s3-gossip/config/cortex.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
auth_enabled: false | ||
|
||
distributor: | ||
shard_by_all_labels: true | ||
pool: | ||
health_check_ingesters: true | ||
|
||
ingester_client: | ||
grpc_client_config: | ||
# Configure the client to allow messages up to 100MB. | ||
max_recv_msg_size: 104857600 | ||
max_send_msg_size: 104857600 | ||
grpc_compression: gzip | ||
|
||
ingester: | ||
lifecycler: | ||
# We want to start immediately. | ||
join_after: 0 | ||
final_sleep: 0s | ||
num_tokens: 512 | ||
|
||
ring: | ||
kvstore: | ||
store: memberlist | ||
replication_factor: 1 | ||
|
||
memberlist: | ||
join_members: | ||
- distributor:10001 | ||
- ingester-1:10002 | ||
- ingester-2:10003 | ||
- querier:10004 | ||
- ruler-1:10021 | ||
- ruler-2:10022 | ||
- querier-with-scheduler:10013 | ||
abort_if_cluster_join_fails: false | ||
|
||
querier: | ||
query_ingesters_within: 3h | ||
|
||
# Used when the blocks sharding is disabled. | ||
store_gateway_addresses: store-gateway-1:9008,store-gateway-2:9009 | ||
|
||
blocks_storage: | ||
backend: s3 | ||
|
||
tsdb: | ||
dir: /tmp/cortex-tsdb-ingester | ||
ship_interval: 1m | ||
block_ranges_period: [ 2h ] | ||
retention_period: 3h | ||
|
||
bucket_store: | ||
sync_dir: /tmp/cortex-tsdb-querier | ||
consistency_delay: 5s | ||
|
||
index_cache: | ||
backend: memcached | ||
memcached: | ||
addresses: dns+memcached:11211 | ||
|
||
chunks_cache: | ||
backend: memcached | ||
memcached: | ||
addresses: dns+memcached:11211 | ||
|
||
metadata_cache: | ||
backend: memcached | ||
memcached: | ||
addresses: dns+memcached:11211 | ||
|
||
s3: | ||
endpoint: minio:9000 | ||
bucket_name: cortex-tsdb | ||
access_key_id: cortex | ||
secret_access_key: supersecret | ||
insecure: true | ||
|
||
ruler: | ||
enable_api: true | ||
storage: | ||
type: s3 | ||
s3: | ||
bucketnames: cortex-ruler | ||
s3forcepathstyle: true | ||
s3: http://cortex:supersecret@minio.:9000 | ||
enable_sharding: true | ||
ring: | ||
heartbeat_period: 5s | ||
heartbeat_timeout: 15s | ||
kvstore: | ||
store: consul | ||
consul: | ||
host: consul:8500 | ||
|
||
alertmanager: | ||
enable_api: true | ||
storage: | ||
type: s3 | ||
s3: | ||
bucketnames: cortex-alertmanager | ||
s3forcepathstyle: true | ||
s3: http://cortex:supersecret@minio.:9000 | ||
|
||
storage: | ||
engine: blocks | ||
|
||
compactor: | ||
compaction_interval: 30s | ||
data_dir: /tmp/cortex-compactor | ||
consistency_delay: 1m | ||
sharding_enabled: true | ||
sharding_ring: | ||
kvstore: | ||
store: consul | ||
consul: | ||
host: consul:8500 | ||
|
||
store_gateway: | ||
sharding_enabled: true | ||
sharding_ring: | ||
replication_factor: 1 | ||
heartbeat_period: 5s | ||
heartbeat_timeout: 15s | ||
kvstore: | ||
store: consul | ||
consul: | ||
host: consul:8500 | ||
|
||
frontend_worker: | ||
frontend_address: "query-frontend:9007" | ||
match_max_concurrent: true | ||
|
||
# By setting scheduler_address, querier worker would use scheduler instead of frontend. | ||
# scheduler_address: "query-scheduler:9012" | ||
|
||
query_range: | ||
split_queries_by_interval: 24h | ||
|
||
limits: | ||
# Limit max query time range to 31d | ||
max_query_length: 744h |
64 changes: 64 additions & 0 deletions
64
development/tsdb-blocks-storage-s3-gossip/config/grafana-agent.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
server: | ||
log_level: debug | ||
http_listen_port: 9091 | ||
|
||
prometheus: | ||
global: | ||
scrape_interval: 5s | ||
external_labels: | ||
scraped_by: grafana-agent | ||
configs: | ||
- name: local | ||
host_filter: false | ||
scrape_configs: | ||
- job_name: tsdb-blocks-storage-s3/distributor | ||
static_configs: | ||
- targets: ['distributor:8001'] | ||
labels: | ||
cluster: 'docker-compose' | ||
namespace: 'tsdb-blocks-storage-s3' | ||
- job_name: tsdb-blocks-storage-s3/ingester | ||
static_configs: | ||
- targets: ['ingester-1:8002', 'ingester-2:8003'] | ||
labels: | ||
cluster: 'docker-compose' | ||
namespace: 'tsdb-blocks-storage-s3' | ||
- job_name: tsdb-blocks-storage-s3/querier | ||
static_configs: | ||
- targets: ['querier:8004', 'querier-with-scheduler:8013'] | ||
labels: | ||
cluster: 'docker-compose' | ||
namespace: 'tsdb-blocks-storage-s3' | ||
- job_name: tsdb-blocks-storage-s3/ruler | ||
static_configs: | ||
- targets: ['ruler-1:8021', 'ruler-2:8022'] | ||
labels: | ||
cluster: 'docker-compose' | ||
namespace: 'tsdb-blocks-storage-s3' | ||
- job_name: tsdb-blocks-storage-s3/compactor | ||
static_configs: | ||
- targets: ['compactor:8006'] | ||
labels: | ||
cluster: 'docker-compose' | ||
namespace: 'tsdb-blocks-storage-s3' | ||
- job_name: tsdb-blocks-storage-s3/query-frontend | ||
static_configs: | ||
- targets: ['query-frontend:8007', 'query-frontend-with-scheduler:8012'] | ||
labels: | ||
cluster: 'docker-compose' | ||
namespace: 'tsdb-blocks-storage-s3' | ||
- job_name: tsdb-blocks-storage-s3/store-gateway | ||
static_configs: | ||
- targets: ['store-gateway-1:8008', 'store-gateway-2:8009'] | ||
labels: | ||
cluster: 'docker-compose' | ||
namespace: 'tsdb-blocks-storage-s3' | ||
- job_name: tsdb-blocks-storage-s3/query-scheduler | ||
static_configs: | ||
- targets: ['query-scheduler:8011'] | ||
labels: | ||
cluster: 'docker-compose' | ||
namespace: 'tsdb-blocks-storage-s3' | ||
|
||
remote_write: | ||
- url: http://distributor:8001/api/prom/push |
57 changes: 57 additions & 0 deletions
57
development/tsdb-blocks-storage-s3-gossip/config/prometheus.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
global: | ||
scrape_interval: 5s | ||
external_labels: | ||
scraped_by: prometheus | ||
|
||
scrape_configs: | ||
- job_name: tsdb-blocks-storage-s3/distributor | ||
static_configs: | ||
- targets: ['distributor:8001'] | ||
labels: | ||
cluster: 'docker-compose' | ||
namespace: 'tsdb-blocks-storage-s3' | ||
- job_name: tsdb-blocks-storage-s3/ingester | ||
static_configs: | ||
- targets: ['ingester-1:8002', 'ingester-2:8003'] | ||
labels: | ||
cluster: 'docker-compose' | ||
namespace: 'tsdb-blocks-storage-s3' | ||
- job_name: tsdb-blocks-storage-s3/querier | ||
static_configs: | ||
- targets: ['querier:8004', 'query-frontend-with-scheduler:8013'] | ||
labels: | ||
cluster: 'docker-compose' | ||
namespace: 'tsdb-blocks-storage-s3' | ||
- job_name: tsdb-blocks-storage-s3/ruler | ||
static_configs: | ||
- targets: ['ruler-1:8021', 'ruler-2:8022'] | ||
labels: | ||
cluster: 'docker-compose' | ||
namespace: 'tsdb-blocks-storage-s3' | ||
- job_name: tsdb-blocks-storage-s3/compactor | ||
static_configs: | ||
- targets: ['compactor:8006'] | ||
labels: | ||
cluster: 'docker-compose' | ||
namespace: 'tsdb-blocks-storage-s3' | ||
- job_name: tsdb-blocks-storage-s3/query-frontend | ||
static_configs: | ||
- targets: ['query-frontend:8007', 'query-frontend-with-scheduler:8012'] | ||
labels: | ||
cluster: 'docker-compose' | ||
namespace: 'tsdb-blocks-storage-s3' | ||
- job_name: tsdb-blocks-storage-s3/store-gateway | ||
static_configs: | ||
- targets: ['store-gateway-1:8008', 'store-gateway-2:8009'] | ||
labels: | ||
cluster: 'docker-compose' | ||
namespace: 'tsdb-blocks-storage-s3' | ||
- job_name: tsdb-blocks-storage-s3/query-scheduler | ||
static_configs: | ||
- targets: ['query-scheduler:8011'] | ||
labels: | ||
cluster: 'docker-compose' | ||
namespace: 'tsdb-blocks-storage-s3' | ||
|
||
remote_write: | ||
- url: http://distributor:8001/api/prom/push |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
FROM golang:1.14 | ||
ENV CGO_ENABLED=0 GOOS=linux GOARCH=amd64 | ||
RUN go get github.com/go-delve/delve/cmd/dlv | ||
|
||
FROM alpine:3.12 | ||
|
||
RUN mkdir /cortex | ||
WORKDIR /cortex | ||
ADD ./cortex ./ | ||
COPY --from=0 /go/bin/dlv ./ |
Oops, something went wrong.