- First way: use config file:
docker run -it -v /your_application.properties_folder:/iotdb-grafana-connector/config -p 8888:8888 apache/iotdb:<version>-grafana
- Second way: use environment(take
SPRING_DATASOURCE_URLfor example)
docker run -it -p 8888:8888 apache/iotdb:<version>-grafana -e SPRING_DATASOURCE_URL=jdbc:iotdb://iotdb:6667/
- All related environment are as follows(more details in
grafana/src/main/resources/application.properties)
| name | default value |
|---|---|
| SPRING_DATASOURCE_URL | jdbc:iotdb://127.0.0.1:6667/ |
| SPRING_DATASOURCE_USERNAME | root |
| SPRING_DATASOURCE_PASSWORD | root |
| SPRING_DATASOURCE_DRIVER_CLASS_NAME | org.apache.iotdb.jdbc.IoTDBDriver |
| SERVER_PORT | 8888 |
| TIMESTAMP_PRECISION | ms |
| ISDOWNSAMPLING | true |
| INTERVAL | 1m |
| CONTINUOUS_DATA_FUNCTION | AVG |
| DISCRETE_DATA_FUNCTION | LAST_VALUE |
Using docker compose, it contains three services: iotdb, grafana and grafana-connector
- The location of docker compose file:
/docker/src/main/DockerCompose/docker-compose-grafana.yml - Use
docker-compose upcan start all three services- you can use
docker-compose up -dto start in the background - you can modify
docker-compose-grafana.ymlto implement your requirements.- you can modify environment of grafana-connector
- If you want to SAVE ALL DATA, please use
volumeskeyword to mount the data volume or file of the host into the container.
- you can use
- After all services are start, you can visit
{ip}:3000to visit grafana- In
Configuration, searchSimpleJson - Fill in url:
grafana-connector:8888, then clicksave and test. ifData source is workingis shown, the configuration is finished. - Then you can create dashboards.
- In
- if you want to stop services, just run
docker-compose down
Enjoy it!