tree: 95590660337ef813b5826f05a67cfc935c6d51f4 [path history] [tgz]
  1. src/
  2. ReadMe.md
docker/ReadMe.md

How to build

docker build -t THE_DOCKER_IMAGE_NAME:THE_VERSION -f THE_DOCKER_FILE_NAME

e.g.,

docker build -t my-iotdb:<version> -f Dockerfile-<version>

How to run IoTDB server

Actually, we maintain a repo on dockerhub, so that you can get the docker image directly.

For example,

docker run -d -p 6667:6667 -p 31999:31999 -p 8181:8181 -p 5555:5555 apache/iotdb:<version>

How to configure docker volumes

The instructions below show how to store the output data and logs of IoTDB to two folders called iotdb_data and iotdb_logs respectively.

/D/docker/iotdb_data and /D/docker/iotdb_logs can be changed to any local directory of your own host.

docker run -it -v /D/docker/iotdb_data:/iotdb/data -v /D/docker/iotdb_logs:/iotdb/logs --name 123 apache/iotdb:<version>

How to run IoTDB client

Suppose you have run an IoTDB Server in docker

  1. Use docker ps to find out the CONTAINER ID e.g.,
$ docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                                                                                NAMES
c82321c70137        apache/iotdb:<version>  "/iotdb/sbin/start-s…"   12 minutes ago      Up 12 minutes       0.0.0.0:6667->6667/tcp, 0.0.0.0:8181->8181/tcp, 5555/tcp, 0.0.0.0:31999->31999/tcp   elegant_germain
  1. Use docker exec to attach the container:
docker exec -it c82321c70137 /bin/bash

Then, for the latest version (or, >=0.10.x), run start-cli.sh, for version 0.9.x and 0.8.1, run start-client.sh.

How to run IoTDB-grafana-connector

  1. First way: use config file:
docker run -it -v /your_application.properties_folder:/iotdb-grafana/config -p 8888:8888 apache/iotdb:<version>-grafana
  1. Second way: use environment(take SPRING_DATASOURCE_URL for example)
docker run -it -p 8888:8888 apache/iotdb:<version>-grafana -e SPRING_DATASOURCE_URL=jdbc:iotdb://iotdb:6667/
  1. All related environment are as follows(more details in grafana/src/main/resources/application.properties)
namedefault value
SPRING_DATASOURCE_URLjdbc:iotdb://127.0.0.1:6667/
SPRING_DATASOURCE_USERNAMEroot
SPRING_DATASOURCE_PASSWORDroot
SPRING_DATASOURCE_DRIVER_CLASS_NAMEorg.apache.iotdb.jdbc.IoTDBDriver
SERVER_PORT8888
TIMESTAMP_PRECISIONms
ISDOWNSAMPLINGtrue
INTERVAL1m
CONTINUOUS_DATA_FUNCTIONAVG
DISCRETE_DATA_FUNCTIONLAST_VALUE

How to run IoTDB-grafana-connector by docker compose

Using docker compose, it contains three services: iotdb, grafana and grafana-connector

  1. The location of docker compose file: /docker/src/main/DockerCompose/docker-compose-grafana.yml
  2. Use docker-compose up can start all three services
    1. you can use docker-compose up -d to start in the background
    2. you can modify docker-compose-grafana.yml to implement your requirements.
      1. you can modify environment of grafana-connector
      2. If you want to SAVE ALL DATA, please use volumes keyword to mount the data volume or file of the host into the container.
  3. After all services are start, you can visit {ip}:3000 to visit grafana
    1. In Configuration, search SimpleJson
    2. Fill in url: grafana-connector:8888, then click save and test. if Data source is working is shown, the configuration is finished.
    3. Then you can create dashboards.
  4. if you want to stop services, just run docker-compose down

Enjoy it!