Skip to content

Commit 149069e

Browse files
How to rename buckets in AWS and Azure playbook update (#5)
Signed-off-by: Friedrich Gonzalez <[email protected]>
1 parent f8dd8c2 commit 149069e

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## master / unreleased
44

55
* [CHANGE] Updated readme to use this repo with tanka
6+
* [ENHANCEMENT] How to rename buckets in AWS and Azure for `not healthy index found` playbook. #5
67

78
## 1.11.0 / 2021-12-30
89

cortex-mixin/docs/playbooks.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
This document contains playbooks, or at least a checklist of what to look for, for alerts in the cortex-mixin and logs from Cortex. This document assumes that you are running a Cortex cluster:
44

55
1. Using this mixin config
6-
2. Using GCS as object store (but similar procedures apply to other backends)
6+
2. Using GCS (Google), S3 (AWS) or Blobs (Azure). Similar procedures apply to other backends.
77

88
## Alerts
99

@@ -413,6 +413,32 @@ Where:
413413
- `TENANT` is the tenant id reported in the example error message above as `REDACTED-TENANT`
414414
- `BLOCK` is the last part of the file path reported as `REDACTED-BLOCK` in the example error message above
415415
416+
To rename a block stored on S3 you can use the `aws` CLI command:
417+
```
418+
aws s3 mv gs://BUCKET/TENANT/BLOCK gs://BUCKET/TENANT/corrupted-BLOCK
419+
```
420+
Where:
421+
- `BUCKET` is the s3 bucket name the compactor is using.
422+
- `TENANT` is the tenant id reported in the example error message above as `REDACTED-TENANT`
423+
- `BLOCK` is the last part of the file path reported as `REDACTED-BLOCK` in the example error message above
424+
425+
426+
To rename a block stored on Azure you can use the `azcopy` and `az` CLI command:
427+
```
428+
azcopy copy "https://$STORAGE-ACCOUNT.blob.core.windows.net/$CONTAINER/$TENANT/$BLOCK?$SASTOKEN" "https://$STORAGE-ACCOUNT.blob.core.windows.net/$CONTAINER/$TENANT/corrupted-$BLOCK?$SASTOKEN" --recursive
429+
azcopy remove "https://$STORAGE-ACCOUNT.blob.core.windows.net/$CONTAINER/$TENANT/$BLOCK?$SASTOKEN" --recursive
430+
```
431+
Where:
432+
- `STORAGE-ACCOUNT` is the storage account the compactor is using.
433+
- `CONTAINER` is what is specified as `-blocks-storage.azure.container-name`
434+
- `TENANT` is the tenant id reported in the example error message above as REDACTED-TENANT
435+
- `BLOCK` is the last part of the file path reported as REDACTED-BLOCK in the example error message above
436+
- `SAS-TOKEN` this is a token that can be created with the following command:
437+
438+
```
439+
az storage container generate-sas --account-name $STORAGE-ACCOUNT --expiry $(date -v +1d +%Y-%m-%d) --name $CONTAINER --permissions dlrw
440+
```
441+
416442
### CortexBucketIndexNotUpdated
417443
418444
This alert fires when the bucket index, for a given tenant, is not updated since a long time. The bucket index is expected to be periodically updated by the compactor and is used by queriers and store-gateways to get an almost-updated view over the bucket store.

0 commit comments

Comments
 (0)