chore: import upstream snapshot with attribution
MCP Bash Server CI / Test MCP Bash Server (dev) (push) Has been cancelled
MCP Bash Server CI / Test MCP Bash Server (release) (push) Has been cancelled

This commit is contained in:
wehub-resource-sync
2026-07-13 13:11:39 +08:00
commit c8cebdfeee
4654 changed files with 626756 additions and 0 deletions
@@ -0,0 +1,158 @@
---
id: account-modify
title: Modify Account Username Password And Secret
sidebar_label: Update Account Secret
---
## Update Account
Apache HertzBeat™ default built-in three user accounts, respectively admin/hertzbeat tom/hertzbeat guest/hertzbeat
If you need add, delete or modify account or password, configure `sureness.yml`. Ignore this step without this demand.
Modify the following **part parameters** in sureness.yml**[Note⚠️Other default sureness configuration parameters should be retained]**
```yaml
resourceRole:
- /api/account/auth/refresh===post===[admin,user,guest]
- /api/apps/**===get===[admin,user,guest]
- /api/monitor/**===get===[admin,user,guest]
- /api/monitor/**===post===[admin,user]
- /api/monitor/**===put===[admin,user]
- /api/monitor/**===delete==[admin]
- /api/monitors/**===get===[admin,user,guest]
- /api/monitors/**===post===[admin,user]
- /api/monitors/**===put===[admin,user]
- /api/monitors/**===delete===[admin]
- /api/alert/**===get===[admin,user,guest]
- /api/alert/**===post===[admin,user]
- /api/alert/**===put===[admin,user]
- /api/alert/**===delete===[admin]
- /api/alerts/**===get===[admin,user,guest]
- /api/alerts/**===post===[admin,user]
- /api/alerts/**===put===[admin,user]
- /api/alerts/**===delete===[admin]
- /api/notice/**===get===[admin,user,guest]
- /api/notice/**===post===[admin,user]
- /api/notice/**===put===[admin,user]
- /api/notice/**===delete===[admin]
- /api/tag/**===get===[admin,user,guest]
- /api/tag/**===post===[admin,user]
- /api/tag/**===put===[admin,user]
- /api/tag/**===delete===[admin]
- /api/summary/**===get===[admin,user,guest]
- /api/summary/**===post===[admin,user]
- /api/summary/**===put===[admin,user]
- /api/summary/**===delete===[admin]
- /api/collector/**===get===[admin,user,guest]
- /api/collector/**===post===[admin,user]
- /api/collector/**===put===[admin,user]
- /api/collector/**===delete===[admin]
- /api/status/page/**===get===[admin,user,guest]
- /api/status/page/**===post===[admin,user]
- /api/status/page/**===put===[admin,user]
- /api/status/page/**===delete===[admin]
# config the resource restful api that need bypass auth protection
# rule: api===method
# eg: /api/v1/source3===get means /api/v1/source3===get can be access by anyone, no need auth.
excludedResource:
- /api/account/auth/**===*
- /api/i18n/**===get
- /api/apps/hierarchy===get
- /api/push/**===*
- /api/status/page/public/**===*
# web ui resource
- /===get
- /dashboard/**===get
- /monitors/**===get
- /alert/**===get
- /account/**===get
- /setting/**===get
- /passport/**===get
- /status/**===get
- /**/*.html===get
- /**/*.js===get
- /**/*.css===get
- /**/*.ico===get
- /**/*.ttf===get
- /**/*.png===get
- /**/*.gif===get
- /**/*.jpg===get
- /**/*.svg===get
- /**/*.json===get
- /**/*.woff===get
- /**/*.eot===get
# swagger ui resource
- /swagger-resources/**===get
- /v2/api-docs===get
- /v3/api-docs===get
# h2 database
- /h2-console/**===*
# account info config
# eg: admin has role [admin,user], password is hertzbeat
# eg: tom has role [user], password is hertzbeat
# eg: lili has role [guest], plain password is lili, salt is 123, salted password is 1A676730B0C7F54654B0E09184448289
account:
- appId: admin
credential: hertzbeat
role: [admin]
- appId: tom
credential: hertzbeat
role: [user]
- appId: guest
credential: hertzbeat
role: [guest]
- appId: lili
# credential = MD5(password + salt)
# plain password: hertzbeat
# attention: digest authentication does not support salted encrypted password accounts
credential: 94C6B34E7A199A9F9D4E1F208093B489
salt: 123
role: [user]
```
Modify the following **part parameters** in sureness.yml **[Note⚠️Other default sureness configuration parameters should be retained]**
```yaml
# user account information
# Here is admin tom lili three accounts
# eg: admin has role [admin,user], password is hertzbeat
# eg: tom has role [user], password is hertzbeat
# eg: lili has role [guest], plain password is lili, salt is 123, salted password is 1A676730B0C7F54654B0E09184448289
account:
- appId: admin
credential: hertzbeat
role: [admin]
- appId: tom
credential: hertzbeat
role: [user]
- appId: guest
credential: hertzbeat
role: [guest]
- appId: lili
# credential = MD5(password + salt)
# plain password: hertzbeat
# attention: digest authentication does not support salted encrypted password accounts
credential: 94C6B34E7A199A9F9D4E1F208093B489
salt: 123
role: [user]
```
## Update Security Secret
> This secret is the key for account security encryption management and needs to be updated to your custom key string of the same length.
Update the `application.yml` file in the `config` directory, modify the `sureness.jwt.secret` parameter to your custom key string of the same length.
```yaml
sureness:
jwt:
secret: 'CyaFv0bwq2Eik0jdrKUtsA6bx4sDJeFV643R
LnfKefTjsIfJLBa2YkhEqEGtcHDTNe4CU6+9
8tVt4bisXQ13rbN0oxhUZR73M6EByXIO+SV5
dKhaX0csgOCTlCxq20yhmUea6H6JIpSE2Rwp'
```
**Restart HertzBeat, access [http://ip:1157/](http://ip:1157/) to explore**
@@ -0,0 +1,43 @@
---
id: baota-deploy
title: Use aaPanel Deploy HertzBeat
sidebar_label: Install via aaPanel
---
Apache HertzBeat supports one-click deployment in the `Docker` application store of the aaPanel.
## Prerequisites
Install aaPanel, go to the [aaPanel](https://www.aapanel.com/new/download.html#install), switch the script and install.
## Install
1. Log in, click `Docker` menu and install the `Docker` `Docker Compose` according the prompts.
> Install the Docker service, skip if it already exists.
![HertzBeat](/img/docs/start/install-to-aapanel-1.png)
2. Find `HertzBeat` in `One-Click Install` and click `Install`
![HertzBeat](/img/docs/start/install-to-aapanel-2.png)
3. Config the domain, name and others, click `OK`
![HertzBeat](/img/docs/start/install-to-aapanel-3.png)
- Name: App name, default the `HertzBeat-random`
- VersionDefault `latest`
- DomainConfig if you need domain access, please configure the domain name here and resolve the domain name to the server
- Allow External AccessIf you need to access directly through `IP+Port`, please check it. If you have already set the domain name, please do not check here
- PortDefault `1157`
4. After submission, the panel will automatically initialize the application, which takes about `1-3` minutes. It can be accessed after the initialization is completed.
## Access HertzBeat
- If you have set a domain name, please enter the domain name directly in the browser address bar to access, such as `http://demo.hertzbeat.apache.org`, you can access the `HertzBeat` console.
- If you choose to access via `IP+Port`, please enter the domain name in the browser address bar to access `http://`\<aaPanelIP>`:1157`, you can access the `HertzBeat` console.
![HertzBeat](/img/home/0.png)
> Default account username: `admin` password: `hertzbeat`
@@ -0,0 +1,42 @@
---
id: custom-config
title: Advanced Params Config
sidebar_label: Advanced Params Config
---
Here it describes how to configure custom parameters for alerts, etc.
**Configuration file `application.yml` of `hertzbeat`**
Configuring the HertzBeat configuration file:
- Modify the configuration file located at `hertzbeat/config/application.yml`
- **Docker Deployment:** ⚠️ When using a Docker container, the `application.yml` file must be mounted to the host machine
- **Installation Package Deployment:** Extract the package and modify the configuration file located at `hertzbeat/config/application.yml`
## 1. Configuring Custom Alert Parameters
```yaml
alerter:
# Custom console URL
console-url: https://console.tancloud.io
```
## 2. Using an External Redis Instead of In-Memory Storage for Real-Time Metric Data
> By default, real-time metric data is stored in memory. You can configure Redis as a replacement using the settings below.
⚠️ Note: Set `memory.enabled: false, redis.enabled: true`
```yaml
warehouse:
store:
memory:
enabled: false
init-size: 1024
redis:
enabled: true
host: 127.0.0.1
port: 6379
password: 123456
```
@@ -0,0 +1,67 @@
---
id: docker-compose-deploy
title: Install HertzBeat via Docker Compose
sidebar_label: Install via Docker Compose
---
:::tip
Suggest to use Docker Compose to deploy HertzBeat and its dependent services.
:::
:::note
This document assumes that you already have Docker and Docker Compose installed in your environment. If not, please refer to the [Docker official documentation](https://docs.docker.com/compose/install/).
Run the `docker compose version` command to check if you have a Docker Compose environment.
:::
1. Download the startup script package
Download the installation script package `apache-hertzbeat-xxx-incubating-docker-compose.tar.gz` from the [download](/docs/download)
2. Choose to use the HertzBeat + PostgreSQL + VictoriaMetrics solution
:::tip
- `apache-hertzbeat-xxx-incubating-docker-compose.tar.gz` contains multiple deployment solutions after decompression. Here we recommend choosing the `hertzbeat-postgresql-victoria-metrics` solution.
- Other deployment methods, please read the README.md file of each deployment solution in detail. The MySQL solution requires you to prepare the MySQL driver package yourself.
:::
- Unzip the script package
```shell
tar zxvf apache-hertzbeat-1.6.0-incubating-docker-compose.tar.gz
```
- Enter the decompression directory and select `HertzBeat + PostgreSQL + VictoriaMetrics` for one-click deployment
```shell
cd apache-hertzbeat-1.6.0-incubating-docker-compose
cd hertzbeat-postgresql-victoria-metrics
```
- One-click start
> Run script in `hertzbeat-postgresql-victoria-metrics` directory
```shell
docker-compose up -d
```
- View service status
> View the running status of each container, up is the normal running status
```shell
docker-compose ps
```
3. Start exploring HertzBeat
Access [http://ip:1157/](http://ip:1157/) in the browser to start exploring and using it. The default account password is admin/hertzbeat.
**HAVE FUN**
----
## FAQ
**The most common problem is network problems, please check in advance**
@@ -0,0 +1,157 @@
---
id: docker-deploy
title: Install HertzBeat via Docker
sidebar_label: Install via Docker
---
:::tip
Using Docker to start HertzBeat with the minimum available environment, no external service dependencies, easy to experience quickly.
But it is not recommended to use in production environment, it is recommended to use Docker Compose deployment, installation package deployment, Kubernetes deployment in production environment.
:::
:::note
It is necessary to have Docker environment in your environment. If not installed, please refer to [Docker official document](https://docs.docker.com/get-docker/)
:::
## Deploy HertzBeat Server
1. Execute the following command
```shell
$ docker run -d -p 1157:1157 -p 1158:1158 \
-v $(pwd)/data:/opt/hertzbeat/data \
-v $(pwd)/logs:/opt/hertzbeat/logs \
-v $(pwd)/application.yml:/opt/hertzbeat/config/application.yml \
-v $(pwd)/sureness.yml:/opt/hertzbeat/config/sureness.yml \
--restart=always \
--name hertzbeat apache/hertzbeat
```
> Command parameter explanation
- `docker run -d` : Run a container in the background via Docker
- `-p 1157:1157 -p 1158:1158` : Mapping container ports to the host, 1157 is web-ui port, 1158 is cluster port.
- `-v $(pwd)/data:/opt/hertzbeat/data` : (optional, data persistence) Important, Mount the H2 database file to the local host, to ensure that the data is not lost due to creating or deleting container.
- `-v $(pwd)/logs:/opt/hertzbeat/logs` : (optional) Mount the log file to the local host to facilitate viewing.
- `-v $(pwd)/application.yml:/opt/hertzbeat/config/application.yml` : (optional) Mount the configuration file to the container (please ensure that the file exists locally). [Download](https://github.com/apache/hertzbeat/raw/master/script/application.yml)
- `-v $(pwd)/sureness.yml:/opt/hertzbeat/config/sureness.yml` : (optional) Mount the account configuration file to the container (please ensure that the file exists locally). [Download](https://github.com/apache/hertzbeat/raw/master/script/sureness.yml)
- `-v $(pwd)/ext-lib:/opt/hertzbeat/ext-lib` : (optional) Mount external third-party JAR package [mysql-jdbc](https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-8.0.25.zip) [oracle-jdbc](https://repo1.maven.org/maven2/com/oracle/database/jdbc/ojdbc8/23.4.0.24.05/ojdbc8-23.4.0.24.05.jar) [oracle-i18n](https://repo.mavenlibs.com/maven/com/oracle/database/nls/orai18n/21.5.0.0/orai18n-21.5.0.0.jar)
- `--name hertzbeat` : (optional) Naming container name hertzbeat
- `--restart=always` : (optional) Configure the container to restart automatically.
- `apache/hertzbeat` : Use the [official application mirror](https://hub.docker.com/r/apache/hertzbeat) to start the container, if the network times out, use `quay.io/tancloud/hertzbeat` instead.
- `--network host` : (optional) Use the host network mode to start Docker, namely making Docker container and hosting share network. `docker run -d --network host .....`
:::tip
- Marked as optional parameters, non-mandatory items, if not needed, delete them.
- This maps the 1157,1158 ports of the container to the 1157,1158 ports of the host. If the port on the host is already occupied, you need to modify the host mapping port.
- When mounting files, the first parameter is your custom local file address, and the second parameter is the container file address. Make sure you have this file locally when mounting.
- You can execute `docker update --restart=always hertzbeat` to configure the container to restart automatically.
- If you want to use the host network mode to start Docker, you can use `docker run -d --network host .....`
:::
2. Start to explore HertzBeat
Access [http://ip:1157/](http://ip:1157/) using browser. You can explore HertzBeat with default account `admin/hertzbeat` now!
### Deploy HertzBeat Collector Cluster(Optional)
:::note
HertzBeat Collector is a lightweight data collector used to collect and send data to HertzBeat Server.
By deploying multiple HertzBeat Collectors, high availability, load balancing, and cloud-edge collaboration of data can be achieved.
:::
![HertzBeat](/img/docs/cluster-arch.png)
1. Execute the following command
```shell
$ docker run -d \
-e IDENTITY=custom-collector-name \
-e MODE=public \
-e MANAGER_HOST=127.0.0.1 \
-e MANAGER_PORT=1158 \
--name hertzbeat-collector apache/hertzbeat-collector
```
> Command parameter explanation
- `docker run -d` : Run a container in the background via Docker
- `-e IDENTITY=custom-collector-name` : (optional) Set the collector unique identity name. Attention the clusters collector name must unique.
- `-e MODE=public` : set the running mode(public or private), public cluster or private
- `-e MANAGER_HOST=127.0.0.1` : Important, Set the main hertzbeat server ip host, must use the server host instead of 127.0.0.1.
- `-e MANAGER_PORT=1158` : (optional) Set the main hertzbeat server port, default 1158.
- `-v $(pwd)/logs:/opt/hertzbeat-collector/logs` : (optional) Mount the log file to the local host to facilitate viewing.
- `--name hertzbeat-collector` : Naming container name hertzbeat-collector
- `apache/hertzbeat-collector` : Use the [official application mirror](https://hub.docker.com/r/apache/hertzbeat-collector) to start the container, if the network times out, use `quay.io/tancloud/hertzbeat-collector` instead.
- `--network host` : (optional) Use the host network mode to start Docker, namely making Docker container and hosting share network. `docker run -d --network host .....`
:::tip
- Marked as optional parameters, non-mandatory items, if not needed, delete them.
- The `127.0.0.1` in `MANAGER_HOST` needs to be replaced with the external IP address of the HertzBeat Server.
- When mounting files, the first parameter is your custom local file address, and the second parameter is the container file address. Make sure you have this file locally when mounting.
- You can execute `docker update --restart=always hertzbeat-collector` to configure the container to restart automatically.
- If you want to use the host network mode to start Docker, you can use `docker run -d --network host .....`
:::
2. Access `http://localhost:1157` and you will see the registered new collector in dashboard.
**HAVE FUN**
----
### FAQ
**The most common problem is network problems, please check in advance**
1. MYSQL, TDENGINE, IoTDB and HertzBeat are deployed on the same host by Docker,HertzBeat use localhost or 127.0.0.1 connect to the database but fail
The problems lies in Docker container failed to visit and connect localhost port. Because the docker default network mode is Bridge mode which can't access local machine through localhost.
> Solution AConfigure application.yml. Change database connection address from localhost to external IP of the host machine.
> Solution BUse the Host network mode to start Docker, namely making Docker container and hosting share network. `docker run -d --network host .....`
2. According to the process deployvisit [http://ip:1157/](http://ip:1157/) no interface
Please refer to the following points to troubleshoot issues
> 1If you switch to dependency service MYSQL databasecheck whether the database is created and started successfully.
> 2Check whether dependent services, IP account and password configuration is correct in HertzBeat's configuration file `application.yml`.
> 3`docker logs hertzbeat` Check whether the container log has errors. If you haven't solved the issue, report it to the communication group or community.
3. Historical monitoring charts have been missing data for a long time
> 1Check whether you configure victoria-metrics or Tdengine or IoTDB. No configuration means no historical chart data.
> 2: Check whether IP account and password configuration is correct in HertzBeat's configuration file `application.yml`.
4. If the history chart on the monitoring page is not displayedpopup [please configure time series database]
> As shown in the popup windowthe premise of history chart display is that you need install and configure hertzbeat's dependency service database.
> Installation and initialization this database, please refer to [Using victoria-metrics to store metrics data](victoria-metrics-init)
5. The time series database is installed and configured, but the page still displays a pop-up [Unable to provide historical chart data, please configure dependent time series database]
> Please check if the configuration parameters are correct
> Is time-series database enable set to true
> Note⚠️If both hertzbeat and time-series database are started under the same host for docker containers, 127.0.0.1 cannot be used for communication between containers by default, and the host IP is changed
> You can check the startup logs according to the logs directory
6. What is the purpose of application.yml
> This file is the configuration file of HertzBeat, used to configure various parameters of HertzBeat, such as database connection information, time series database configuration, etc.
> Download `application.yml` file to the host directory, for example: $(pwd)/application.yml
> Download source [github/script/application.yml](https://github.com/apache/hertzbeat/raw/master/script/application.yml)
> You can modify the configuration yml file according to your needs.
>
> - If you need to use email to send alarms, you need to replace the email server parameters `spring.mail` in `application.yml`
> - **Recommended** If you need to use an external Mysql database to replace the built-in H2 database, you need to replace the `spring.datasource` parameter in `application.yml` For specific steps, see [Using Mysql to replace H2 database](mysql-change)
> - **Recommended** If you need to use the time series database victoria-metrics to store metric data, you need to replace the `warehouse.store.victoria-metrics` parameter in `application.yml` for specific steps, see [Using victoria-metrics to store metrics data](victoria-metrics-init)
7. What is the purpose of sureness.yml
> This file is the user configuration file of HertzBeat, used to configure user information of HertzBeat, such as account password, etc.
> HertzBeat default built-in three user accounts, respectively `admin/hertzbeat tom/hertzbeat guest/hertzbeat`
> If you need update account or password, configure `sureness.yml`. Ignore this step without this demand.
> Download and config `sureness.yml` in the host directoryeg:`$(pwd)/sureness.yml`
> Download from [github/script/sureness.yml](https://github.com/apache/hertzbeat/raw/master/script/sureness.yml)
> For detail steps, please refer to [Configure Account Password](account-modify)
@@ -0,0 +1,74 @@
---
id: greptime-init
title: Use Time Series Database GreptimeDB to Store Metrics Data (Optional)
sidebar_label: Metrics Store GreptimeDB
---
Apache HertzBeat'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 VictoriaMetrics as metrics storage.
[GreptimeDB](https://github.com/GreptimeTeam/greptimedb) is an open-source time-series database with a special focus on scalability, analytical capabilities and efficiency.
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 GreptimeDB via Docker
1. Download and install Docker environment
Docker tools download refer to [Docker official document](https://docs.docker.com/get-docker/).
After the installation you can check if the Docker version normally output at the terminal.
```shell
$ docker -v
Docker version 20.10.12, build e91ed57
```
2. Install GreptimeDB with Docker
```shell
$ 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 greptimedb 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
1. Configure HertzBeat's configuration file
Modify `hertzbeat/config/application.yml` configuration file [/script/application.yml](https://github.com/apache/hertzbeat/raw/master/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 `hertzbeat/config/application.yml`
Replace `warehouse.store.greptime` data source parameters, URL account and password.
```yaml
warehouse:
store:
jpa:
enabled: false
greptime:
enabled: true
grpc-endpoints: localhost:4001
http-endpoint: http://localhost:4000
database: public
username: greptime
password: greptime
```
The default database is `public`, if you specify another database name, you need to create it in `greptimeDB` in advance.
eg: Create a database named `hertzbeat` with a validity period of 90 days SQL: `CREATE DATABASE IF NOT EXISTS hertzbeat WITH(ttl='90d')`
2. Restart HertzBeat
### FAQ
1. Do both the time series databases Greptime, IoTDB or 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.
@@ -0,0 +1,74 @@
---
id: influxdb-init
title: Use Time Series Database InfluxDB to Store Metrics Data (Optional)
sidebar_label: Metrics Store InfluxDB
---
Apache HertzBeat'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 VictoriaMetrics as metrics storage.
**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
>
> Use [HuaweiCloud GaussDB For Influx](https://www.huaweicloud.com/intl/en-us/product/gaussdb.html)
>
> Get the `GaussDB For Influx` service url, username and password config.
⚠️Note `GaussDB For Influx` enable SSL default, the service url should use `https:`
### 2. Install TDengine via Docker
1. Download and install Docker environment
Docker tools download refer to [Docker official document](https://docs.docker.com/get-docker/).
After the installation you can check if the Docker version normally output at the terminal.
```shell
$ docker -v
Docker version 20.10.12, build e91ed57
```
2. Install InfluxDB with Docker
```shell
$ docker run -p 8086:8086 \
-v /opt/influxdb:/var/lib/influxdb \
influxdb:1.8
```
`-v /opt/influxdb:/var/lib/influxdb` is local persistent mount of InfluxDB data directory. `/opt/influxdb` should be replaced with the actual local directory.
use```$ docker ps``` to check if the database started successfully
### Configure the database connection in hertzbeat `application.yml` configuration file
1. Configure HertzBeat's configuration file
Modify `hertzbeat/config/application.yml` configuration file
Note⚠️The docker container way need to mount application.yml file locally, while you can use installation package way to unzip and modify `hertzbeat/config/application.yml`
Replace `warehouse.store.influxdb` data source parameters, URL account and password.
```yaml
warehouse:
store:
# disable jpa
jpa:
enabled: false
# enable influxdb
influxdb:
enabled: true
server-url: http://localhost:8086
username: root
password: root
expire-time: '30d'
replication: 1
```
2. Restart HertzBeat
### FAQ
1. 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.
@@ -0,0 +1,123 @@
---
id: iotdb-init
title: Use Time Series Database IoTDB to Store Metrics Data (Optional)
sidebar_label: Metrics Store IoTDB
---
Apache HertzBeat'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 VictoriaMetrics as metrics storage.
Apache IoTDB is a software system that integrates the collection, storage, management and analysis of time series data of the Internet of Things. We use it to store and analyze the historical data of monitoring metrics collected. Support V1.0.+ version.
**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.**
> If you already have an IoTDB environment, you can skip directly to the YML configuration step.
## Install IoTDB via Docker
>
> Refer to the official website [installation tutorial](https://iotdb.apache.org/UserGuide/V0.13.x/QuickStart/WayToGetIoTDB.html)
1. Download and install Docker environment
Docker tools download refer to [Docker official document](https://docs.docker.com/get-docker/).
After the installation you can check if the Docker version normally output at the terminal.
```shell
$ docker -v
Docker version 20.10.12, build e91ed57
```
2. Install IoTDB via Docker
```shell
$ docker run -d -p 6667:6667 -p 31999:31999 -p 8181:8181 \
-v /opt/iotdb/data:/iotdb/data \
--name iotdb \
apache/iotdb:1.2.2-standalone
```
`-v /opt/iotdb/data:/iotdb/data` is local persistent mount of IotDB data directory.`/iotdb/data` should be replaced with the actual local directory.
use```$ docker ps``` to check if the database started successfully
3. Configure the database connection in hertzbeat `application.yml`configuration file
Modify `hertzbeat/config/application.yml` configuration file
Note⚠️The docker container way need to mount application.yml file locally, while you can use installation package way to unzip and modify `hertzbeat/config/application.yml`
Config the `warehouse.store.jpa.enabled` `false`. Replace `warehouse.store.iot-db` data source parameters, HOST account and password.
```yml
warehouse:
store:
# disable JPA
jpa:
enabled: false
# enable iot-db
iot-db:
enabled: true
host: 127.0.0.1
rpc-port: 6667
username: root
password: root
query-timeout-in-ms: -1
# default '7776000000'90days,unit:ms,-1:no-expire
expire-time: '7776000000'
```
**IoTDB Cluster Configuration**
If you are using IoTDB for clustering, please refer to the configuration below:
```yaml
warehouse:
store:
# Disable default JPA
jpa:
enabled: false
# Enable IoTDB
iot-db:
enabled: true
node-urls: ['127.0.0.1:6667','127.0.0.2:6667','127.0.0.3:6667']
username: root
password: root
# if iotdb version >= 0.13 use default queryTimeoutInMs = -1; else use default queryTimeoutInMs = 0
query-timeout-in-ms: -1
# Data storage time: default '7776000000' (90 days, in milliseconds, -1 means never expire)
expire-time: '7776000000'
```
Configuration parameters:
| Parameter Name | Description |
|---------------------|-------------------------------------------------------------------------------------------|
| enabled | Whether to enable |
| host | IoTDB database address |
| rpc-port | IoTDB database port |
| node-urls | IoTDB cluster addresses |
| username | IoTDB database account |
| password | IoTDB database password |
| version | deprecated |
| query-timeout-in-ms | Query timeout |
| expire-time | Data storage time, default '7776000000' (90 days, in milliseconds, -1 means never expire) |
> If both cluster configuration `node-urls` and standalone configuration are set simultaneously, the cluster `node-urls` configuration takes precedence.
4. Restart HertzBeat
### FAQ
1. Do both the time series databases 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.
2. The historical chart of the monitoring page is not displayed, and pops up [Unable to provide historical chart data, please configure to rely on the time series database]
> As shown in the pop-up window, the premise of displaying the history chart is to install and configure the dependent services of hertzbeat - IotDB database or TDengine database
3. The TDengine database is installed and configured, but the page still displays a pop-up [Unable to provide historical chart data, please configure the dependent time series database]
> Please check if the configuration parameters are correct
> Is td-engine enable set to true
> Note⚠️If both hertzbeat and TDengine are started under the same host for docker containers, 127.0.0.1 cannot be used for communication between containers by default, and the host IP is changed
> You can check the startup logs according to the logs directory
@@ -0,0 +1,113 @@
---
id: mysql-change
title: Use MYSQL Replace H2 Database to Store Metadata(Optional)
sidebar_label: Meta Store MYSQL
---
MySQL is a reliable relational database. In addition to default built-in H2 database, Apache HertzBeat allows you to use MySQL to store structured relational data such as monitoring information, alarm information and configuration information.
> If you already have a MySQL environment and the MySQL version meets the requirements, you can skip directly to the database creation step.
## Supported MySQL Versions
Please ensure you are using a supported MySQL version. HertzBeat only supports MySQL 5.7+ or 8 versions. You can check the MySQL version with the following command:
```shell
$ mysql --version
mysql Ver 8.0.25 for Linux on x86_64 (MySQL Community Server - GPL)
```
### Install MYSQL via Docker
1. Download and install the Docker environment
For Docker installation, please refer to the [Docker official documentation](https://docs.docker.com/get-docker/).
After the installation, please verify in the terminal that the Docker version can be printed normally.
```shell
$ docker -v
Docker version 20.10.12, build e91ed57
```
2. Install MYSQl with Docker
```shell
$ docker run -d --name mysql \
-p 3306:3306 \
-v /opt/data:/var/lib/mysql \
-e MYSQL_ROOT_PASSWORD=123456 \
--restart=always \
mysql:5.7
```
`-v /opt/data:/var/lib/mysql` is local persistent mount of mysql data directory. `/opt/data` should be replaced with the actual local directory.
use ```$ docker ps``` to check if the database started successfully
### Database creation
1. Enter MYSQL or use the client to connect MYSQL service
`mysql -uroot -p123456`
2. Create database named hertzbeat
`create database hertzbeat default charset utf8mb4 collate utf8mb4_general_ci;`
3. Check if hertzbeat database has been successfully created
`show databases;`
### Add MYSQL jdbc driver jar
- Download the MYSQL jdbc driver jar package, such as mysql-connector-java-8.0.25.jar. [https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-8.0.25.zip](https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-8.0.25.zip)
- Copy the jar package to the `hertzbeat/ext-lib` directory.
### Modify hertzbeat's configuration file application.yml and switch data source
- Configure HertzBeat's configuration file
Modify `hertzbeat/config/application.yml` configuration file
Note⚠️The docker container way need to mount application.yml file locally, while you can use installation package way to unzip and modify `hertzbeat/config/application.yml`
Replace `spring.database` data source parameters, URL account and password.
For example:
```yaml
spring:
datasource:
driver-class-name: org.h2.Driver
username: sa
password: 123456
url: jdbc:h2:./data/hertzbeat;MODE=MYSQL
hikari:
max-lifetime: 120000
jpa:
show-sql: false
database-platform: org.eclipse.persistence.platform.database.MySQLPlatform
database: h2
properties:
eclipselink:
logging:
level: SEVERE
```
Specific replacement parameters are as follows and you need to configure account according to the mysql environment:
```yaml
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
username: root
password: 123456
url: jdbc:mysql://mysql:3306/hertzbeat?useUnicode=true&characterEncoding=utf-8&allowPublicKeyRetrieval=true&useSSL=false
hikari:
max-lifetime: 120000
jpa:
show-sql: false
database-platform: org.eclipse.persistence.platform.database.MySQLPlatform
database: mysql
properties:
eclipselink:
logging:
level: SEVERE
```
- It is recommended to set the host field in the MySQL URL to the public IP address when using HertzBeat in docker.
> Note: The above applies to the method of downloading and installing the package. For local data source switching, simply complete the [Database creation](./mysql-change#database-creation) and modify the configuration in `hertzbeat-startup/src/main/resources/application.yml`.
**Start HertzBeat visit [http://ip:1157/](http://ip:1157/) on the browser You can use HertzBeat monitoring alarm, default account and password are admin/hertzbeat**
@@ -0,0 +1,137 @@
---
id: package-deploy
title: Install HertzBeat via Package
sidebar_label: Install via Package
---
:::tip
You can install and run Apache HertzBeat on Linux Windows Mac system, and CPU supports X86/ARM64.
Since version 1.6.0 uses `Java 17` and the installation package no longer provides a built-in JDK version, use the new HertzBeat according to the following situations:
- When the default environment variable on your server is `Java 17`, you do not need to take any action for this step.
- When the default environment variable on your server is not `Java 17`, such as `Java 8` or `Java 11`, and if there are no other applications on your server that require a lower version of Java, download the appropriate version from [https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html](https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html) according to your system, and search the engine for how to set a new environment variable pointing to the new `Java 17`.
- When the default environment variable on your server is not `Java 17`, such as `Java 8` or `Java 11`,and you don't want to change the environment variable because if there are other applications on your server that require a lower version of Java, download the appropriate version from [https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html](https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html) according to your system, and rename the extracted folder to `java`, then copy it to the HertzBeat extraction directory.
:::
## Deploy HertzBeat Server
1. Download installation package
Download installation package `apache-hertzbeat-xxx-incubating-bin.tar.gz` corresponding to your system environment
- [Download Page](/docs/download)
2. Configure HertzBeat's configuration file(optional)
Unzip the installation package to the host eg: /opt/hertzbeat
```shell
tar zxvf apache-hertzbeat-xxx-incubating-bin.tar.gz
```
:::tip
The configuration file is located in `config/application.yml`, you can modify the configuration file according to your needs to configure external dependent services, such as databases, time series databases, etc.
HertzBeat defaults to using internal services when started, but it is recommended to switch to external database services in production environments.
:::
It is recommended to use [PostgreSQL](postgresql-change) for metadata storage and [VictoriaMetrics](victoria-metrics-init) for metric data storage. Specific steps are as follows
- [Switch built-in H2 database to PostgreSQL](postgresql-change)
- [Using VictoriaMetrics to store metric data](victoria-metrics-init)
3. Configure the account file(optional)
HertzBeat default built-in three user accounts, respectively `admin/hertzbeat tom/hertzbeat guest/hertzbeat`
If you need modify account or password, configure `config/sureness.yml`.
For detail steps, please refer to [Configure Account Password](account-modify)
4. Start the service
Execute the startup script in the installation directory `bin/`, or `startup.bat` in windows.
```shell
./startup.sh
```
5. Begin to explore HertzBeat
Access [http://ip:1157/](http://ip:1157/) using browser. You can explore HertzBeat with default account `admin/hertzbeat` now!
### Deploy HertzBeat Collector Cluster(Optional)
:::note
HertzBeat Collector is a lightweight data collector used to collect and send data to HertzBeat Server.
Deploying multiple HertzBeat Collectors can achieve high availability, load balancing, and cloud-edge collaboration of data.
:::
![HertzBeat](/img/docs/cluster-arch.png)
1. Download installation package
Download installation package `apache-hertzbeat-collector-xxx-incubating-bin.tar.gz` corresponding to your system environment
- [Download Page](/docs/download)
2. Configure the collector configuration file
Unzip the installation package to the host eg: /opt/hertzbeat-collector
```shell
tar zxvf apache-hertzbeat-collector-xxx-incubating-bin.tar.gz
```
Configure the collector configuration yml file `config/application.yml`: unique `identity` name, running `mode` (public or private), hertzbeat `manager-host`, hertzbeat `manager-port`
```yaml
collector:
dispatch:
entrance:
netty:
enabled: true
identity: ${IDENTITY:}
mode: ${MODE:public}
manager-host: ${MANAGER_HOST:127.0.0.1}
manager-port: ${MANAGER_PORT:1158}
```
> Parameters detailed explanation
- `identity` : (optional) Set the unique identifier name of the collector. Note that the name of the collector must be unique when there are multiple collectors.
- `mode` : Configure the running mode (public or private), public cluster mode or private cloud-edge mode.
- `manager-host` : Important, configure the address of the connected HertzBeat Server,
- `manager-port` : (optional) Configure the port of the connected HertzBeat Server, default 1158.
3. Start the service
Run command `$ ./bin/startup.sh` or `bin/startup.bat`
4. Begin to explore HertzBeat Collector
Access `http://ip:1157` and you will see the registered new collector in dashboard
**HAVE FUN**
----
### FAQ
1. you need to prepare the JAVA environment in advance
Install JAVA runtime environment-refer to [official website](https://www.oracle.com/java/technologies/downloads/)
requirementJDK17 ENV
download JAVA installation package: [mirror website](https://mirrors.huaweicloud.com/openjdk/)
After installation use command line to check whether you install it successfully.
```shell
$ java -version
java version "17.0.9"
Java(TM) SE Runtime Environment 17.0.9 (build 17.0.9+8-LTS-237)
Java HotSpot(TM) 64-Bit Server VM 17.0.9 (build 17.0.9+8-LTS-237, mixed mode)
```
2. According to the process deployvisit [http://ip:1157/](http://ip:1157/) no interface
Please refer to the following points to troubleshoot issues:
> 1If you switch to dependency service MYSQL databasecheck whether the database is created and started successfully.
> 2Check whether dependent services, IP account and password configuration is correct in HertzBeat's configuration file `hertzbeat/config/application.yml`.
> 3Check whether the running log has errors in `hertzbeat/logs/` directory. If you haven't solved the issue, report it to the communication group or community.
@@ -0,0 +1,101 @@
---
id: postgresql-change
title: Use PostgreSQL Replace H2 Database to Store Metadata(Recommended)
sidebar_label: Meta Store PostgreSQL (Recommended)
---
PostgreSQL is an RDBMS emphasizing extensibility and SQL compliance. In addition to default built-in H2 database, Apache HertzBeat allows you to use PostgreSQL to store structured relational data such as monitoring information, alarm information and configuration information.
> If you have a PostgreSQL environment, you can skip directly to the database creation step.
## Install PostgreSQL via Docker
1. Download and install the Docker environment
Docker tools download refer to [Docker official document](https://docs.docker.com/get-docker/)。
After the installation you can check if the Docker version normally output at the terminal.
```shell
$ docker -v
Docker version 20.10.12, build e91ed57
```
2. Install PostgreSQL with Docker
```shell
docker run -d --name postgresql -p 5432:5432 -e POSTGRES_USER=root -e POSTGRES_PASSWORD=123456 -e TZ=Asia/Shanghai postgres:15
```
use```$ docker ps```to check if the database started successfully
### Database creation
1. Enter postgreSQL or use the client to connect postgreSQL service
```shell
su - postgres
psql
```
2. Create database named hertzbeat
```sql
CREATE DATABASE hertzbeat;
```
3. Check if hertzbeat database has been successfully created
```sql
SELECT * FROM pg_database where datname='hertzbeat';
```
### Modify hertzbeat's configuration file application.yml and switch data source
1. Configure HertzBeat's configuration file
Modify `hertzbeat/config/application.yml` configuration file
Note⚠️The docker container way need to mount application.yml file locally, while you can use installation package way to unzip and modify `hertzbeat/config/application.yml`
Replace `spring.database` data source parameters, URL account and password.
```yaml
spring:
datasource:
driver-class-name: org.h2.Driver
username: sa
password: 123456
url: jdbc:h2:./data/hertzbeat;MODE=MYSQL
hikari:
max-lifetime: 120000
jpa:
show-sql: false
database-platform: org.eclipse.persistence.platform.database.MySQLPlatform
database: h2
properties:
eclipselink:
logging:
level: SEVERE
```
Specific replacement parameters are as follows and you need to configure account, ip, port according to the postgresql environment:
```yaml
spring:
datasource:
driver-class-name: org.postgresql.Driver
username: root
password: 123456
url: jdbc:postgresql://postgresql:5432/hertzbeat
hikari:
max-lifetime: 120000
jpa:
show-sql: false
database-platform: org.eclipse.persistence.platform.database.PostgreSQLPlatform
database: postgresql
properties:
eclipselink:
logging:
level: SEVERE
```
> Note: The above applies to the method of downloading and installing the package. For local data source switching, simply complete the [Database creation](./postgresql-change#database-creation) and modify the configuration in `hertzbeat-startup/src/main/resources/application.yml`.
**Start HertzBeat visit [http://ip:1157/](http://ip:1157/) on the browser You can use HertzBeat monitoring alarm, default account and password are admin/hertzbeat**
@@ -0,0 +1,84 @@
---
id: quickstart
title: Quick Start
sidebar_label: Quick Start
---
## 🐕 Quick Start
- If you wish to deploy Apache HertzBeat locally, please refer to the following Deployment Documentation for instructions.
### 🍞 Install HertzBeat
>
> Apache HertzBeat supports installation through source code, docker or package, cpu support X86/ARM64.
#### 1Install quickly via docker
1. Just one command to get started:
```docker run -d -p 1157:1157 -p 1158:1158 --name hertzbeat apache/hertzbeat```
2. Access `http://localhost:1157` to start, default account: `admin/hertzbeat`
3. Deploy collector clusters(Optional)
```shell
docker run -d -e IDENTITY=custom-collector-name -e MANAGER_HOST=127.0.0.1 -e MANAGER_PORT=1158 --name hertzbeat-collector apache/hertzbeat-collector
```
- `-e IDENTITY=custom-collector-name` : set the collector unique identity name.
- `-e MODE=public` : set the running mode(public or private), public cluster or private cloud-edge.
- `-e MANAGER_HOST=127.0.0.1` : set the main hertzbeat server ip.
- `-e MANAGER_PORT=1158` : set the main hertzbeat server port, default 1158.
Detailed config refer to [Install HertzBeat via Docker](https://hertzbeat.apache.org/docs/start/docker-deploy)
##### 2Install via package
1. Download the release package `hertzbeat-xx.tar.gz` [Download Page](https://hertzbeat.apache.org/docs/download)
2. Configure the HertzBeat configuration yml file `hertzbeat/config/application.yml` (optional)
3. Run command `$ ./bin/startup.sh` or `bin/startup.bat`
4. Access `http://localhost:1157` to start, default account: `admin/hertzbeat`
5. Deploy collector clusters(Optional)
- Download the release package `hertzbeat-collector-xx.tar.gz` to new machine [Download Page](https://hertzbeat.apache.org/docs/download)
- Configure the collector configuration yml file `hertzbeat-collector/config/application.yml`: unique `identity` name, running `mode` (public or private), hertzbeat `manager-host`, hertzbeat `manager-port`
```yaml
collector:
dispatch:
entrance:
netty:
enabled: true
identity: ${IDENTITY:}
mode: ${MODE:public}
manager-host: ${MANAGER_HOST:127.0.0.1}
manager-port: ${MANAGER_PORT:1158}
```
- Run command `$ ./bin/startup.sh` or `bin/startup.bat`
- Access `http://localhost:1157` and you will see the registered new collector in dashboard
Detailed config refer to [Install HertzBeat via Package](package-deploy)
##### 3Start via source code
1. Local source code debugging needs to start the back-end project `manager` and the front-end project `web-app`.
2. Backendneed `maven3+`, `java17`, `lombok`, start the `manager` service.
3. Webneed `nodejs npm angular-cli` environment, Run `ng serve --open` in `web-app` directory after backend startup.
4. Access `http://localhost:4200` to start, default account: `admin/hertzbeat`
Detailed steps refer to [CONTRIBUTING](../community/contribution)
##### 4Install All(hertzbeat+postgresql+tsdb) via Docker-compose
Install and deploy the postgresql/mysql database, victoria-metrics/iotdb/tdengine database and hertzbeat at one time through [docker-compose deployment script](https://github.com/apache/hertzbeat/tree/master/script/docker-compose).
Detailed steps refer to [Install via Docker-Compose](https://github.com/apache/hertzbeat/tree/master/script/docker-compose)
##### 5. Install All(hertzbeat+collector+postgresql+tsdb) via kubernetes helm charts
Install HertzBeat cluster in a Kubernetes cluster by Helm chart.
Detailed steps refer to [Artifact Hub](https://artifacthub.io/packages/helm/hertzbeat/hertzbeat)
**HAVE FUN**
@@ -0,0 +1,50 @@
---
id: rainbond-deploy
title: Use Rainbond Deploy HertzBeat
sidebar_label: Install via Rainbond
---
If you are unfamiliar with Kubernetes, and want to install Apache HertzBeat in Kubernetes, you can use Rainbond to deploy. Rainbond is a cloud-native application management platform built on Kubernetes and simplifies the application deployment to Kubernetes.
## Rainbond Cloud deployment
If you want to deploy "HertzBeat" on "Rainbond Cloud" in one click, you can follow the steps below to do so.
- Open the details of the [HertzBeat application](https://hub.grapps.cn/marketplace/apps/753)
![HertzBeat app desc](/img/docs/start/hertzbeat-desc.png)
- Log in to your Rainbond Cloud account. If you don't have an account, register one in advance!
![Rainbond Cloud](/img/docs/start/rainbond-cloud.png)
- Select the version for installation
![hertzbeat versions](/img/docs/start/hertzbeat-versions.png)
## Open-source Rainbond deployment
### Prerequisites
To install Rainbond, please refer to [Rainbond Quick Install](https://www.rainbond.com/docs/quick-start/quick-install)。
### Deploy HertzBeat
After logging in Rainbond, click Market in the left menu, switch to open source app store, and search HertzBeat in the search box, and click the Install button.
![HertzBeat](/img/docs/start/install-to-rainbond-en.png)
Fill in the following information, and click Confirm button to install.
- Team: select a team or create a new team
- Cluster: select a cluster
- Application: select an application or create a new application
- Version: select a version
After installation, HertzBeat can be accessed via the Access button.
![HertzBeat](/img/docs/start/hertzbeat-topology-en.png)
:::tip
HertzBeat installed via Rainbond, External Mysql database and Redis and IoTDB are used by default, The HertzBeat configuration file is also mounted, which can be modified in `Components -> Environment Configuration -> Configuration File Settings`.
:::
@@ -0,0 +1,93 @@
---
id: ssl-cert-practice
title: SSL Certificate Monitoring Practice
sidebar_label: SSL Certificate Monitoring Practice
---
:::tip
Most websites now support HTTPS by default. The certificate we apply for is usually 3 months or 1 year. It is easy to expire the SSL certificate over time, but we did not find it the first time, or did not update the certificate in time before it expired.
:::
This article introduces how to use the hertzbeat monitoring tool to detect the validity period of our website's SSL certificate, and send us a warning message when the certificate expires or a few days before the certificate expires.
## What is HertzBeat
Apache HertzBeat™ is a real-time monitoring tool with powerful custom monitoring capabilities without Agent. Website monitoring, PING connectivity, port availability, database, operating system, middleware, API monitoring, threshold alarms, alarm notification (email, WeChat, Ding Ding Feishu).
github: [https://github.com/apache/hertzbeat](https://github.com/apache/hertzbeat)
## Install HertzBeat
1. The `docker` environment can be installed with just one command
`docker run -d -p 1157:1157 -p 1158:1158 --name hertzbeat apache/hertzbeat`
2. After the installation is successful, the browser can access `localhost:1157` to start, the default account password is `admin/hertzbeat`
The production environment recommends a complete deployment method, refer [https://hertzbeat.apache.org/docs/start/docker-compose-deploy](https://hertzbeat.apache.org/docs/start/docker-compose-deploy)
## Monitoring SSL Certificates
1. Click Add SSL Certificate Monitor
> HertzBeat Page -> Monitors -> New Monitor -> Service Monitor -> Add SSL Certificate
![HertzBeat](/img/docs/start/ssl_1.png)
2. Configure the monitoring website
> Here we take the example of monitoring Baidu website, configure monitoring host domain name, name, collection interval, etc.
> Click OK Note
![HertzBeat](/img/docs/start/ssl_2.png)
3. View the detection index data
> In the monitoring list, you can view the monitoring status, and in the monitoring details, you can view the metric data chart, etc.
![HertzBeat](/img/docs/start/ssl_3.png)
![HertzBeat](/img/docs/start/ssl_4.png)
4. Set the threshold (triggered when the certificate expires)
> HertzBeat Page -> Alerting -> Threshold -> New Threshold -> ReadTime Threshold Rule
> Configure the threshold, select the SSL certificate metric object, configure the alarm expression-triggered when the metric `expired` is `true`, that is, `equals(expired,"true")`, set the alarm level notification template information, etc.
![HertzBeat](/img/docs/start/ssl_5.png)
> Threshold rule has others function you can try eg: associating thresholds with monitoring, trigger times so on.
5. Set the threshold (triggered one week before the certificate expires)
> In the same way, switch coding threshold, add a new configuration threshold and configure an alarm expression - when the metric expires timestamp `end_timestamp`, the `now()` function is the current timestamp, if the configuration triggers an alarm one week in advance: `end_timestamp <= (now() + 604800000)` , where `604800000` is the 7-day total time difference in milliseconds.
![HertzBeat](/img/docs/start/ssl_6.png)
> Finally, you can see the triggered alarm in the alarm center.
![HertzBeat](/img/docs/start/ssl_7.png)
6. Alarm notification (in time notification via Dingding WeChat Feishu, etc.)
> HertzBeat Page -> Notification -> Notice Receiver -> New Receiver -> Config the Feishu Receiver
![HertzBeat](/img/docs/start/notice_receiver_1.png)
For token configuration such as Feishu, please refer to the help document
[https://hertzbeat.apache.org/docs/help/alert_feishu](https://hertzbeat.apache.org/docs/help/alert_feishu)
> Notification -> Notice Policy -> New Notice Policy -> Enable Notification for the Recipient Just Configured
![HertzBeat](/img/docs/start/notice_policy_1.png)
7. OK When the threshold is triggered, we can receive the corresponding alarm message. If there is no notification, you can also view the alarm information in the alarm center.
----
## The End
The practice of monitoring SSL certificates is here. Of course, for hertzbeat, this function is just the tip of the iceberg. If you think hertzbeat is a good open source project, please give us a Gitee star on GitHub, thank you very much. Thank you for your support. Refill!
**github: [https://github.com/apache/hertzbeat](https://github.com/apache/hertzbeat)**
@@ -0,0 +1,125 @@
---
id: tdengine-init
title: Use Time Series Database TDengine to Store Metrics Data (Optional)
sidebar_label: Metrics Store TDengine
---
Apache HertzBeat'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 VictoriaMetrics as metrics storage.
TDengine is an open-source IoT time-series database, which we use to store the collected historical data of monitoring metrics. Pay attention to support ⚠️ 3.x version.
**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 TDengine 3.x Version.
> If you have TDengine environment, can directly skip to create a database instance.
## Install TDengine via Docker
1. Download and install Docker environment
Docker tools download refer to [Docker official document](https://docs.docker.com/get-docker/).
After the installation you can check if the Docker version normally output at the terminal.
```shell
$ docker -v
Docker version 20.10.12, build e91ed57
```
2. Install TDengine with Docker
```shell
$ docker run -d -p 6030-6049:6030-6049 -p 6030-6049:6030-6049/udp \
-v /opt/taosdata:/var/lib/taos \
--name tdengine -e TZ=Asia/Shanghai \
tdengine/tdengine:3.0.4.0
```
`-v /opt/taosdata:/var/lib/taos` is local persistent mount of TDengine data directory. `/opt/taosdata` should be replaced with the actual local directory.
`-e TZ="Asia/Shanghai"` can set time zone for TDengine.Set up the corresponding time zone you want.
use```$ docker ps``` to check if the database started successfully
### Create database instance
1. Enter database Docker container
```shell
docker exec -it tdengine /bin/bash
```
2. Create database named hertzbeat
After entering the containerexecute `taos` command as follows:
```shell
root@tdengine-server:~/TDengine-server# taos
Welcome to the TDengine shell from Linux, Client Version
Copyright (c) 2020 by TAOS Data, Inc. All rights reserved.
taos>
```
execute commands to create database
```shell
taos> show databases;
taos> CREATE DATABASE hertzbeat KEEP 90 DURATION 10 BUFFER 16;
```
The above statements will create a database named hertzbeat. The data will be saved for 90 days (more than 90 days data will be automatically deleted).
A data file every 10 days, memory blocks buffer is 16MB.
3. Check if hertzbeat database has been created success
```shell
taos> show databases;
taos> use hertzbeat;
```
**Note⚠️If you install TDengine using package**
> In addition to start the serveryou must execute `systemctl start taosadapter` to start adapter
### Configure the database connection in hertzbeat `application.yml` configuration file
1. Configure HertzBeat's configuration file
Modify `hertzbeat/config/application.yml` configuration file
Note⚠️The docker container way need to mount application.yml file locally,while you can use installation package way to unzip and modify `hertzbeat/config/application.yml`
Replace `warehouse.store.td-engine` data source parameters, URL account and password.
```yaml
warehouse:
store:
# disable jpa
jpa:
enabled: false
# enable td-engine
td-engine:
enabled: true
driver-class-name: com.taosdata.jdbc.rs.RestfulDriver
url: jdbc:TAOS-RS://localhost:6041/hertzbeat
username: root
password: taosdata
```
2. Restart HertzBeat
### FAQ
1. Do both the time series databases 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.
2. The historical chart of the monitoring page is not displayed, and pops up [Unable to provide historical chart data, please configure to rely on the time series database]
> As shown in the pop-up window, the premise of displaying the history chart is to install and configure the dependent services of hertzbeat - IotDB database or TDengine database
3. The historical picture of monitoring details is not displayed or has no data, and TDengine has been deployed
> Please confirm whether the installed TDengine version is 3.x, version 2.x are not compatible.
4. The TDengine database is installed and configured, but the page still displays a pop-up [Unable to provide historical chart data, please configure the dependent time series database]
> Please check if the configuration parameters are correct
> Is td-engine enable set to true
> Note⚠️If both hertzbeat and TDengine are started under the same host for docker containers, 127.0.0.1 cannot be used for communication between containers by default, and the host IP is changed
> You can check the startup logs according to the logs directory
@@ -0,0 +1,157 @@
---
id: 1.6.0-update
title: How to update to 1.6.0
sidebar_label: Update to 1.6.0 guide
---
## HertzBeat 1.6.0 Upgrade Guide
**Note: This guide is applicable for upgrading from 1.5.0 to 1.6.0 to version 1.6.0.**
**If you are using an older version, it is recommended to reinstall using the export function, or upgrade to 1.5.0 and then follow this guide to 1.6.0.**
## Binary Installation Package Upgrade
### Upgrade Java Environment
Since version 1.6.0 uses Java 17 and the installation package no longer provides a built-in JDK version, use the new HertzBeat according to the following situations:
- When the default environment variable on your server is Java 17, you do not need to take any action for this step.
- When the default environment variable on your server is not Java 17, such as Java 8 or Java 11, and if there are no other applications on your server that require a lower version of Java, download the appropriate version from [https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html](https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html) according to your system, and search the engine for how to set a new environment variable pointing to the new Java 17.
- When the default environment variable on your server is not Java 17, such as Java 8 or Java 11, and if there are other applications on your server that require a lower version of Java, download the appropriate version from [https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html](https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html) according to your system, and rename the extracted folder to `java`, then copy it to the HertzBeat extraction directory.
### Upgrade Database
Go to [https://github.com/apache/hertzbeat/tree/master/hertzbeat-startup/src/main/resources/db/migration](https://github.com/apache/hertzbeat/tree/master/hertzbeat-startup/src/main/resources/db/migration), choose the directory of your database and execute the corresponding `V160__update_column.sql` file for the upgrade SQL.
### Upgrade Configuration Files
Due to significant changes in `application.yml` and `sureness.yml`, it is recommended to directly use the new `yml` configuration files and then modify them based on your own needs.
#### `application.yml` generally needs to modify the following parts
Default is:
```yaml
datasource:
driver-class-name: org.h2.Driver
username: sa
password: 123456
url: jdbc:h2:./data/hertzbeat;MODE=MYSQL
hikari:
max-lifetime: 120000
jpa:
show-sql: false
database-platform: org.eclipse.persistence.platform.database.MySQLPlatform
database: h2
properties:
eclipselink:
logging:
level: SEVERE
```
If you change to a MySQL database, here is an example:
```yaml
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
username: root
password: root
url: jdbc:mysql://localhost:3306/hertzbeat?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai
hikari:
max-lifetime: 120000
jpa:
show-sql: false
database-platform: org.eclipse.persistence.platform.database.MySQLPlatform
database: mysql
properties:
eclipselink:
logging:
level: SEVERE
```
#### `sureness.yml` modification is optional, usually when you need to change account passwords
```yaml
# account info config
# eg: admin has role [admin,user], password is hertzbeat
# eg: tom has role [user], password is hertzbeat
# eg: lili has role [guest], plain password is lili, salt is 123, salted password is 1A676730B0C7F54654B0E09184448289
account:
- appId: admin
credential: hertzbeat
role: [admin]
- appId: tom
credential: hertzbeat
role: [user]
- appId: guest
credential: hertzbeat
role: [guest]
- appId: lili
# credential = MD5(password + salt)
# plain password: hertzbeat
# attention: digest authentication does not support salted encrypted password accounts
credential: 94C6B34E7A199A9F9D4E1F208093B489
salt: 123
role: [user]
```
### Add the corresponding database drivers
Due to the Apache Foundation's requirements for license compliance, HertzBeat's installation package cannot include dependencies with GPL licenses such as MySQL, Oracle, etc. Users need to add them themselves. Users can download the drivers from the following links and copy them to the `ext-lib` directory of the installation:
- MySQL: [https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-8.0.25.zip](https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-8.0.25.zip)
- Oracle (If you want to monitor Oracle, these two drivers are required):
- [https://repo1.maven.org/maven2/com/oracle/database/jdbc/ojdbc8/23.4.0.24.05/ojdbc8-23.4.0.24.05.jar](https://repo1.maven.org/maven2/com/oracle/database/jdbc/ojdbc8/23.4.0.24.05/ojdbc8-23.4.0.24.05.jar)
- [https://repo.mavenlibs.com/maven/com/oracle/database/nls/orai18n/21.5.0.0/orai18n-21.5.0.0.jar](https://repo.mavenlibs.com/maven/com/oracle/database/nls/orai18n/21.5.0.0/orai18n-21.5.0.0.jar)
Next, run the start-up script as before to experience the latest HertzBeat 1.6.0!
## Docker Upgrade - Mysql Database
- Stop the HertzBeat container:
```shell
docker stop hertzbeat
```
- Upgrade the database script:
- Go to [https://github.com/apache/hertzbeat/tree/master/hertzbeat-startup/src/main/resources/db/migration](https://github.com/apache/hertzbeat/tree/master/hertzbeat-startup/src/main/resources/db/migration), choose the directory of your database and execute the corresponding `V160__update_column.sql` file in MySQL.
- Upgrade the configuration files:
- As mentioned, due to significant changes in `application.yml` and `sureness.yml`, it is recommended to directly mount and use the new `yml` configuration files, and then modify them based on your own needs.
- Add the corresponding database drivers:
- Due to the Apache Foundation's license compliance requirements, HertzBeat's installation package cannot include MySQL, Oracle, and other GPL-licensed dependencies. Users need to add them themselves by downloading the driver jars from the above links and placing them in the local `ext-lib` directory, then mounting `ext-lib` to the container's `/opt/hertzbeat/ext-lib` directory when starting.
Next, run HertzBeat using Docker as before to experience the latest HertzBeat 1.6.0!
## Docker Installation Upgrade - H2 Built-in Database (Not recommended for production use)
- Stop the HertzBeat container:
```shell
docker stop hertzbeat
```
- Edit the H2 database files:
- Assuming you have mounted the H2 database files in the `data` directory to the local system, or copied the `/opt/hertzbeat/data` directory from the old container manually.
- Download the H2 driver jar from [https://mvnrepository.com/artifact/com.h2database/h2/2.2.220](https://mvnrepository.com/artifact/com.h2database/h2/2.2.220).
- Start the database locally using the H2 driver jar:
```shell
java -jar h2-2.2.220.jar -url jdbc:h2:file:./hertzbeat -user sa -password 123456
```
- Upgrade the configuration files:
- As mentioned, due to significant changes in `application.yml` and `sureness.yml`, it is recommended to directly mount and use the new `yml` configuration files, and then modify them based on your own needs.
- Add the corresponding database drivers:
- As mentioned, due to the Apache Foundation's license compliance requirements, HertzBeat's installation package cannot include MySQL, Oracle, and other GPL-licensed dependencies. Users need to add them themselves by downloading the driver jars from the above links and placing them in the local `ext-lib` directory, then mounting `ext-lib` to the container's `/opt/hertzbeat/ext-lib` directory when starting.
Next, run the Docker to start HertzBeat as before to experience the latest HertzBeat 1.6.0!
## Upgrade via Export and Import
If you do not want to go through the tedious script upgrade method mentioned above, you can directly export and import the monitoring tasks and threshold information from the old environment.
- Deploy a new environment with the latest version.
- Export the monitoring tasks and threshold information from the old environment on the page
@@ -0,0 +1,46 @@
---
id: upgrade
title: HertzBeat New Version Upgrade
sidebar_label: Version Upgrade Guide
---
**HertzBeat Release Version List**
- [Download Page](https://hertzbeat.apache.org/docs/download)
- [Github Release](https://github.com/apache/hertzbeat/releases)
- [DockerHub Release](https://hub.docker.com/r/apache/hertzbeat/tags)
Apache HertzBeat's metadata information is stored in H2 or Mysql, PostgreSQL relational databases, and the collected metric data is stored in time series databases such as TDengine and IotDB.
**You need to save and back up the data files of the database and monitoring templates yml files before upgrading**
## Upgrade For Docker Deploy
1. If using custom monitoring templates
- Need to back up docker templates directory `docker cp hertzbeat:/opt/hertzbeat/define ./define` in the container `/opt/hertzbeat/define`
- `docker cp hertzbeat:/opt/hertzbeat/define ./define`
- And mount the template define directory when docker start `-v $(pwd)/define:/opt/hertzbeat/define`
- `-v $(pwd)/define:/opt/hertzbeat/define`
2. If using the built-in default H2 database
- Need to mount or back up `-v $(pwd)/data:/opt/hertzbeat/data` database file directory in the container `/opt/hertzbeat/data`
- Stop and delete the container, delete the local HertzBeat docker image, and pull the new version image
- Refer to [Docker installation of HertzBeat](./docker-deploy) to create a new container using a new image. Note that the database file directory needs to be mounted `-v $(pwd)/data:/opt/hertzbeat/data`
3. If using external relational database Mysql, PostgreSQL
- No need to mount the database file directory in the backup container
- Stop and delete the container, delete the local HertzBeat docker image, and pull the new version image
- Refer to [Docker installation HertzBeat](./docker-deploy) to create a new container using the new image, and configure the database connection in `application.yml`
### Upgrade For Package Deploy
1. If using the built-in default H2 database
- Back up the database file directory under the installation package `/opt/hertzbeat/data`
- If there is a custom monitoring template, you need to back up the template YML under `/opt/hertzbeat/define`
- `bin/shutdown.sh` stops the HertzBeat process and downloads the new installation package
- Refer to [Installation package to install HertzBeat](./package-deploy) to start using the new installation package
2. If using external relational database Mysql, PostgreSQL
- No need to back up the database file directory under the installation package
- If there is a custom monitoring template, you need to back up the template YML under `/opt/hertzbeat/define`
- `bin/shutdown.sh` stops the HertzBeat process and downloads the new installation package
- Refer to [Installation package to install HertzBeat](./package-deploy) to start with the new installation package and configure the database connection in `application.yml`
**HAVE FUN**
@@ -0,0 +1,67 @@
---
id: victoria-metrics-init
title: Use Time Series Database VictoriaMetrics to Store Metrics Data (Recommended)
sidebar_label: Metrics Store VictoriaMetrics (Recommended)
---
Apache HertzBeat'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 VictoriaMetrics as metrics storage.
VictoriaMetrics is a fast, cost-effective and scalable monitoring solution and time series database.Recommend Version(VictoriaMetrics:v1.95.1+, HertzBeat:v1.4.3+)
**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.**
> If you already have a VictoriaMetrics environment, you can skip directly to the YML configuration step.
## Install VictoriaMetrics via Docker
1. Download and install Docker environment
Docker tools download refer to [Docker official document](https://docs.docker.com/get-docker/).
After the installation you can check if the Docker version normally output at the terminal.
```shell
$ docker -v
Docker version 20.10.12, build e91ed57
```
2. Install VictoriaMetrics via Docker
```shell
$ docker run -d -p 8428:8428 \
-v $(pwd)/victoria-metrics-data:/victoria-metrics-data \
--name victoria-metrics \
victoriametrics/victoria-metrics:v1.95.1
```
`-v $(pwd)/victoria-metrics-data:/victoria-metrics-data` is local persistent mount of VictoriaMetrics data directory
use```$ docker ps``` to check if the database started successfully
3. Configure the database connection in hertzbeat `application.yml`configuration file
Modify `hertzbeat/config/application.yml` configuration file
Note⚠️The docker container way need to mount application.yml file locally, while you can use installation package way to unzip and modify `hertzbeat/config/application.yml`
Config the `warehouse.store.jpa.enabled` `false`. Replace `warehouse.store.victoria-metrics` data source parameters, HOST account and password.
```yaml
warehouse:
store:
# disable JPA
jpa:
enabled: false
# enable victoria-metrics
victoria-metrics:
enabled: true
url: http://localhost:8428
username: root
password: root
```
4. Restart HertzBeat
### FAQ
1. 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 can affects the historical chart data.