Skip to content

Commit

Permalink
Revert "Remove Docker fo rnow"
Browse files Browse the repository at this point in the history
This reverts commit 7b56da1.
  • Loading branch information
ChrisChinchilla committed Nov 18, 2020
1 parent a04c491 commit 00647a4
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions site/content/quickstart/docker.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
---
title: "Docker"
weight: 1
---

<!-- TODO: Fix dates. Cross-platform date generation is a pain, so maybe use Docker locally? See what Netlify supports, or maybe there is a Hugo variable, or create a shortcode -->

## Creating a Single Node M3DB Cluster with Docker

This guide shows how to install and configure M3DB, create a single-node cluster, and read and write metrics to it.

{{% notice warning %}}
Deploying a single-node M3DB cluster is a great way to experiment with M3DB and get an idea of what it has to offer, but is not designed for production use. To run M3DB in clustered mode with a separate M3Coordinator, [read the clustered mode guide](/docs/how_to/cluster_hard_way).
{{% /notice %}}

## Prerequisites

- **Docker**: You don't need [Docker](https://www.docker.com/get-started) to run M3DB, but it is the simplest and quickest way.
- If you use Docker Desktop, we recommend the following minimum _Resources_ settings.
- _CPUs_: 2
- _Memory_: 8GB
- _Swap_: 1GB
- _Disk image size_: 16GB
- **JQ**: This example uses [jq](https://stedolan.github.io/jq/) to format the output of API calls. It is not essential for using M3DB.
- **curl**: This example uses curl for communicating with M3DB endpoints. You can also use alternatives such as [Wget](https://www.gnu.org/software/wget/) and [HTTPie](https://httpie.org/).

## Start Docker Container

By default the official M3DB Docker image configures a single M3DB instance as one binary containing:

- An M3DB storage instance for time series storage. It includes an embedded tag-based metrics index and an etcd server for storing the cluster topology and runtime configuration.
- A coordinator instance for writing and querying tagged metrics, as well as managing cluster topology and runtime configuration.

The Docker container exposes three ports:

- `7201` to manage the cluster topology, you make most API calls to this endpoint
- `7203` for Prometheus to scrape the metrics produced by M3DB and M3Coordinator

The command below creates a persistent data directory on the host operating system to maintain durability and persistence between container restarts.

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

```shell
docker run -p 7201:7201 -p 7203:7203 --name m3db -v $(pwd)/m3db_data:/var/lib/m3db quay.io/m3db/m3dbnode:latest
```

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

<!-- TODO: Perfect image, pref with terminalizer -->

![Docker pull and run](/docker-install.gif)

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

{{% notice info %}}
When running the command above on Docker for Mac, Docker for Windows, and some Linux distributions you may see errors about settings not being at recommended values. Unless you intend to run M3DB in production on macOS or Windows, you can ignore these warnings.
{{% /notice %}}

{{% fileinclude file="quickstart/common-steps.md" %}}

0 comments on commit 00647a4

Please sign in to comment.