Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs] How to write to multiple M3DB clusters #2187

Merged
merged 9 commits into from
Mar 23, 2020
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/coordinator/api/remote.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ docs/common/headers_optional_read_write.md

Binary [snappy compressed](http://google.github.io/snappy/) Prometheus [WriteRequest protobuf message](https://github.com/prometheus/prometheus/blob/10444e8b1dc69ffcddab93f09ba8dfa6a4a2fddb/prompb/remote.proto#L22-L24).

### Available Tuning Params

Refer [here](https://prometheus.io/docs/practices/remote_write/) for an up to date list of remote tuning parameters.

### Sample Call

There isn't a straightforward way to Snappy compress and marshal a Prometheus WriteRequest protobuf message using just shell, so this example uses a specific command line utility instead.
Expand Down
97 changes: 97 additions & 0 deletions docs/operational_guide/multiple_m3db_clusters.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
## Write to multiple M3DB clusters via M3Coordinator

### Overview:

Default M3 architecture has the M3Coordinator writing to and aggregating meterics from a single M3DB cluster. To map a single coordinator to more than one M3DB cluster, follow the below instructions.
gibbscullen marked this conversation as resolved.
Show resolved Hide resolved

Use case(s):
- Sending metrics to different namespaces for different retention periods, etc.
gibbscullen marked this conversation as resolved.
Show resolved Hide resolved

### Instructions:

**Note:** Adding multiple M3DB clusters to m3coordinator using the m3aggregator requires clusterManagement.
gibbscullen marked this conversation as resolved.
Show resolved Hide resolved

1. Add clusterManagement to config file:
gibbscullen marked this conversation as resolved.
Show resolved Hide resolved

Example config file with clusterManagement (see end of the config):
gibbscullen marked this conversation as resolved.
Show resolved Hide resolved

```bash
clusters:
# Should match the namespace(s) set up in the DB nodes
- namespaces:
gibbscullen marked this conversation as resolved.
Show resolved Hide resolved
- namespace: 21d
retention: 504h
type: unaggregated
client:
config:
service:
env: default_env
zone: embedded
service: m3db
cacheDir: /data/m3kv_default
etcdClusters:
- zone: embedded
endpoints:
- <ETCD_IP_1>
- <ETCD_IP_2>
- <ETCD_IP_3>
writeRetry:
initialBackoff: 500ms
backoffFactor: 3
maxRetries: 2
jitter: true
fetchRetry:
initialBackoff: 500ms
backoffFactor: 2
maxRetries: 3
jitter: true
- namespaces:
- namespace: 90d
retention: 2160h
type: aggregated
resolution: 10m
- namespace: 500d
retention: 12000h
type: aggregated
resolution: 1h
client:
config:
service:
env: lts_env
zone: embedded
service: m3db
cacheDir: /data/m3kv_lts
etcdClusters:
- zone: embedded
endpoints:
- <ETCD_IP_1>
- <ETCD_IP_2>
- <ETCD_IP_3>
writeRetry:
initialBackoff: 500ms
backoffFactor: 3
maxRetries: 2
jitter: true
fetchRetry:
initialBackoff: 500ms
backoffFactor: 2
maxRetries: 3
jitter: true
tagOptions:
idScheme: quoted
clusterManagement:
gibbscullen marked this conversation as resolved.
Show resolved Hide resolved
etcd:
env: default_env
zone: embedded
service: m3db
cacheDir: /data/m3kv_default
etcdClusters:
- zone: embedded
endpoints:
- <ETCD_IP_1>
- <ETCD_IP_2>
- <ETCD_IP_3>
```
2. Use environment header when calling existing APIs
gibbscullen marked this conversation as resolved.
Show resolved Hide resolved

**Note:** Any API requests to the coordinator require a `Cluster-Environment-Name` header that corresponds to the cluster the request is targeting.
gibbscullen marked this conversation as resolved.
Show resolved Hide resolved