Use Time Series Database InfluxDB to Store Metrics Data (Optional)
HertzBeat's historical data storage depends on the time series database InfluxDB, TDengine or IoTDB, choose one of them to install and initialize, or not to install (note ⚠️ but it is strongly recommended to configure in the production environment)
TDengine is the Time Series Data Platform where developers build IoT, analytics, and cloud applications.
Note⚠️ Time series database is optional, but production environment configuration is strongly recommended to provide more complete historical chart functions and high performance
⚠️ If you do not configure a time series database, only the last hour of historical data is retained.
Note⚠️ Need InfluxDB 1.x Version.
1. Use HuaweiCloud GaussDB For Influx
GaussDB For Influxservice url, username and password config.
GaussDB For Influx enable SSL default, the service url should use
2. Install TDengine via Docker
Refer to the official website installation tutorial
- Download and install Docker environment
Docker tools download refer to Docker official document.
After the installation you can check if the Docker version normally output at the terminal.
$ docker -v
Docker version 20.10.12, build e91ed57
- Install InfluxDB with Docker
$ docker run -p 8086:8086 \
-v /opt/influxdb:/var/lib/influxdb \
-v /opt/influxdb:/var/lib/influxdbis local persistent mount of InfluxDB data directory.
/opt/influxdbshould be replaced with the actual local directory.
$ docker psto check if the database started successfully
Configure the database connection in hertzbeat
application.yml configuration file
- Configure HertzBeat's configuration file
hertzbeat/config/application.ymlconfiguration file /script/application.yml
Note⚠️The docker container way need to mount application.yml file locally, while you can use installation package way to unzip and modify
warehouse.store.influxdbdata source parameters, URL account and password.
# disable jpa
# enable influxdb
- Restart HertzBeat
- Do both the time series databases InfluxDB, IoTDB and TDengine need to be configured? Can they both be used?
You don't need to configure all of them, you can choose one of them. Use the enable parameter to control whether it is used or not. You can also install and configure neither, which only affects the historical chart data.