mirror of
https://github.com/vimagick/dockerfiles.git
synced 2025-05-29 22:57:35 +02:00
update influxdb
This commit is contained in:
parent
4c735f9e80
commit
ab87f2ba38
@ -1,29 +0,0 @@
|
|||||||
#
|
|
||||||
# Dockerfile for influxdb
|
|
||||||
#
|
|
||||||
|
|
||||||
FROM debian:jessie
|
|
||||||
MAINTAINER kev <noreply@easypi.pro>
|
|
||||||
|
|
||||||
ENV INFLUXDB_VERSION=1.0.0
|
|
||||||
ENV INFLUXDB_FILE=influxdb_${INFLUXDB_VERSION}_amd64.deb
|
|
||||||
ENV INFLUXDB_MD5=a25daf049d2482166b248fe2d0be4b69
|
|
||||||
ENV INFLUXDB_URL=https://dl.influxdata.com/influxdb/releases/${INFLUXDB_FILE}
|
|
||||||
ENV COLLECTD_URL=https://github.com/collectd/collectd/raw/master/src/types.db
|
|
||||||
|
|
||||||
RUN set -xe \
|
|
||||||
&& apt-get update \
|
|
||||||
&& apt-get install -y ca-certificates wget \
|
|
||||||
&& wget ${INFLUXDB_URL} -O ${INFLUXDB_FILE} \
|
|
||||||
&& echo "${INFLUXDB_MD5} ${INFLUXDB_FILE}" | md5sum -c \
|
|
||||||
&& dpkg -i ${INFLUXDB_FILE} \
|
|
||||||
&& sed -i '/^reporting-disabled/s/false/true/' /etc/influxdb/influxdb.conf \
|
|
||||||
&& wget ${COLLECTD_URL} -O /usr/lib/influxdb/types.db \
|
|
||||||
&& apt-get purge --auto-remove -y wget \
|
|
||||||
&& rm -rf ${INFLUXDB_FILE} \
|
|
||||||
/var/lib/apt/lists/*
|
|
||||||
|
|
||||||
VOLUME /etc/influxdb /var/lib/influxdb
|
|
||||||
EXPOSE 8083 8086 8088
|
|
||||||
|
|
||||||
CMD ["influxd", "-config", "/etc/influxdb/influxdb.conf"]
|
|
@ -1,68 +1,21 @@
|
|||||||
influxdb
|
influxdb
|
||||||
========
|
========
|
||||||
|
|
||||||
> :warning: Please use the official image [influxdb](https://hub.docker.com/_/influxdb/)!
|
|
||||||
|
|
||||||
[InfluxDB][1] is an open source distributed time series database with no external
|
[InfluxDB][1] is an open source distributed time series database with no external
|
||||||
dependencies. It's useful for recording metrics, events, and performing
|
dependencies. It's useful for recording metrics, events, and performing analytics.
|
||||||
analytics.
|
|
||||||
|
|
||||||
## docker-compose.yml
|
|
||||||
|
|
||||||
For official image:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
influxdb:
|
|
||||||
image: influxdb:alpine
|
|
||||||
ports:
|
|
||||||
- "8083:8083"
|
|
||||||
- "8086:8086"
|
|
||||||
volumes:
|
|
||||||
- ./data:/var/lib/influxdb
|
|
||||||
restart: always
|
|
||||||
```
|
|
||||||
|
|
||||||
For unofficial image:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
influxdb:
|
|
||||||
image: vimagick/influxdb
|
|
||||||
ports:
|
|
||||||
- "8083:8083"
|
|
||||||
- "8086:8086"
|
|
||||||
- "8088:8088"
|
|
||||||
- "25826:25826/udp"
|
|
||||||
restart: always
|
|
||||||
```
|
|
||||||
|
|
||||||
## up and running
|
## up and running
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ docker-compose up -d
|
$ docker-compose up -d
|
||||||
$ docker-compose exec influxdb influx
|
$ docker-compose exec influxdb bash
|
||||||
>>> show databases
|
>>> influx setup \
|
||||||
name: databases
|
--username USERNAME \
|
||||||
name
|
--password PASSWORD \
|
||||||
----
|
--token TOKEN \
|
||||||
_internal
|
--org ORG_NAME \
|
||||||
db_name
|
--bucket BUCKET_NAME \
|
||||||
|
--force
|
||||||
>>> use db_name
|
|
||||||
Using database db_name
|
|
||||||
|
|
||||||
>>> show series
|
|
||||||
key
|
|
||||||
---
|
|
||||||
cpu
|
|
||||||
|
|
||||||
>>> quit
|
|
||||||
```
|
```
|
||||||
|
|
||||||
- Open url: <http://localhost:8083>
|
|
||||||
- Create user: `CREATE USER "username" WITH PASSWORD 'password'`
|
|
||||||
- Create database: `CREATE DATABASE "db_name"`
|
|
||||||
- Select database: `db_name`
|
|
||||||
- Write data: `INSERT cpu,host=serverA,region=us_west value=0.64`
|
|
||||||
- Query data: `SELECT * FROM cpu`
|
|
||||||
|
|
||||||
[1]: https://influxdata.com/
|
[1]: https://influxdata.com/
|
||||||
|
@ -1,8 +1,13 @@
|
|||||||
influxdb:
|
#
|
||||||
image: influxdb:alpine
|
# https://docs.influxdata.com/influxdb/v2/get-started/setup/
|
||||||
ports:
|
#
|
||||||
- "8083:8083"
|
|
||||||
- "8086:8086"
|
services:
|
||||||
volumes:
|
influxdb:
|
||||||
- ./data:/var/lib/influxdb
|
image: influxdb:2-alpine
|
||||||
restart: always
|
ports:
|
||||||
|
- "8086:8086"
|
||||||
|
volumes:
|
||||||
|
- ./data/etc:/etc/influxdb2
|
||||||
|
- ./data/var:/var/lib/influxdb2
|
||||||
|
restart: unless-stopped
|
||||||
|
Loading…
x
Reference in New Issue
Block a user