Skip to content

Commit

Permalink
Adding docker documentation for the TICK stack
Browse files Browse the repository at this point in the history
  • Loading branch information
jsternberg committed Apr 12, 2016
1 parent b2786e6 commit 27894ce
Show file tree
Hide file tree
Showing 12 changed files with 439 additions and 0 deletions.
1 change: 1 addition & 0 deletions chronograf/README-short.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Chronograf is a visualization tool for time series data in InfluxDB.
71 changes: 71 additions & 0 deletions chronograf/content.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# Chronograf

Chronograf is a simple to install graphing and visualization application that you deploy behind your firewall to perform ad-hoc exploration of your InfluxDB data. It includes support for templates and a library of intelligent, pre-configured dashboards for common data sets.

%%LOGO%%

## Using this image

### Exposed Ports

- 10000 (default port)

### Using the default configuration

By default, Chronograf runs on localhost port `10000`. Chronograf exposes a shared volume under `/var/lib/chronograf`, which it uses to store database data. You can mount a host directory to `/var/lib/chronograf` for host access to persisted container data. A typical invocation of the Chronograf container might be:

```console
$ docker run --net=host \
-v /path/on/host:/var/lib/chronograf \
chronograf
```

You can also have Docker control the volume mountpoint by using a named volume.

```console
$ docker run -p 8083:8083 -p 8086:8086 \
-v chronograf:/var/lib/chronograf \
chronograf
```

### Using a custom config file

Assuming a custom configuration file on your host at `/path/to/config.toml` you can mount a shared volume as follows:

```console
$ docker run --net=host \
-v /path/to:/opt/chronograf:ro \
chronograf -config /opt/chronograf/config.toml
```

## Config variables

Chronograf 0.10 has following config variables

| FLAG | ENV VAR | DEFAULT VALUE |
|-------------------------|---------------------------------------|-----------------------------------|
| LocalDatabase | CHRONOGRAF_LOCAL_DATABASE | /var/lib/chronograf/chronograf.db |
| QueryResponseBytesLimit | CHRONOGRAF_QUERY_RESPONSE_BYTES_LIMIT | 2500000 |

All of these can be provided in the config file or overrided using the environment variables

### Binding to a different port

To bind to a different port you can use Docker's `-p` flag. For example, to run Chronograf on port `9999`:

```console
docker run -p 9999:10000 chronograf
```

### Using a different database file

```console
$ docker run --net=host \
-v /path/on/host/:/var/lib/other_chronograf.db \
--env CHRONOGRAF_LOCAL_DATABASE=/var/lib/other_chronograf db \
chronograf
```

## Official Docs

