Skip to content

Commit

Permalink
[DOCS] Fix grammar and create code snippet for step in quickstart (#2961
Browse files Browse the repository at this point in the history
)

* Fix grammar and create code snippet for step in quickstart

Signed-off-by: ChrisChinchilla <chris@chronosphere.io>

* Update other files with readiness

Signed-off-by: ChrisChinchilla <chris@chronosphere.io>
  • Loading branch information
Chris Chinchilla authored Dec 7, 2020
1 parent 3e91eed commit 676c172
Show file tree
Hide file tree
Showing 7 changed files with 77 additions and 24 deletions.
19 changes: 15 additions & 4 deletions site/content/how_to/cluster_hard_way.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,14 +163,25 @@ Shortly after, you should see your node complete bootstrapping:
20:10:14.764771[I] successfully updated topology to 3 hosts
```

Once the node has completed bootstrapping, mark the namespace as ready so the coordinator knows it's ready to receive reads and writes:
Once a namespace has finished bootstrapping, you must mark it as ready before receiving traffic by using the _{{% apiendpoint %}}namespace/ready_.

```shell
curl -X POST http://localhost:7201/api/v1/services/m3db/namespace/ready -d '{
"name": "1week_namespace"
{{< tabs name="ready_namespaces" >}}
{{% tab name="Command" %}}

{{% codeinclude file="how_to/ready-namespace.sh" language="shell" %}}

{{% /tab %}}
{{% tab name="Output" %}}

```json
{
"ready": true
}
```

{{% /tab %}}
{{< /tabs >}}

If you need to setup multiple namespaces, you can run the above `/api/v1/database/create` command multiple times with different namespace configurations.

### Replication factor (RF)
Expand Down
20 changes: 16 additions & 4 deletions site/content/how_to/use_as_tsdb.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,14 +143,26 @@ curl -X POST http://localhost:7201/api/v1/database/create -d '{

Note that the `retentionTime` is set artificially low to conserve resources.

After a few moments, the M3DB container should finish bootstrapping. Once bootstrapping is finished, mark the namespace as ready to receive traffic:
Once a namespace has finished bootstrapping, you must mark it as ready before receiving traffic by using the _{{% apiendpoint %}}namespace/ready_.

```shell
curl -X POST http://localhost:7201/api/v1/services/m3db/namespace/ready -d '{
"name": "default"
{{< tabs name="ready_namespaces" >}}
{{% tab name="Command" %}}

{{% codeinclude file="quickstart/ready-namespace.sh" language="shell" %}}

{{% /tab %}}
{{% tab name="Output" %}}

```json
{
"ready": true
}
```

{{% /tab %}}
{{< /tabs >}}


At this point it should be ready to serve write and read queries.

#### Clients
Expand Down
4 changes: 4 additions & 0 deletions site/content/includes/how_to/ready-namespace.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
curl -X POST http://localhost:7201/api/v1/services/m3db/namespace/ready -d '{
"name": "1week_namespace"
}' | jq .
4 changes: 4 additions & 0 deletions site/content/includes/operational_guide/ready-namespace.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
curl -X POST http://localhost:7201/api/v1/services/m3db/namespace/ready -d '{
"name": "default_unaggregated"
}' | jq .
4 changes: 4 additions & 0 deletions site/content/includes/quickstart/ready-namespace.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
curl -X POST http://localhost:7201/api/v1/services/m3db/namespace/ready -d '{
"name": "default"
}' | jq .
38 changes: 30 additions & 8 deletions site/content/operational_guide/namespace_configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,25 @@ curl -X POST <M3_COORDINATOR_IP_ADDRESS>:<CONFIGURED_PORT(default 7201)>/api/v1/

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`.

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:
Once a namespace has finished bootstrapping, you must mark it as ready so that M3Coordinator knows the namespace is ready to receive reads and writes by using the _{{% apiendpoint %}}namespace/ready_.

```shell
curl -X POST <M3_COORDINATOR_IP_ADDRESS>:<CONFIGURED_PORT(default 7201)>/api/v1/services/m3db/namespace/ready -d '{
"name": "default_unaggregated"
{{< tabs name="ready_namespaces" >}}
{{% tab name="Command" %}}

{{% codeinclude file="operational_guide/ready-namespace.sh" language="shell" %}}

{{% /tab %}}
{{% tab name="Output" %}}

```json
{
"ready": true
}
```

{{% /tab %}}
{{< /tabs >}}

If you feel the need to configure the namespace options yourself (for performance or other reasons), read the `Advanced` section below.

#### Advanced (Hard Way)
Expand Down Expand Up @@ -78,14 +89,25 @@ curl -X POST <M3_COORDINATOR_IP_ADDRESS>:<CONFIGURED_PORT(default 7201)>/api/v1/
}'
```

Adding a namespace requires you to mark the namespace as ready so M3Coordinator know it is ready to receive traffic:
Once a namespace has finished bootstrapping, you must mark it as ready so that M3Coordinator knows the namespace is ready to receive reads and writes by using the _{{% apiendpoint %}}namespace/ready_.

```shell
curl -X POST <M3_COORDINATOR_IP_ADDRESS>:<CONFIGURED_PORT(default 7201)>/api/v1/services/m3db/namespace/ready -d '{
"name": "default_unaggregated"
{{< tabs name="ready_namespaces_adv" >}}
{{% tab name="Command" %}}

{{% codeinclude file="operational_guide/ready-namespace.sh" language="shell" %}}

{{% /tab %}}
{{% tab name="Output" %}}

```json
{
"ready": true
}
```

{{% /tab %}}
{{< /tabs >}}

### Deleting a Namespace

Deleting a namespace is a simple as using the `DELETE` `/api/v1/services/m3db/namespace` API on an M3Coordinator instance.
Expand Down
12 changes: 4 additions & 8 deletions site/content/quickstart/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,18 +264,14 @@ curl {{% apiendpoint %}}placement | jq .
[Read more about the bootstrapping process](/docs/operational_guide/bootstrapping_crash_recovery/).
{{% /notice %}}

### Readying a Namespace

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_.
### Ready a Namespace
<!-- TODO: Why?> -->
Once a namespace has finished bootstrapping, you must mark it as ready before receiving traffic by using the _{{% apiendpoint %}}namespace/ready_.

{{< tabs name="ready_namespaces" >}}
{{% tab name="Command" %}}

```shell
curl -X POST http://localhost:7201/api/v1/services/m3db/namespace/ready -d '{
"name": "default"
}' | jq .
```
{{% codeinclude file="quickstart/ready-namespace.sh" language="shell" %}}

{{% /tab %}}
{{% tab name="Output" %}}
Expand Down

0 comments on commit 676c172

Please sign in to comment.