Use Time Series Database Greptime to Store Metrics Data (Recommended)
Apache HertzBeat (incubating)'s historical data storage relies on the time series database, you can choose one of them to install and initialize, or not to install (note ⚠️ but it is strongly recommended to configure in the production environment)
It is recommended to use Greptime as metrics storage.
Greptime is an Open-source, cloud-native, unified observability database for metrics, logs and traces, supporting SQL/PromQL/Streaming.
It's designed to work on infrastructure of the cloud era, and users benefit from its elasticity and commodity storage.
⚠️ If you do not configure a time series database, only the last hour of historical data is retained.
Install GreptimeDvia Docker
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 e91ed57Install Greptime with Docker
$ docker run -d -p 127.0.0.1:4000-4003:4000-4003 \
v "$(pwd)/greptimedb:/tmp/greptimedb" \
--name greptime \
greptime/greptimedb:latest standalone start \
--http-addr 0.0.0.0:4000 \
--rpc-addr 0.0.0.0:4001 \
--mysql-addr 0.0.0.0:4002 \
--postgres-addr 0.0.0.0:4003
-v "$(pwd)/greptimedb:/tmp/greptimedb"
is local persistent mount of greptime data directory. $(pwd)/greptimedb
should be replaced with the actual local directory, default is the greptimedb
directory under the current directory.
use$ docker ps
to check if the database started successfully
Configure the database connection in hertzbeat application.yml
configuration file
Configure HertzBeat's configuration file Modify
hertzbeat/config/application.yml
configuration 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 modifyhertzbeat/config/application.yml
Replacewarehouse.store.greptime
data source parameters, URL account and password.warehouse:
store:
jpa:
enabled: false
greptime:
enabled: true
grpc-endpoints: localhost:4001
http-endpoint: http://localhost:4000
database: public
username: greptime
password: greptimeThe default database is
public
, if you specify another database name, you need to create it ingreptimeDB
in advance.
eg: Create a database namedhertzbeat
with a validity period of 90 days SQL:CREATE DATABASE IF NOT EXISTS hertzbeat WITH(ttl='90d')
Restart HertzBeat
FAQ
Do both the time series databases 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.