See the [official docs](https://docs.influxdata.com/chronograf/latest/introduction/getting_started/) for information on creating visualizations.
1 change: 1 addition & 0 deletions chronograf/license.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
View [license information](https://github.com/influxdata/chronograf/blob/master/LICENSE) for the software contained in this image.
1 change: 1 addition & 0 deletions influxdb/README-short.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
InfluxDB is an open source time series database for recording metrics, events, and analytics.
119 changes: 119 additions & 0 deletions influxdb/content.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
# InfluxDB

InfluxDB is a time series database built from the ground up to handle high write and query loads. InfluxDB is meant to be used as a backing store for any use case involving large amounts of timestamped data, including DevOps monitoring, application metrics, IoT sensor data, and real-time analytics.

[InfluxDB Documentation](https://docs.influxdata.com/influxdb/latest/)

%%LOGO%%

## Using this Image

### Running the container

The InfluxDB image exposes a shared volume under `/var/lib/influxdb`, so you can mount a host directory to that point to access persisted container data. A typical invocation of the container might be:

```console
docker run -p 8083:8083 -p 8086:8086 \
-v $PWD:/var/lib/influxdb \
influxdb
```

Modify `$PWD` to the directory where you want to store data associated with the InfluxDB container.

You can also have Docker control the volume mountpoint by using a named volume.

```console
docker run -p 8083:8083 -p 8086:8086 \
-v influxdb:/var/lib/influxdb \
influxdb
```

### Exposed Ports

The following ports are important and will be automatically exposed when using `docker run -P`.

- 8083 Admin interface port
- 8086 HTTP API PORT

Other important ports that aren't exposed by default:

- 8091 Meta service port
- 8088 Clustering (raft) port

These two ports do not need to be exposed in a single server configuration.

Find more about API Endpoints & Ports [here](https://docs.influxdata.com/influxdb/latest/concepts/api/).

### Configuration

InfluxDB can be either configured from a config file or using environment variables. To mount a configuration file and use it with the server, you can use this command:

Generate the default configuration file:

```console
$ docker run --rm \
-v $PWD:/etc/influxdb \
influxdb bash -c 'influxd config > /etc/influxdb/influxdb.conf'
```

Modify the default configuration, which will now be available under `$PWD`. Then start the InfluxDB container.

```console
$ docker run -p 8083:8083 -p 8086:8086 \
-v $PWD:/etc/influxdb:ro \
influxdb -config /etc/influxdb/influxdb.conf
```

Modify `$PWD` to the directory where you want to store the configuration file.

For environment variables, the format is `INFLUXDB_$SECTION_$NAME`. All dashes (`-`) are replaced with underscores (`_`). If the variable isn't in a section, then omit that part.

Examples:

```console
INFLUXDB_REPORTING_DISABLED=true
INFLUXDB_META_DIR=/path/to/metadir
INFLUXDB_DATA_QUERY_LOG_ENABLED=false
```

Find more about configuring InfluxDB [here](https://docs.influxdata.com/influxdb/latest/introduction/installation/)

### Graphite

InfluxDB supports the Graphite line protocol, but the service and ports are not exposed by default. To run InfluxDB with Graphite support enabled, you can either use a configuration file or set the appropriate environment variables.

### HTTP API

Creating a DB named mydb:

```console
$ curl -G http://localhost:8086/query --data-urlencode "q=CREATE DATABASE mydb"
```

Inserting into the DB:

```console
$ curl -i -XPOST 'http://localhost:8086/write?db=mydb' --data-binary 'cpu_load_short,host=server01,region=us-west value=0.64 1434055562000000000'
```

Read more about this in the [official documentation](https://docs.influxdata.com/influxdb/latest/guides/writing_data/)

### CLI / SHELL

Start the container:

```console
$ docker run --name=influxdb -d -p 8083:8083 -p 8086:8086 influxdb
```

Run the influx client in another container as such:

```console
$ docker run --rm --link=influxdb -it influxdb influx -host influxdb
```

### Web Administrator Interface

Navigate to [localhost:8083](http://localhost:8083) with your browser while running the container.

See more about using the web admin [here](https://docs.influxdata.com/influxdb/latest/tools/web_admin/).
1 change: 1 addition & 0 deletions influxdb/license.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
View [license information](https://github.com/influxdata/influxdb/blob/master/LICENSE) for the software contained in this image.
1 change: 1 addition & 0 deletions kapacitor/README-short.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Kapacitor is an open source framework for processing, monitoring, and alerting on time series data.
68 changes: 68 additions & 0 deletions kapacitor/content.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Kapacitor

Kapacitor is a data processing engine. It can process both stream and batch data.

%%LOGO%%

## Using this image

Start the Kapacitor container with default options:

```console
$ docker run --net=host \
-v /path/on/host/kapacitorFiles/:/var/lib/kapacitor
kapacitor
```

Start the Kapacitor container with custom configuration.

```console
$ docker run --net=host \
-v /path/on/host/kapacitor.config:/etc/kapacitor/kapacitor.conf:ro \
-v /path/on/host/kapacitorFiles/:/var/lib/kapacitor
kapacitor
```

Start the Kapacitor container with custom configuration using env vars.

```console
$ docker run --net=host
-e KAPACITOR_LOGGING_LEVEL=DEBUG \
-v /path/on/host/kapacitorFiles/:/var/lib/kapacitor
kapacitor
```

## Using the CLI

The kapacitor CLI binary is also included in the image. To start a container for communicating with the kapacitor daemon, change the entrypoint

```console
$ docker run -it --entrypoint=bash \
-v /path/on/host/kapacitorFiles/:/var/lib/kapacitor
kapacitor
```

Then from within the container you can use the `kapacitor` command to interact with the daemon. Assuming you have Telegraf + InfluxDB + Kapacitor all hooked up, then create a file `cpu_alert.tick`. If not then see the [docker-compose](https://docs.docker.com/compose/) [TICK stack](https://github.com/influxdata/TICK-docker) environment for easy setup.

```sh
cat > cpu_alert.tick << EOF
stream
// Select just the cpu measurement from our example database.
|from()
.measurement('cpu')
|alert()
.crit(lambda: "usage_idle" < 100 )
// Whenever we get an alert notify slack
.slack()
EOF
```

Then define, enable and watch the status of the task:

```console
kapacitor define -name cpu_alert -type stream -dbrp telegraf.default -tick cpu_alert.tick
kapacitor enable cpu_alert
kapacitor show cpu_alert
```

See [this](https://docs.influxdata.com/kapacitor/latest/introduction/getting_started/) for a more detailed guide.
1 change: 1 addition & 0 deletions kapacitor/license.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
View [license information](https://github.com/influxdata/kapacitor/blob/master/LICENSE) for the software contained in this image.
1 change: 1 addition & 0 deletions telegraf/README-short.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Telegraf is an agent for collecting metrics and writing them to InfluxDB or other outputs.
Loading

0 comments on commit 27894ce

Please sign in to comment.