thanos
mkdir editor
cd /root/editor && CURR_DIR=$(pwd)
docker run -it --rm quay.io/thanos/thanosbench:v0.2.0-rc.1 block plan -p continuous-365d-tiny --max-time=6h > ${CURR_DIR}/block-spec.yaml
mkdir ${CURR_DIR}/prom-eu1-replica0 && docker run -it --rm quay.io/thanos/thanosbench:v0.2.0-rc.1 block plan -p continuous-365d-tiny --labels 'cluster="eu1"' --max-time=6h | docker run -v ${CURR_DIR}/prom-eu1-replica0:/out -i quay.io/thanos/thanosbench:v0.2.0-rc.1 block gen --output.dir /out
mkdir ${CURR_DIR}/prom-eu1-replica1 && docker run -it --rm quay.io/thanos/thanosbench:v0.2.0-rc.1 block plan -p continuous-365d-tiny --labels 'cluster="eu1"' --max-time=6h | docker run -v ${CURR_DIR}/prom-eu1-replica1:/out -i quay.io/thanos/thanosbench:v0.2.0-rc.1 block gen --output.dir /out
mkdir ${CURR_DIR}/prom-us1-replica0 && docker run -it --rm quay.io/thanos/thanosbench:v0.2.0-rc.1 block plan -p continuous-365d-tiny --labels 'cluster="us1"' --max-time=6h | docker run -v ${CURR_DIR}/prom-us1-replica0:/out -i quay.io/thanos/thanosbench:v0.2.0-rc.1 block gen --output.dir /out
cat <<EOF > ${CURR_DIR}/prom-eu1-replica0-config.yaml
global:
scrape_interval: 5s
external_labels:
cluster: eu1
replica: 0
tenant: team-eu # Not needed, but a good practice if you want to grow this to multi-tenant system some day.
scrape_configs:
- job_name: 'prometheus'
static_configs:
- targets: ['127.0.0.1:9091','127.0.0.1:9092']
- job_name: "node"
static_configs:
- targets: ["127.0.0.1:9100"]
EOF
cat <<EOF > ${CURR_DIR}/prom-eu1-replica1-config.yaml
global:
scrape_interval: 5s
external_labels:
cluster: eu1
replica: 1
tenant: team-eu # Not needed, but a good practice if you want to grow this to multi-tenant system some day.
scrape_configs:
- job_name: 'prometheus'
static_configs:
- targets: ['127.0.0.1:9091','127.0.0.1:9092']
- job_name: "node"
static_configs:
- targets: ["127.0.0.1:9100"]
EOF
cat <<EOF > ${CURR_DIR}/prom-us1-replica0-config.yaml
global:
scrape_interval: 5s
external_labels:
cluster: us1
replica: 0
tenant: team-us
scrape_configs:
- job_name: 'prometheus'
static_configs:
- targets: ['127.0.0.1:9093']
- job_name: "node"
static_configs:
- targets: ["127.0.0.1:9100"]
EOF
PROM_EU1_0_PORT=9091 && \
PROM_EU1_1_PORT=9092 && \
PROM_US1_0_PORT=9093
PROM_EU1_0_EXT_ADDRESS=http://10.90.28.251:${PROM_US1_0_PORT} && \
PROM_EU1_1_EXT_ADDRESS=http://10.90.28.251:${PROM_US1_0_PORT} && \
PROM_US1_0_EXT_ADDRESS=http://10.90.28.251:${PROM_US1_0_PORT}
docker run -it --rm quay.io/prometheus/prometheus:v2.20.0 --help
docker run -d --net=host --rm \
-v ${CURR_DIR}/prom-eu1-replica0-config.yaml:/etc/prometheus/prometheus.yml \
-v ${CURR_DIR}/prom-eu1-replica0:/prometheus \
-u root \
--name prom-eu1-0 \
quay.io/prometheus/prometheus:v2.20.0 \
--config.file=/etc/prometheus/prometheus.yml \
--storage.tsdb.path=/prometheus \
--storage.tsdb.retention.time=1000d \
--storage.tsdb.max-block-duration=2h \
--storage.tsdb.min-block-duration=2h \
--web.listen-address=:${PROM_EU1_0_PORT} \
--web.external-url=${PROM_EU1_0_EXT_ADDRESS} \
--web.enable-lifecycle \
--web.enable-admin-api
docker run -d --net=host --rm \
-v ${CURR_DIR}/prom-eu1-replica1-config.yaml:/etc/prometheus/prometheus.yml \
-v ${CURR_DIR}/prom-eu1-replica1:/prometheus \
-u root \
--name prom-eu1-1 \
quay.io/prometheus/prometheus:v2.20.0 \
--config.file=/etc/prometheus/prometheus.yml \
--storage.tsdb.path=/prometheus \
--storage.tsdb.retention.time=1000d \
--storage.tsdb.max-block-duration=2h \
--storage.tsdb.min-block-duration=2h \
--web.listen-address=:${PROM_EU1_1_PORT} \
--web.external-url=${PROM_EU1_1_EXT_ADDRESS} \
--web.enable-lifecycle \
--web.enable-admin-api
docker run -d --net=host --rm \
-v ${CURR_DIR}/prom-us1-replica0-config.yaml:/etc/prometheus/prometheus.yml \
-v ${CURR_DIR}/prom-us1-replica0:/prometheus \
-u root \
--name prom-us1-0 \
quay.io/prometheus/prometheus:v2.20.0 \
--config.file=/etc/prometheus/prometheus.yml \
--storage.tsdb.path=/prometheus \
--storage.tsdb.retention.time=1000d \
--storage.tsdb.max-block-duration=2h \
--storage.tsdb.min-block-duration=2h \
--web.listen-address=:${PROM_US1_0_PORT} \
--web.external-url=${PROM_US1_0_EXT_ADDRESS} \
--web.enable-lifecycle \
--web.enable-admin-api
docker run -it --rm quay.io/thanos/thanos:v0.24.0 --help
docker run -d --net=host --rm \
-v ${CURR_DIR}/prom-eu1-replica0-config.yaml:/etc/prometheus/prometheus.yml \
--name prom-eu1-0-sidecar \
-u root \
quay.io/thanos/thanos:v0.24.0 \
sidecar \
--http-address 0.0.0.0:19091 \
--grpc-address 0.0.0.0:19191 \
--reloader.config-file /etc/prometheus/prometheus.yml \
--prometheus.url "http://127.0.0.1:${PROM_EU1_0_PORT}"
docker run -d --net=host --rm \
-v ${CURR_DIR}/prom-eu1-replica1-config.yaml:/etc/prometheus/prometheus.yml \
--name prom-eu1-1-sidecar \
-u root \
quay.io/thanos/thanos:v0.24.0 \
sidecar \
--http-address 0.0.0.0:19092 \
--grpc-address 0.0.0.0:19192 \
--reloader.config-file /etc/prometheus/prometheus.yml \
--prometheus.url "http://127.0.0.1:${PROM_EU1_1_PORT}"
docker run -d --net=host --rm \
-v ${CURR_DIR}/prom-us1-replica0-config.yaml:/etc/prometheus/prometheus.yml \
--name prom-us1-0-sidecar \
-u root \
quay.io/thanos/thanos:v0.24.0 \
sidecar \
--http-address 0.0.0.0:19093 \
--grpc-address 0.0.0.0:19193 \
--reloader.config-file /etc/prometheus/prometheus.yml \
--prometheus.url "http://127.0.0.1:${PROM_US1_0_PORT}"
mkdir ${CURR_DIR}/minio && \
docker run -d --rm --name minio \
-v ${CURR_DIR}/minio:/data \
-p 9000:9000 -e "MINIO_ACCESS_KEY=rawkode" -e "MINIO_SECRET_KEY=rawkodeloveobs" \
minio/minio:RELEASE.2019-01-31T00-31-19Z \
server /data
mkdir ${CURR_DIR}/minio/thanos
cat <<EOF > ${CURR_DIR}/minio-bucket.yaml
type: S3
config:
bucket: "thanos-test"
endpoint: "oss-cn-east-3.unicloudsrv.com"
access_key: "CGIqDnNBTxotoWQn"
secret_key: "DZpr1uM3Isrf39vHidchtkPEh2CSNW"
insecure: true
EOF
docker stop prom-eu1-0-sidecar
docker stop prom-eu1-1-sidecar
docker stop prom-us1-0-sidecar
docker run -d --net=host --rm \
-v ${CURR_DIR}/prom-eu1-replica0-config.yaml:/etc/prometheus/prometheus.yml \
-v ${CURR_DIR}/minio-bucket.yaml:/etc/thanos/minio-bucket.yaml \
-v ${CURR_DIR}/prom-eu1-replica0:/prometheus \
--name prom-eu1-0-sidecar \
-u root \
quay.io/thanos/thanos:v0.24.0 \
sidecar \
--tsdb.path /prometheus \
--objstore.config-file /etc/thanos/minio-bucket.yaml \
--shipper.upload-compacted \
--http-address 0.0.0.0:19091 \
--grpc-address 0.0.0.0:19191 \
--reloader.config-file /etc/prometheus/prometheus.yml \
--prometheus.url "http://127.0.0.1:${PROM_EU1_0_PORT}"
docker run -d --net=host --rm \
-v ${CURR_DIR}/prom-eu1-replica1-config.yaml:/etc/prometheus/prometheus.yml \
-v ${CURR_DIR}/minio-bucket.yaml:/etc/thanos/minio-bucket.yaml \
-v ${CURR_DIR}/prom-eu1-replica1:/prometheus \
--name prom-eu1-1-sidecar \
-u root \
quay.io/thanos/thanos:v0.24.0 \
sidecar \
--tsdb.path /prometheus \
--objstore.config-file /etc/thanos/minio-bucket.yaml \
--shipper.upload-compacted \
--http-address 0.0.0.0:19092 \
--grpc-address 0.0.0.0:19192 \
--reloader.config-file /etc/prometheus/prometheus.yml \
--prometheus.url "http://127.0.0.1:${PROM_EU1_1_PORT}"
docker run -d --net=host --rm \
-v ${CURR_DIR}/prom-us1-replica0-config.yaml:/etc/prometheus/prometheus.yml \
-v ${CURR_DIR}/minio-bucket.yaml:/etc/thanos/minio-bucket.yaml \
-v ${CURR_DIR}/prom-us1-replica0:/prometheus \
--name prom-us1-0-sidecar \
-u root \
quay.io/thanos/thanos:v0.24.0 \
sidecar \
--tsdb.path /prometheus \
--objstore.config-file /etc/thanos/minio-bucket.yaml \
--shipper.upload-compacted \
--http-address 0.0.0.0:19093 \
--grpc-address 0.0.0.0:19193 \
--reloader.config-file /etc/prometheus/prometheus.yml \
--prometheus.url "http://127.0.0.1:${PROM_US1_0_PORT}"
docker run -d --net=host --rm \
-v ${CURR_DIR}/minio-bucket.yaml:/etc/thanos/minio-bucket.yaml \
--name store-gateway \
quay.io/thanos/thanos:v0.24.0 \
store \
--objstore.config-file /etc/thanos/minio-bucket.yaml \
--http-address 0.0.0.0:19094 \
--grpc-address 0.0.0.0:19194
docker run -d --net=host --rm \
--name querier \
quay.io/thanos/thanos:v0.24.0 \
query \
--http-address 0.0.0.0:9090 \
--grpc-address 0.0.0.0:19190 \
--query.replica-label replica \
--store 127.0.0.1:19191 \
--store 127.0.0.1:19192 \
--store 127.0.0.1:19193 \
--store 127.0.0.1:19194 \
--store 127.0.0.1:9100
docker run -d --net=host --rm \
-v ${CURR_DIR}/minio-bucket.yaml:/etc/thanos/minio-bucket.yaml \
--name compactor \
quay.io/thanos/thanos:v0.24.0 \
compact \
--wait --wait-interval 30s \
--consistency-delay 0s \
--objstore.config-file /etc/thanos/minio-bucket.yaml \
--http-address 0.0.0.0:19095

浙公网安备 33010602011771号