You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: site/content/docs/how_to/cluster_hard_way.md
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -163,6 +163,14 @@ Shortly after, you should see your node complete bootstrapping:
163
163
20:10:14.764771[I] successfully updated topology to 3 hosts
164
164
```
165
165
166
+
Once the node has completed bootstrapping, mark the namespace as ready so the coordinator knows it's ready to receive reads and writes:
167
+
168
+
```shell
169
+
curl -X POST http://localhost:7201/api/v1/services/m3db/namespace/ready -d '{
170
+
"name": "1week_namespace"
171
+
}
172
+
```
173
+
166
174
If you need to setup multiple namespaces, you can run the above `/api/v1/database/create` command multiple times with different namespace configurations.
Copy file name to clipboardExpand all lines: site/content/docs/how_to/query.md
+49-14Lines changed: 49 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,26 +34,61 @@ The configuration file linked above uses an embedded etcd cluster, which is fine
34
34
35
35
## Aggregation
36
36
37
-
You will notice that in the setup linked above, M3DB has just one unaggregated namespace configured. If you want aggregated metrics, you will need to set up an aggregated namespace in M3DB **and** in the m3query configuration. It is important to note that all writes go to all namespaces so as long as you include all namespaces in your query config, you will be querying all namespaces. Aggregation is done strictly by the query service. For example if you have an aggregated namespace setup in M3DB named `metrics_10s_48h`, you can add the following to the query config:
37
+
You will notice that in the setup linked above, M3DB has just one unaggregated namespace configured. If you want aggregated metrics, you will need to set up an aggregated namespace. It is important to note that all writes go to all namespaces marked as ready. Aggregation is done strictly by the query service. As an example, to configure an aggregated namespace named `metrics_10s_48h`, you can execute the following API call:
38
38
39
-
```yaml
40
-
- namespace: metrics_10s_48h
41
-
type: aggregated
42
-
retention: 48h
43
-
resolution: 10s
39
+
```shell
40
+
curl -X POST <M3_COORDINATOR_IP_ADDRESS>:<CONFIGURED_PORT(default 7201)>/api/v1/services/m3db/namespace -d '{
If you run Statsite, m3agg, or some other aggregation tier, you will want to set the `all` flag under `downsample` to `false`. Otherwise, you will be aggregating metrics that have already been aggregated.
76
+
If you run Statsite, m3agg, or some other aggregation tier, you will want to set the `all` flag under `downsample` to `false`. Otherwise, you will be aggregating metrics that have already been aggregated. Using the example above, `aggregationOptions` would be configured as follows
Copy file name to clipboardExpand all lines: site/content/docs/operational_guide/mapping_rollup.md
+18-12Lines changed: 18 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -140,16 +140,22 @@ downsample:
140
140
retention: 720h
141
141
```
142
142
143
-
**Note:** In order to store rolled up metrics in an `unaggregated` namespace,
144
-
a matching `aggregated` namespace must be added to the coordinator config. For
145
-
example, if in the above rule, the `720h` namespace under `storagePolicies`
146
-
is `unaggregated`, the following will need to be added to the coordinator config.
147
-
148
-
```yaml
149
-
- namespace: default
150
-
resolution: 30s
151
-
retention: 720h
152
-
type: aggregated
153
-
downsample:
154
-
all: false
143
+
**Note:** In order to store rolled up metrics in an `unaggregated` namespace, the namespace's `aggregationOptions` must have a matching `aggregation`. For example, if in the above rule, the `720h` namespace under `storagePolicies`
144
+
is `unaggregated`, the `aggregationOptions` for that namespace should resemble the following:
Copy file name to clipboardExpand all lines: site/content/docs/operational_guide/namespace_configuration.md
+51-12Lines changed: 51 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,14 +32,20 @@ curl -X POST <M3_COORDINATOR_IP_ADDRESS>:<CONFIGURED_PORT(default 7201)>/api/v1/
32
32
33
33
will create a namespace called `default_unaggregated` with a retention of `24 hours`. All of the other namespace options will either use reasonable default values or be calculated based on the provided `retentionTime`.
34
34
35
-
Adding a namespace does not require restarting M3DB, but will require modifying the M3Coordinator configuration to include the new namespace, and then restarting it.
35
+
Adding a namespace requires you mark the namespace as ready once M3DB has finished bootstrapping it. This is done so that M3Coordinator knows the namespace is ready to receive reads and writes. Use the `api/v1/services/m3db/namespace/ready` endpoint to accomplish this:
36
+
37
+
```shell
38
+
curl -X POST <M3_COORDINATOR_IP_ADDRESS>:<CONFIGURED_PORT(default 7201)>/api/v1/services/m3db/namespace/ready -d '{
39
+
"name": "default_unaggregated"
40
+
}
41
+
```
36
42
37
43
If you feel the need to configure the namespace options yourself (for performance or other reasons), read the `Advanced` section below.
38
44
39
45
#### Advanced (Hard Way)
40
46
41
47
The "advanced" API allows you to configure every aspect of the namespace that you're adding which can sometimes be helpful for development, debugging, and tuning clusters for maximum performance.
42
-
Adding a namespace is a simple as using the `POST``api/v1/namespace` API on an M3Coordinator instance.
48
+
Adding a namespace is a simple as using the `POST``api/v1/services/m3db/namespace` API on an M3Coordinator instance.
43
49
44
50
```shell
45
51
curl -X POST <M3_COORDINATOR_IP_ADDRESS>:<CONFIGURED_PORT(default 7201)>/api/v1/services/m3db/namespace -d '{
@@ -52,31 +58,41 @@ curl -X POST <M3_COORDINATOR_IP_ADDRESS>:<CONFIGURED_PORT(default 7201)>/api/v1/
Adding a namespace does not require restarting M3DB, but will require modifying the M3Coordinator configuration to include the new namespace, and then restarting it.
81
+
Adding a namespace requires you to mark the namespace as ready so M3Coordinator know it is ready to receive traffic:
82
+
83
+
```shell
84
+
curl -X POST <M3_COORDINATOR_IP_ADDRESS>:<CONFIGURED_PORT(default 7201)>/api/v1/services/m3db/namespace/ready -d '{
85
+
"name": "default_unaggregated"
86
+
}
87
+
```
71
88
72
89
### Deleting a Namespace
73
90
74
91
Deleting a namespace is a simple as using the `DELETE` `/api/v1/services/m3db/namespace` API on an M3Coordinator instance.
Note that deleting a namespace will not have any effect on the M3DB nodes until they are all restarted. In addition, the namespace will need to be removed from the M3Coordinator configuration and then the M3Coordinator node will need to be restarted.
79
-
95
+
Note that deleting a namespace will not have any effect on the M3DB nodes until they are all restarted.
80
96
### Modifying a Namespace
81
97
82
98
There is currently no atomic namespace modification endpoint. Instead, you will need to delete a namespace and then add it back again with the same name, but modified settings. Review the individual namespace settings above to determine whether or not a given setting is safe to modify. For example, it is never safe to modify the blockSize of a namespace.
@@ -169,7 +185,7 @@ While it may be tempting to configure `bufferPast` and `bufferFuture` to very la
169
185
170
186
Can be modified without creating a new namespace: `yes`
171
187
172
-
### Index Options
188
+
### indexOptions
173
189
174
190
#### enabled
175
191
@@ -183,3 +199,26 @@ The size of blocks (in duration) that the index uses.
183
199
Should match the databases [blocksize](#blocksize) for optimal memory usage.
184
200
185
201
Can be modified without creating a new namespace: `no`
202
+
203
+
### aggregationOptions
204
+
Options for the Coordinator to use to make decisions around how to aggregate data points.
205
+
206
+
Can be modified without creating a new namespace: `yes`
207
+
208
+
#### aggregations
209
+
One or more set of instructions on how data points should be aggregated within the namespace.
210
+
211
+
##### aggregated
212
+
Whether data points are aggregated.
213
+
214
+
##### attributes
215
+
If aggregated is true, specifies how to aggregate data.
216
+
217
+
###### resolutionNanos
218
+
The time range to aggregate data across.
219
+
220
+
###### downsampleOptions
221
+
Options related to downsampling data
222
+
223
+
###### _all_
224
+
Whether to send data points to this namespace. If false, the coordinator will not auto-aggregate incoming data points and data points must be sent the namespace via rules. Defaults to true.
Copy file name to clipboardExpand all lines: site/content/docs/quickstart/_index.md
+25-1Lines changed: 25 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -94,7 +94,6 @@ This quickstart uses the _{{% apiendpoint %}}database/create_ endpoint that crea
94
94
95
95
You can create [placements](/docs/operational_guide/placement_configuration/) and [namespaces](/docs/operational_guide/namespace_configuration/#advanced-hard-way) separately if you need more control over their settings.
96
96
97
-
The `namespaceName` argument must match the namespace in the `local` section of the `M3Coordinator` YAML configuration. If you [add any namespaces](/docs/operational_guide/namespace_configuration) you also need to add them to the `local` section of `M3Coordinator`'s YAML config.
[Read more about the bootstrapping process](/docs/operational_guide/bootstrapping_crash_recovery/).
268
267
{{% /notice %}}
269
268
269
+
### Readying a Namespace
270
+
271
+
Once a namespace has finished bootstrapping, it must be marked as ready before receiving traffic. This can be done by calling the _{{% apiendpoint %}}namespace/ready_.
272
+
273
+
{{< tabs name="ready_namespaces" >}}
274
+
{{% tab name="Command" %}}
275
+
276
+
```shell
277
+
curl -X POST http://localhost:7201/api/v1/services/m3db/namespace/ready -d '{
278
+
"name": "default"
279
+
} | jq .
280
+
```
281
+
282
+
{{% /tab %}}
283
+
{{% tab name="Output" %}}
284
+
285
+
```json
286
+
{
287
+
"ready": true
288
+
}
289
+
```
290
+
291
+
{{% /tab %}}
292
+
{{< /tabs >}}
293
+
270
294
### View Details of a Namespace
271
295
272
296
You can also view the attributes of all namespaces by calling the _{{% apiendpoint %}}namespace_ endpoint
0 commit comments