home/blog/2023-05-11-greptimedb-store.md
GreptimeDB is an open source, distributed, cloud-native temporal database that fuses temporal data processing and analytics.
Cloud: GreptimePlay
HertzBeat is an open source real-time monitoring and alerting tool with powerful customizable monitoring capabilities and no Agent required.
Email Discord Slack Telegram Pinned Dingtalk WeChat Flybook SMS Webhook and other ways to deliver in time.Http, Jmx, Ssh, Snmp, Jdbc, Prometheus and other protocol specifications, just configure the YML monitoring template in the browser to use these protocols to customize the collection of desired metrics.With
HertzBeat's powerful customization, multi-type support, easy scalability and low coupling, we hope to help developers and small and medium-sized teams to quickly build their own monitoring system.
Cloud: TanCloud
In the following section, we will demonstrate step-by-step how HertzBeat can be combined with GreptimeDB as a storage to store the collected metrics data.
You can refer to the official documentation for more details.
Docker installation of GreptimeDB
$ docker run -p 4000-4004:4000-4004 \
-p 4242:4242 -v "$(pwd)/greptimedb:/tmp/greptimedb" \
--name greptime \
greptime/greptimedb:0.2.0 standalone start \
--http-addr 0.0.0.0.0:4000 \
--rpc-addr 0.0.0.0:4001
-v "$(pwd)/greptimedb:/tmp/greptimedb" is the local persistent mount for the greptimeDB data directory, it is recommended to replace $(pwd)/greptimedb with the actual local directory you want to specify for storage.Use $ docker ps | grep greptime to see if GreptimeDB started successfully.
See the official documentation for details.
Docker installs HertzBeat.
$ docker run -d -p 1157:1157 \
-e LANG=zh_CN.UTF-8 \
-e TZ=Asia/Shanghai \
-v /opt/data:/opt/hertzbeat/data \
-v /opt/application.yml:/opt/hertzbeat/config/application.yml \
--restart=always \
--name hertzbeat apache/hertzbeat
-v /opt/data:/opt/hertzbeat/data : (Optional, data persistence) Important ⚠️ Mount the H2 database files to the local host to ensure that the data will not be lost due to the creation and deletion of the container
-v /opt/application.yml:/opt/hertzbeat/config/application.yml : Mount customized local configuration files to the container, i.e. use local configuration files to overwrite the container configuration files.
Note that the ⚠️ local mount configuration file application.yml needs to exist in advance, and the full contents of the file can be found in the project repository [/script/application.yml](https://github.com/apache/hertzbeat/raw/master/script/ application.yml)
Go to http://ip:1157/ with the default account and password admin/hertzbeat to see if HertzBeat starts successfully.
Modify the HertzBeat configuration file.
Modify the locally mounted HertzBeat configuration file application.yml, in package mode modify `hertzbeat/ config/application.yml
Modify the warehouse.store.jpa.enabled parameter in there to false, configure the warehouse.store.greptime datasource parameter in there, the URL account password, and enable enabled to true.
warehouse:
store:
jpa:
enabled: false
greptime:
enabled: true
endpoint: localhost:4001
Restart HertzBeat.
docker restart hertzbeat
Here's the picture: !
This article took us to experience how to use the open source time-series database GreptimeDB to store the metrics data of the open source real-time monitoring HertzBeat, in general, the two open source products is very simple to get started, the key is that if it is too much trouble do not want to deploy both of them still have cloud services 😂 let you toss.
As one of the developers of the feature HertzBeat supports GreptimeDB, in the actual adaptation process, GreptimeDB's silky-smooth native SDK and relational database-like SQL, let us from other GreptimeDB native SDK and relational database-like SQL make it very easy to switch from other time-series databases like TDengine, IotDB, InfluxDB to GreptimeDB, and the experience is very smooth.
GreptimeDB Github: https://github.com/GreptimeTeam/greptimedb HertzBeat Github: https://github.com/apache/hertzbeat
Finally, you are welcome to be more understanding, more use, more comments, more ISSUE, more PR, more Star support these two did not come out for a long time hope to get care of open source cattle are not afraid of difficulties a small star oh! Do open source, we are sincere, love 💗
Thanks to the contributors of this feature HertzBeat support GreptimeDB @zqr10159, @fengjiachun, @killme2008, @tomsun28