[Improve] improve markdown format for MD029 (#2604)

Co-authored-by: shown <yuluo08290126@gmail.com>
Co-authored-by: Jast <shenghang@apache.org>
This commit is contained in:
kangli 2024-08-26 10:02:21 +08:00 committed by GitHub
parent 857e4118f0
commit 2f4343c453
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
167 changed files with 4923 additions and 4924 deletions

View File

@ -29,7 +29,7 @@
"siblings_only": true
},
"MD025": true,
"MD029": false,
"MD029": true,
"MD033": false,
"MD036": false,
"MD040": false,

View File

@ -68,23 +68,23 @@ Of course, if you have a good idea, you can also propose it directly on GitHub D
1. First you need to fork your target [hertzbeat repository](https://github.com/apache/hertzbeat).
2. Then download the code locally with git command:
```shell
git clone git@github.com:${YOUR_USERNAME}/hertzbeat.git #Recommended
```
```shell
git clone git@github.com:${YOUR_USERNAME}/hertzbeat.git #Recommended
```
3. After the download is complete, please refer to the getting started guide or README file of the target repository to initialize the project.
4. Then, you can refer to the following command to submit the code:
```shell
git checkout -b a-feature-branch #Recommended
```
```shell
git checkout -b a-feature-branch #Recommended
```
5. Submit the coed as a commit, the commit message format specification required: [module name or type name]feature or bugfix or doc: custom message.
```shell
git add <modified file/path>
git commit -m '[docs]feature: necessary instructions' #Recommended
```
```shell
git add <modified file/path>
git commit -m '[docs]feature: necessary instructions' #Recommended
```
6. Push to the remote repository
```shell
git push origin a-feature-branch
```
```shell
git push origin a-feature-branch
```
7. Then you can initiate a new PR (Pull Request) on GitHub.
Please note that the title of the PR needs to conform to our spec, and write the necessary description in the PR to facilitate code review by Committers and other contributors.
@ -218,23 +218,23 @@ Add WeChat account `ahertzbeat` to pull you into the WeChat group.
1. 首先您需要 Fork 目标仓库 [hertzbeat repository](https://github.com/apache/hertzbeat).
2. 然后 用git命令 将代码下载到本地:
```shell
git clone git@github.com:${YOUR_USERNAME}/hertzbeat.git #Recommended
```
```shell
git clone git@github.com:${YOUR_USERNAME}/hertzbeat.git #Recommended
```
3. 下载完成后,请参考目标仓库的入门指南或者 README 文件对项目进行初始化。
4. 接着,您可以参考如下命令进行代码的提交, 切换新的分支, 进行开发:
```shell
git checkout -b a-feature-branch #Recommended
```
```shell
git checkout -b a-feature-branch #Recommended
```
5. 提交 commit , commit 描述信息需要符合约定格式: [module name or type name]feature or bugfix or doc: custom message.
```shell
git add <modified file/path>
git commit -m '[docs]feature: necessary instructions' #Recommended
```
```shell
git add <modified file/path>
git commit -m '[docs]feature: necessary instructions' #Recommended
```
6. 推送到远程仓库
```shell
git push origin a-feature-branch
```
```shell
git push origin a-feature-branch
```
7. 然后您就可以在 GitHub 上发起新的 PR (Pull Request)。
请注意 PR 的标题需要符合我们的规范,并且在 PR 中写上必要的说明,来方便 Committer 和其他贡献者进行代码审查。

View File

@ -28,7 +28,7 @@ gitee: <https://gitee.com/hertzbeat/hertzbeat>
2. The `docker` environment can be installed with a single command
`docker run -d -p 1157:1157 --name hertzbeat apache/hertzbeat`
`docker run -d -p 1157:1157 --name hertzbeat apache/hertzbeat`
3. Installation success browser visit `localhost:1157` to start, the default account password `admin/hertzbeat
@ -36,63 +36,63 @@ gitee: <https://gitee.com/hertzbeat/hertzbeat>
1. Click Add SSL Certificate Monitor
> System Page -> Monitor Menu -> SSL Certificates -> New SSL Certificate
> System Page -> Monitor Menu -> SSL Certificates -> New SSL Certificate
![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/bd53f343a5b54feab62e71458d076441~tplv-k3u1fbpfcp-zoom-1.image)
![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/bd53f343a5b54feab62e71458d076441~tplv-k3u1fbpfcp-zoom-1.image)
2. Configure monitoring website
> Here is an example to monitor Baidu website, configure the host domain name, name, collection interval, etc. > Click OK.
> Click OK. Note that ⚠️ will test the connectivity of the website before adding it by default, and it will add it only if the connection is successful, of course, you can also gray out the **Whether to test** button.
> Here is an example to monitor Baidu website, configure the host domain name, name, collection interval, etc. > Click OK.
> Click OK. Note that ⚠️ will test the connectivity of the website before adding it by default, and it will add it only if the connection is successful, of course, you can also gray out the **Whether to test** button.
![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/ad1154670648413bb82c8bdeb5b13609~tplv-k3u1fbpfcp-zoom-1.image)
![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/ad1154670648413bb82c8bdeb5b13609~tplv-k3u1fbpfcp-zoom-1.image)
3. Viewing Test Indicator Data
> You can view the task status in the monitor list, and go into the monitor details to view the metrics data graphs etc.
> You can view the task status in the monitor list, and go into the monitor details to view the metrics data graphs etc.
![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/f874b45e909c4bb0acdd28b3fb034a61~tplv-k3u1fbpfcp-zoom-1.image)
![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/f874b45e909c4bb0acdd28b3fb034a61~tplv-k3u1fbpfcp-zoom-1.image)
![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/ef5d7443f8c04818ae5aa28d421203be~tplv-k3u1fbpfcp-zoom-1.image)
![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/ef5d7443f8c04818ae5aa28d421203be~tplv-k3u1fbpfcp-zoom-1.image)
4. Set the threshold (triggered when the certificate expires)
> System Page -> Alarms -> Alarm Thresholds -> Add Thresholds
> System Page -> Alarms -> Alarm Thresholds -> Add Thresholds
![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/8d6205172d43463aa34e534477f132f1~tplv-k3u1fbpfcp-zoom-1.image)
![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/8d6205172d43463aa34e534477f132f1~tplv-k3u1fbpfcp-zoom-1.image)
> Configure thresholds, select SSL certificate indicator object, configure alert expression - triggered when indicator `expired` is `true`, i.e. `equals(expired, "true")` , set alert level notification template message etc.
> Configure thresholds, select SSL certificate indicator object, configure alert expression - triggered when indicator `expired` is `true`, i.e. `equals(expired, "true")` , set alert level notification template message etc.
![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/83d17b381d994f26a6240e01915b2001~tplv-k3u1fbpfcp-zoom-1.image)
![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/83d17b381d994f26a6240e01915b2001~tplv-k3u1fbpfcp-zoom-1.image)
> Associate thresholds with monitors, set which monitors this threshold should be applied to in the threshold list.
> Associate thresholds with monitors, set which monitors this threshold should be applied to in the threshold list.
![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/9b9063d7bcf9454387be0491fc382bd1~tplv-k3u1fbpfcp-zoom-1.image)
![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/9b9063d7bcf9454387be0491fc382bd1~tplv-k3u1fbpfcp-zoom-1.image)
5. set the threshold (triggered one week before certificate expiration)
> Same as above, add a new configuration threshold, configure the alert expression - when the indicator validity timestamp `end_timestamp`, `now()` function for the current timestamp, if you configure to trigger the alert one week in advance i.e.: `end_timestamp <= (now() + 604800000)` , where `604800000` is the total time difference of 7 days. milliseconds.
> Same as above, add a new configuration threshold, configure the alert expression - when the indicator validity timestamp `end_timestamp`, `now()` function for the current timestamp, if you configure to trigger the alert one week in advance i.e.: `end_timestamp <= (now() + 604800000)` , where `604800000` is the total time difference of 7 days. milliseconds.
![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/0d6f837f57c247e09f668f60eff4a0ff~tplv-k3u1fbpfcp-zoom-1.image)
![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/0d6f837f57c247e09f668f60eff4a0ff~tplv-k3u1fbpfcp-zoom-1.image)
> Eventually you can see the triggered alarms in the alarm center.
> Eventually you can see the triggered alarms in the alarm center.
![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/5a61b23127524976b2c209ce0ca6a339~tplv-k3u1fbpfcp-zoom-1.image)
![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/5a61b23127524976b2c209ce0ca6a339~tplv-k3u1fbpfcp-zoom-1.image)
6. Alarm notification (timely notification via NailWeChatFlysheet, etc.)
> Monitoring System -> Alert Notification -> Add Recipients
> Monitoring System -> Alert Notification -> Add Recipients
![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/7f36956060ef410a82bbecafcbb2957f~tplv-k3u1fbpfcp-zoom-1.image)
![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/7f36956060ef410a82bbecafcbb2957f~tplv-k3u1fbpfcp-zoom-1.image)
You can refer to the help file for the token configuration of Nail WeChat Flying Book, etc.
You can refer to the help file for the token configuration of Nail WeChat Flying Book, etc.
<https://hertzbeat.com/docs/help/alert_dingtalk>
<https://tancloud.cn/docs/help/alert_dingtalk>
<https://hertzbeat.com/docs/help/alert_dingtalk>
<https://tancloud.cn/docs/help/alert_dingtalk>
> Alert Notification -> Add new alert notification policy -> Enable notification for the recipients you just configured
> Alert Notification -> Add new alert notification policy -> Enable notification for the recipients you just configured
![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/d976343e81f843138344a039f3aff8a3~tplv-k3u1fbpfcp-zoom-1.image)
![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/d976343e81f843138344a039f3aff8a3~tplv-k3u1fbpfcp-zoom-1.image)
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.

View File

@ -31,15 +31,15 @@ tags: [opensource, practice]
1. The metric collection is disabled by default, you need to modify the parameters in `conf/iotdb-metric.yml` first, then restart the server
```
# Whether to start the monitoring module, the default is false
enableMetric: true
# Data provision method, externally provide metrics data through jmx and prometheus protocol, optional parameters: [JMX, PROMETHEUS, IOTDB], IOTDB is closed by default.
metricReporterList:
- JMX
- PROMETHEUS
```
```yaml
# Whether to start the monitoring module, the default is false
enableMetric: true
# Data provision method, externally provide metrics data through jmx and prometheus protocol, optional parameters: [JMX, PROMETHEUS, IOTDB], IOTDB is closed by default.
metricReporterList:
- JMX
- PROMETHEUS
```
2. Restart IoTDB, open a browser or use curl to access <http://ip:9091/metrics>, and you can see the metric data.
@ -47,28 +47,28 @@ metricReporterList:
1. Click Add IoTDB Monitoring
Path: Menu -> Database Monitoring -> IoTDB Monitoring -> Add IoTDB Monitoring
Path: Menu -> Database Monitoring -> IoTDB Monitoring -> Add IoTDB Monitoring
![hertzbeat](/img/blog/monitor-iotdb-1.png)
![hertzbeat](/img/blog/monitor-iotdb-1.png)
2. Configure the parameters required for monitoring IoTDB
Fill in the IoTDB **service IP** and **monitoring port** (default 9091) on the monitoring page, and finally click OK to add.
For other parameters such as **collection interval**, **timeout period**, etc., please refer to [Help Documentation](https://hertzbeat.com/docs/help/iotdb/) <https://hertzbeat.com/docs/help> /iotdb/
Fill in the IoTDB **service IP** and **monitoring port** (default 9091) on the monitoring page, and finally click OK to add.
For other parameters such as **collection interval**, **timeout period**, etc., please refer to [Help Documentation](https://hertzbeat.com/docs/help/iotdb/) <https://hertzbeat.com/docs/help> /iotdb/
![hertzbeat](/img/blog/monitor-iotdb-2.png)
![hertzbeat](/img/blog/monitor-iotdb-2.png)
3. Complete ✅, now we have added the monitoring of IoTDB, check the monitoring list to see our added items.
![hertzbeat](/img/blog/monitor-iotdb-3.png)
![hertzbeat](/img/blog/monitor-iotdb-3.png)
4. Click **Operation**->**Monitoring Details Icon** of the monitoring list item to browse the real-time monitoring metric data of IoTDB.
![hertzbeat](/img/blog/monitor-iotdb-4.png)
![hertzbeat](/img/blog/monitor-iotdb-4.png)
5. Click **Monitoring History Details TAB** to browse IoTDB's historical monitoring metric data chart📈.
![hertzbeat](/img/blog/monitor-iotdb-5.png)
![hertzbeat](/img/blog/monitor-iotdb-5.png)
**Complete DONE! Through the above steps, it is actually two steps to sum up**
@ -83,29 +83,29 @@ For other parameters such as **collection interval**, **timeout period**, etc.,
1. Configure a threshold alarm for an important metric
Path: Menu -> Alarm Threshold -> Add Threshold
Path: Menu -> Alarm Threshold -> Add Threshold
- Select the configured metric object. IotDB monitors many metrics, one of which is related to the status of the node `cluster_node_status` -> `status` (node status, 1=online 2=offline).
- Here we configure to send an alarm when the metric `status==2`, the alarm level is **Critical Alarm**, which is triggered once, as shown in the figure below.
- Select the configured metric object. IotDB monitors many metrics, one of which is related to the status of the node `cluster_node_status` -> `status` (node status, 1=online 2=offline).
- Here we configure to send an alarm when the metric `status==2`, the alarm level is **Critical Alarm**, which is triggered once, as shown in the figure below.
![hertzbeat](/img/blog/monitor-iotdb-6.png)
![hertzbeat](/img/blog/monitor-iotdb-6.png)
2. Add message notification recipients
Path: Menu -> Alarm Notification -> Alarm Recipient -> Add New Recipient
Path: Menu -> Alarm Notification -> Alarm Recipient -> Add New Recipient
Message notification methods support **email, DingTalk, WeChat Work, Feishu, WebHook, SMS**, etc. Here we take the commonly used DingTalk as an example.
Message notification methods support **email, DingTalk, WeChat Work, Feishu, WebHook, SMS**, etc. Here we take the commonly used DingTalk as an example.
- Refer to this [Help Documentation](https://hertzbeat.com/docs/help/alert_dingtalk) <https://hertzbeat.com/docs/help/alert_dingtalk> to configure the robot on DingTalk and set the security custom keyword `HertzBeat`, get the corresponding `access_token` value.
- Configure the receiver parameters in HertzBeat as follows.
- Refer to this [Help Documentation](https://hertzbeat.com/docs/help/alert_dingtalk) <https://hertzbeat.com/docs/help/alert_dingtalk> to configure the robot on DingTalk and set the security custom keyword `HertzBeat`, get the corresponding `access_token` value.
- Configure the receiver parameters in HertzBeat as follows.
【Alarm Notification】->【New Recipient】->【Select DingTalk Robot Notification Method】->【Set DingTalk Robot ACCESS_TOKEN】->【OK】
【Alarm Notification】->【New Recipient】->【Select DingTalk Robot Notification Method】->【Set DingTalk Robot ACCESS_TOKEN】->【OK】
![hertzbeat](/img/blog/alert-notice-1.png)
![hertzbeat](/img/blog/alert-notice-1.png)
3. Configure the associated alarm notification strategy ⚠️ [Add notification strategy] -> [Associate the recipient just set] -> [OK]
![hertzbeat](/img/blog/alert-notice-2.png)
![hertzbeat](/img/blog/alert-notice-2.png)
### Finished, now wait for the warning message to come. ding ding ding ding

View File

@ -42,27 +42,27 @@ tags: [opensource, practice]
1. Add the `metrics plugin` dependency to the `pom.xml` file of the gateway.
```xml
<dependency>
<groupId>org.apache.shenyu</groupId>
<artifactId>shenyu-spring-boot-starter-plugin-metrics</artifactId>
<version>${project.version}</version>
</dependency>
```
```xml
<dependency>
<groupId>org.apache.shenyu</groupId>
<artifactId>shenyu-spring-boot-starter-plugin-metrics</artifactId>
<version>${project.version}</version>
</dependency>
```
2. `metric` plugin Capture is turned off by default, edit the following in the gateway's configuration `yaml` file:
```yaml
shenyu:
metrics:
enabled: true #Set to true to enable
name: prometheus
host: 127.0.0.1 #exposed ip
port: 8090 #Exposed port
jmxConfig: #jmx configuration
props: #jvm_enabled: true
jvm_enabled: true #Enable monitoring metrics for jvm
```
```yaml
shenyu:
metrics:
enabled: true #Set to true to enable
name: prometheus
host: 127.0.0.1 #exposed ip
port: 8090 #Exposed port
jmxConfig: #jmx configuration
props: #jvm_enabled: true
jvm_enabled: true #Enable monitoring metrics for jvm
```
3. Restart ShenYu Gateway, open a browser or use curl to access `http://ip:8090`, you can see the metric data.
@ -70,30 +70,30 @@ shenyu:
1. Click Add ShenYu Monitor
Path: Menu -> Middleware Monitor -> ShenYu Monitor -> Add ShenYu Monitor
Path: Menu -> Middleware Monitor -> ShenYu Monitor -> Add ShenYu Monitor
![hertzbeat](/img/blog/monitor-shenyu-1.png)
![hertzbeat](/img/blog/monitor-shenyu-1.png)
2. Configure the parameters required for monitoring ShenYu
On the monitor page, fill in ShenYu **service IP**, **monitor port** (default 8090), and click OK to add.
For other parameters such as **collection interval**, **timeout**, etc., you can refer to the [help file](https://hertzbeat.com/docs/help/shenyu/) <https://hertzbeat.com/docs/help/shenyu/>
On the monitor page, fill in ShenYu **service IP**, **monitor port** (default 8090), and click OK to add.
For other parameters such as **collection interval**, **timeout**, etc., you can refer to the [help file](https://hertzbeat.com/docs/help/shenyu/) <https://hertzbeat.com/docs/help/shenyu/>
![hertzbeat](/img/blog/monitor-shenyu-1.png)
![hertzbeat](/img/blog/monitor-shenyu-1.png)
3. Done ✅, now we have added monitoring for ShenYu, check the monitor list to see our additions.
![hertzbeat](/img/blog/monitor-shenyu-3.png)
![hertzbeat](/img/blog/monitor-shenyu-3.png)
4. Click **Options**->**Monitoring Details icon** in the monitor list to view ShenYu's real-time monitoring metrics.
![hertzbeat](/img/blog/monitor-shenyu-4.png)
![hertzbeat](/img/blog/monitor-shenyu-4.png)
5. Click the **Monitor History TAB** to view ShenYu's historical monitoring metrics graphs 📈.
![hertzbeat](/img/blog/monitor-shenyu-5.png)
![hertzbeat](/img/blog/monitor-shenyu-5.png)
![hertzbeat](/img/blog/monitor-shenyu-6.png)
![hertzbeat](/img/blog/monitor-shenyu-6.png)
**DONE! With the above steps, it's really only two steps**
@ -111,33 +111,33 @@ Of course, just looking at it is not perfect, monitoring is often accompanied by
1. Configure an alarm threshold for an important metric.
Path: Menu -> Alert Thresholds -> Add Thresholds
Path: Menu -> Alert Thresholds -> Add Thresholds
- There are a lot of metrics in ShenYu monitoring, for example, we will set the threshold for the `number of open file descriptors` `process_open_fds` -> `value` metric, which will alert you when the number of open file descriptors on the server side is greater than 3,000.
- Here we configure an alert to be issued when the `value' of`process_open_fds` exceeds 3000, with an alert level of **Warning alert**, which is triggered three times, as shown in the following figure.
- There are a lot of metrics in ShenYu monitoring, for example, we will set the threshold for the `number of open file descriptors` `process_open_fds` -> `value` metric, which will alert you when the number of open file descriptors on the server side is greater than 3,000.
- Here we configure an alert to be issued when the `value' of`process_open_fds` exceeds 3000, with an alert level of **Warning alert**, which is triggered three times, as shown in the following figure.
![hertzbeat](/img/blog/monitor-shenyu-7.png)
![hertzbeat](/img/blog/monitor-shenyu-7.png)
2. Add message notification recipients
> Configure recipients to let alert message know who to send to and in what way.
> Configure recipients to let alert message know who to send to and in what way.
Path: Menu -> Alert Notification -> Alert Recipients -> Add New Recipient.
Path: Menu -> Alert Notification -> Alert Recipients -> Add New Recipient.
Message notification methods support **Email, Nail, WeChat, Flybook, WebHook, SMS**, etc. Here we take the commonly used Nail as an example.
Message notification methods support **Email, Nail, WeChat, Flybook, WebHook, SMS**, etc. Here we take the commonly used Nail as an example.
- Refer to this [help document](https://hertzbeat.com/docs/help/alert_dingtalk) <https://hertzbeat.com/docs/help/alert_dingtalk> Configure the bot on the pinning side, set the security customization keyword `HertzBeat`, get the corresponding `access_token` value.
- Configure the recipient parameters in HertzBeat as follows.
- Refer to this [help document](https://hertzbeat.com/docs/help/alert_dingtalk) <https://hertzbeat.com/docs/help/alert_dingtalk> Configure the bot on the pinning side, set the security customization keyword `HertzBeat`, get the corresponding `access_token` value.
- Configure the recipient parameters in HertzBeat as follows.
[Alert Notification] -> [Add Recipient] -> [Select Nailed Bot Notification Method] -> [Set Nailed Bot ACCESS_TOKEN] -> [OK]
[Alert Notification] -> [Add Recipient] -> [Select Nailed Bot Notification Method] -> [Set Nailed Bot ACCESS_TOKEN] -> [OK]
![hertzbeat](/img/blog/alert-notice-1.png)
![hertzbeat](/img/blog/alert-notice-1.png)
3. Configure the associated alert notification policy ⚠️ [Add Notification Policy] -> [Associate the recipient you just set] -> [OK] !
> Configure the alert notification policy to bind alert messages to recipients so that you can decide which alerts go to which person.
> Configure the alert notification policy to bind alert messages to recipients so that you can decide which alerts go to which person.
![hertzbeat](/img/blog/alert-notice-2.png)
![hertzbeat](/img/blog/alert-notice-2.png)
### Over and out, now wait for the alert message to come through. Ding, ding, ding, ding

View File

@ -36,76 +36,76 @@ tags: [opensource, practice]
1. Enable the SpringBoot Actuator Endpoint to expose the `DynamicTp` metrics interface.
```yaml
management:
endpoints:
web:
exposure:
include: '*'
```
```yaml
management:
endpoints:
web:
exposure:
include: '*'
```
2. Reboot and test access to the metrics interface `ip:port/actuator/dynamic-tp` to see if it responds with json data as follows.
```json
[
{
"poolName": "commonExecutor",
"corePoolSize": 1,
"maximumPoolSize": 1,
"queueType": "LinkedBlockingQueue",
"queueCapacity": 2147483647,
"queueSize": 0,
"fair": false,
"queueRemainingCapacity": 2147483647,
"activeCount": 0,
"taskCount": 0,
"completedTaskCount": 0,
"largestPoolSize": 0,
"poolSize": 0,
"waitTaskCount": 0,
"rejectCount": 0,
"rejectHandlerName": null,
"dynamic": false,
"runTimeoutCount": 0,
"queueTimeoutCount": 0
},
{
"maxMemory": "4 GB",
"totalMemory": "444 MB",
"freeMemory": "250.34 MB",
"usableMemory": "3.81 GB"
}
]
```
```json
[
{
"poolName": "commonExecutor",
"corePoolSize": 1,
"maximumPoolSize": 1,
"queueType": "LinkedBlockingQueue",
"queueCapacity": 2147483647,
"queueSize": 0,
"fair": false,
"queueRemainingCapacity": 2147483647,
"activeCount": 0,
"taskCount": 0,
"completedTaskCount": 0,
"largestPoolSize": 0,
"poolSize": 0,
"waitTaskCount": 0,
"rejectCount": 0,
"rejectHandlerName": null,
"dynamic": false,
"runTimeoutCount": 0,
"queueTimeoutCount": 0
},
{
"maxMemory": "4 GB",
"totalMemory": "444 MB",
"freeMemory": "250.34 MB",
"usableMemory": "3.81 GB"
}
]
```
#### ii. To add DynamicTp thread pool monitoring to the HertzBeat monitoring page
1. Click Add DynamicTp Monitor
Path: Menu -> Middleware Monitor -> DynamicTp Monitor -> Add DynamicTp Monitor
Path: Menu -> Middleware Monitor -> DynamicTp Monitor -> Add DynamicTp Monitor
![hertzbeat](/img/blog/monitor-dynamic-tp-1.png)
![hertzbeat](/img/blog/monitor-dynamic-tp-1.png)
2. Configure the parameters required for monitoring DynamicTp.
On the monitor page, fill in DynamicTp **service IP**, **monitoring port** (default 8080), and finally click OK to add it.
For other parameters such as **collection interval**, **timeout**, etc., you can refer to [help](https://hertzbeat.com/docs/help/dynamic_tp/) <https://hertzbeat.com/docs/help/dynamic_tp/>
On the monitor page, fill in DynamicTp **service IP**, **monitoring port** (default 8080), and finally click OK to add it.
For other parameters such as **collection interval**, **timeout**, etc., you can refer to [help](https://hertzbeat.com/docs/help/dynamic_tp/) <https://hertzbeat.com/docs/help/dynamic_tp/>
![hertzbeat](/img/blog/monitor-dynamic-tp-2.png)
![hertzbeat](/img/blog/monitor-dynamic-tp-2.png)
3. Done ✅, now we have added monitoring for DynamicTp, check the monitor list to see our additions.
![hertzbeat](/img/blog/monitor-dynamic-tp-1.png)
![hertzbeat](/img/blog/monitor-dynamic-tp-1.png)
4. Click **Options**->**Monitor Details icon** in the Monitor list to view the real-time monitoring metrics of the DynamicTp thread pool.
![hertzbeat](/img/blog/monitor-dynamic-tp-3.png)
![hertzbeat](/img/blog/monitor-dynamic-tp-3.png)
5. Click the **Monitoring History TAB** to view a graphical representation of the historical monitoring metrics for the DynamicTp thread pool 📈.
![hertzbeat](/img/blog/monitor-dynamic-tp-4.png)
![hertzbeat](/img/blog/monitor-dynamic-tp-4.png)
![hertzbeat](/img/blog/monitor-dynamic-tp-5.png)
![hertzbeat](/img/blog/monitor-dynamic-tp-5.png)
**DONE! With the above steps, it's really just two steps**
@ -123,33 +123,33 @@ Of course, just watching is not perfect, monitoring is often accompanied by alar
1. Configure an alarm threshold for an important metric.
Path: Menu -> Alert Thresholds -> Add Thresholds
Path: Menu -> Alert Thresholds -> Add Thresholds
- DynamicTp monitors some thread pool related metrics, for example, we set the threshold for the `run_timeout_count` `thread_pool_running` -> `run_timeout_count` metric, which will raise an alarm when the thread_timeout_count is greater than one.
- Here we configure an alert to be issued when `thread_pool_running` has a `run_timeout_count>1`, with an alert level of **Serious Alert**, which is triggered three times, as shown in the following figure.
- DynamicTp monitors some thread pool related metrics, for example, we set the threshold for the `run_timeout_count` `thread_pool_running` -> `run_timeout_count` metric, which will raise an alarm when the thread_timeout_count is greater than one.
- Here we configure an alert to be issued when `thread_pool_running` has a `run_timeout_count>1`, with an alert level of **Serious Alert**, which is triggered three times, as shown in the following figure.
![hertzbeat](/img/blog/monitor-dynamic-tp-6.png)
![hertzbeat](/img/blog/monitor-dynamic-tp-6.png)
2. Add message notification recipients
> Configure recipients to let alert message know who to send to and in what way.
> Configure recipients to let alert message know who to send to and in what way.
Path: Menu -> Alert Notification -> Alert Recipient -> Add Recipient.
Path: Menu -> Alert Notification -> Alert Recipient -> Add Recipient.
Message notification methods support **Email, Dingtalk, WeChat, Flybook, WebHook, SMS**, etc. We take the commonly used Dingtalk as an example.
Message notification methods support **Email, Dingtalk, WeChat, Flybook, WebHook, SMS**, etc. We take the commonly used Dingtalk as an example.
- Refer to this [help document](https://hertzbeat.com/docs/help/alert_dingtalk) <https://hertzbeat.com/docs/help/alert_dingtalk> Configure the bot on Dingtalk side, set the security customization keyword `HertzBeat`, get the corresponding `access_token` value.
- Configure the recipient parameters in HertzBeat as follows.
- Refer to this [help document](https://hertzbeat.com/docs/help/alert_dingtalk) <https://hertzbeat.com/docs/help/alert_dingtalk> Configure the bot on Dingtalk side, set the security customization keyword `HertzBeat`, get the corresponding `access_token` value.
- Configure the recipient parameters in HertzBeat as follows.
[Alert Notification] -> [Add Recipient] -> [Choose Dingtalk bot notification method] -> [Set Dingtalk bot ACCESS_TOKEN] -> [OK]
[Alert Notification] -> [Add Recipient] -> [Choose Dingtalk bot notification method] -> [Set Dingtalk bot ACCESS_TOKEN] -> [OK]
![hertzbeat](/img/blog/alert-notice-1.png)
![hertzbeat](/img/blog/alert-notice-1.png)
3. Configure the associated alert notification policy ⚠️ [Add Notification Policy] -> [Associate the recipient you just set] -> [OK] !
> Configure the alert notification policy to bind alert messages to recipients so that you can decide which alerts go to which person.
> Configure the alert notification policy to bind alert messages to recipients so that you can decide which alerts go to which person.
![hertzbeat](/img/blog/alert-notice-2.png)
![hertzbeat](/img/blog/alert-notice-2.png)
### Over and out, now wait for the alert message to come through. Ding, ding, ding, ding

View File

@ -33,28 +33,28 @@ Keywords: [Open source monitoring tool, open source database monitoring, Mysql d
1. Click Add Mysql Monitoring
Path: Menu -> Database Monitoring -> Mysql Database -> Add Mysql Database Monitoring
Path: Menu -> Database Monitoring -> Mysql Database -> Add Mysql Database Monitoring
![hertzbeat](/img/blog/monitor-mysql-1.png)
![hertzbeat](/img/blog/monitor-mysql-1.png)
2. Configure the parameters required for the new monitoring Mysql database
On the monitoring page, fill in Mysql **service IP**, **monitoring port** (default 3306), **account password, etc.**, and finally click OK to add.
For other parameters such as **collection interval**, **timeout period**, etc., please refer to [Help Documentation](https://hertzbeat.com/docs/help/mysql/) <https://hertzbeat.com/docs/help> /mysql/
On the monitoring page, fill in Mysql **service IP**, **monitoring port** (default 3306), **account password, etc.**, and finally click OK to add.
For other parameters such as **collection interval**, **timeout period**, etc., please refer to [Help Documentation](https://hertzbeat.com/docs/help/mysql/) <https://hertzbeat.com/docs/help> /mysql/
![hertzbeat](/img/blog/monitor-mysql-2.png)
![hertzbeat](/img/blog/monitor-mysql-2.png)
3. Complete ✅, now we have added the monitoring of the Mysql database, check the monitoring list to see our added items.
![hertzbeat](/img/blog/monitor-mysql-1.png)
![hertzbeat](/img/blog/monitor-mysql-1.png)
4. Click **Operation**->**Monitoring Details Icon** of the monitoring list item to browse the real-time monitoring metric data of the Mysql database.
![hertzbeat](/img/blog/monitor-mysql-3.png)
![hertzbeat](/img/blog/monitor-mysql-3.png)
5. Click **Monitoring History Details TAB** to browse the historical monitoring metric data chart of Mysql database📈.
![hertzbeat](/img/blog/monitor-mysql-4.png)
![hertzbeat](/img/blog/monitor-mysql-4.png)
**DONE! Done! Through the above steps, in fact, it only takes one step to sum up**
@ -71,35 +71,35 @@ Of course, just looking at it is definitely not perfect. Monitoring is often acc
1. Configure an alarm threshold for an important metric
Path: Menu -> Threshold Rules -> Add Threshold
Path: Menu -> Threshold Rules -> Add Threshold
- Select the configured metric object. Mysql database monitoring is mainly about database performance and other related metrics. For example, we set the threshold for the metric `query cache hit rate` `cache` -> `query_cache_hit_rate`. When the query cache hit rate of Mysql is very low An alarm is issued when it is less than 30%.
- Here we configure to send an alarm when the `query_cache_hit_rate<30` of this metric `cache`, the alarm level is **serious alarm**, and it will be triggered after three times, as shown in the figure below.
- Select the configured metric object. Mysql database monitoring is mainly about database performance and other related metrics. For example, we set the threshold for the metric `query cache hit rate` `cache` -> `query_cache_hit_rate`. When the query cache hit rate of Mysql is very low An alarm is issued when it is less than 30%.
- Here we configure to send an alarm when the `query_cache_hit_rate<30` of this metric `cache`, the alarm level is **serious alarm**, and it will be triggered after three times, as shown in the figure below.
![hertzbeat](/img/blog/monitor-mysql-5.png)
![hertzbeat](/img/blog/monitor-mysql-5.png)
![hertzbeat](/img/blog/monitor-mysql-6.png)
![hertzbeat](/img/blog/monitor-mysql-6.png)
2. Add message notification recipients
> Configure the receiver to let the alarm message know who to send and how to send it.
> Configure the receiver to let the alarm message know who to send and how to send it.
Path: Menu -> Alarm Notification -> Alarm Recipient -> Add New Recipient
Path: Menu -> Alarm Notification -> Alarm Recipient -> Add New Recipient
Message notification methods support **email, DingTalk, WeChat Work, Feishu, WebHook, SMS**, etc. Here we take the commonly used DingTalk as an example.
Message notification methods support **email, DingTalk, WeChat Work, Feishu, WebHook, SMS**, etc. Here we take the commonly used DingTalk as an example.
- Refer to this [Help Documentation](https://hertzbeat.com/docs/help/alert_dingtalk) <https://hertzbeat.com/docs/help/alert_dingtalk> to configure the robot on DingTalk and set the security custom keyword `HertzBeat`, get the corresponding `access_token` value.
- Configure the receiver parameters in HertzBeat as follows.
- Refer to this [Help Documentation](https://hertzbeat.com/docs/help/alert_dingtalk) <https://hertzbeat.com/docs/help/alert_dingtalk> to configure the robot on DingTalk and set the security custom keyword `HertzBeat`, get the corresponding `access_token` value.
- Configure the receiver parameters in HertzBeat as follows.
【Alarm Notification】->【New Recipient】->【Select DingTalk Robot Notification Method】->【Set DingTalk Robot ACCESS_TOKEN】->【OK】
【Alarm Notification】->【New Recipient】->【Select DingTalk Robot Notification Method】->【Set DingTalk Robot ACCESS_TOKEN】->【OK】
![hertzbeat](/img/blog/alert-notice-1.png)
![hertzbeat](/img/blog/alert-notice-1.png)
3. Configure the associated alarm notification strategy ⚠️ [Add notification strategy] -> [Associate the recipient just set] -> [OK]
> Configure the alarm notification policy to bind the alarm message with the receiver, so that you can decide which alarms to send to whom.
> Configure the alarm notification policy to bind the alarm message with the receiver, so that you can decide which alarms to send to whom.
![hertzbeat](/img/blog/alert-notice-2.png)
![hertzbeat](/img/blog/alert-notice-2.png)
### Finished, now wait for the warning message to come. ding ding ding ding

View File

@ -30,32 +30,32 @@ Github: <https://github.com/apache/hertzbeat>
1. Click Add Linux Monitoring
Path: Menu -> Operating System Monitoring -> Linux Operating System -> Add Linux Operating System Monitoring
Path: Menu -> Operating System Monitoring -> Linux Operating System -> Add Linux Operating System Monitoring
![hertzbeat](/img/blog/monitor-linux-1.png)
![hertzbeat](/img/blog/monitor-linux-1.png)
2. Configure the parameters required for new monitoring Linux
Fill in the Linux **peer IP**, **SSH port** (default 22), **account password, etc.** on the monitoring page, and finally click OK to add.
For other parameters such as **collection interval**, **timeout period**, etc., please refer to the help document <https://hertzbeat.com/docs/help/mysql/>
Fill in the Linux **peer IP**, **SSH port** (default 22), **account password, etc.** on the monitoring page, and finally click OK to add.
For other parameters such as **collection interval**, **timeout period**, etc., please refer to the help document <https://hertzbeat.com/docs/help/mysql/>
![hertzbeat](/img/blog/monitor-linux-2.png)
![hertzbeat](/img/blog/monitor-linux-2.png)
3. Complete ✅, now we have added the monitoring of Linux, check the monitoring list to see our added items.
![hertzbeat](/img/blog/monitor-linux-3.png)
![hertzbeat](/img/blog/monitor-linux-3.png)
4. Click **Operation**->**Monitoring Details Icon** of the monitoring list item to browse the real-time monitoring metric data of Linux.
![hertzbeat](/img/blog/monitor-linux-4.png)
![hertzbeat](/img/blog/monitor-linux-4.png)
![hertzbeat](/img/blog/monitor-linux-7.png)
![hertzbeat](/img/blog/monitor-linux-7.png)
5. Click **Monitoring History Details TAB** to browse the historical monitoring metric data chart of Linux📈.
![hertzbeat](/img/blog/monitor-linux-5.png)
![hertzbeat](/img/blog/monitor-linux-5.png)
![hertzbeat](/img/blog/monitor-linux-6.png)
![hertzbeat](/img/blog/monitor-linux-6.png)
**DONE! Done! To sum up, it only takes one step**
@ -72,35 +72,35 @@ Of course, just looking at it is definitely not perfect. Monitoring is often acc
1. Configure an alarm threshold for an important metric
Path: Menu -> Threshold Rules -> Add Threshold
Path: Menu -> Threshold Rules -> Add Threshold
- Select the configured metric object. Linux monitors mainly related metrics such as cpu, memory, disk, network performance, etc. For example, we set the threshold for the metric `CPU utilization` `cpu` -> `usage`. When the Linux cpu utilization is greater than 90% When a warning is issued.
- Here we configure to send an alarm when the `usage>90` of this metric `cpu`, the alarm level is **Warning Alarm**, which will be triggered after three times, as shown in the figure below.
- Select the configured metric object. Linux monitors mainly related metrics such as cpu, memory, disk, network performance, etc. For example, we set the threshold for the metric `CPU utilization` `cpu` -> `usage`. When the Linux cpu utilization is greater than 90% When a warning is issued.
- Here we configure to send an alarm when the `usage>90` of this metric `cpu`, the alarm level is **Warning Alarm**, which will be triggered after three times, as shown in the figure below.
![hertzbeat](/img/blog/monitor-linux-8.png)
![hertzbeat](/img/blog/monitor-linux-8.png)
![hertzbeat](/img/blog/monitor-linux-9.png)
![hertzbeat](/img/blog/monitor-linux-9.png)
2. Add message notification recipients
> Configure the receiver to let the alarm message know who to send and how to send it.
> Configure the receiver to let the alarm message know who to send and how to send it.
Path: Menu -> Alarm Notification -> Alarm Recipient -> Add New Recipient
Path: Menu -> Alarm Notification -> Alarm Recipient -> Add New Recipient
Message notification methods support **email, DingTalk, WeChat Work, Feishu, WebHook, SMS**, etc. Here we take the commonly used DingTalk as an example.
Message notification methods support **email, DingTalk, WeChat Work, Feishu, WebHook, SMS**, etc. Here we take the commonly used DingTalk as an example.
- Refer to this [Help Documentation](https://hertzbeat.com/docs/help/alert_dingtalk) <https://hertzbeat.com/docs/help/alert_dingtalk> to configure the robot on DingTalk and set the security custom keyword `HertzBeat`, get the corresponding `access_token` value.
- Configure the receiver parameters in HertzBeat as follows.
- Refer to this [Help Documentation](https://hertzbeat.com/docs/help/alert_dingtalk) <https://hertzbeat.com/docs/help/alert_dingtalk> to configure the robot on DingTalk and set the security custom keyword `HertzBeat`, get the corresponding `access_token` value.
- Configure the receiver parameters in HertzBeat as follows.
【Alarm Notification】->【New Recipient】->【Select DingTalk Robot Notification Method】->【Set DingTalk Robot ACCESS_TOKEN】->【OK】
【Alarm Notification】->【New Recipient】->【Select DingTalk Robot Notification Method】->【Set DingTalk Robot ACCESS_TOKEN】->【OK】
![hertzbeat](/img/blog/alert-notice-1.png)
![hertzbeat](/img/blog/alert-notice-1.png)
3. Configure the associated alarm notification strategy ⚠️ [Add notification strategy] -> [Associate the recipient just set] -> [OK]
> Configure the alarm notification policy to bind the alarm message with the receiver, so that you can decide which alarms to send to whom.
> Configure the alarm notification policy to bind the alarm message with the receiver, so that you can decide which alarms to send to whom.
![hertzbeat](/img/blog/alert-notice-2.png)
![hertzbeat](/img/blog/alert-notice-2.png)
### Finished, now wait for the warning message to come. ding ding ding ding

View File

@ -34,81 +34,81 @@ Github: <https://github.com/apache/hertzbeat>
1. Open SpringBoot Actuator Endpoint to expose `metrics health env` metric interface
```yaml
management:
endpoints:
web:
exposure:
include:
- 'metrics'
- 'health'
- 'env'
enabled-by-default: on
```
```yaml
management:
endpoints:
web:
exposure:
include:
- 'metrics'
- 'health'
- 'env'
enabled-by-default: on
```
2. After restarting, test whether the access metric interface `ip:port/actuator` has response json data as follows:
```json
{
"_links": {
"self": {
"href": "http://localhost:1157/actuator",
"templated": false
},
"health-path": {
"href": "http://localhost:1157/actuator/health/{*path}",
"templated": true
},
"health": {
"href": "http://localhost:1157/actuator/health",
"templated": false
},
"env": {
"href": "http://localhost:1157/actuator/env",
"templated": false
},
"env-toMatch": {
"href": "http://localhost:1157/actuator/env/{toMatch}",
"templated": true
},
"metrics-requiredMetricName": {
"href": "http://localhost:1157/actuator/metrics/{requiredMetricName}",
"templated": true
},
"metrics": {
"href": "http://localhost:1157/actuator/metrics",
"templated": false
}
}
}
```
```json
{
"_links": {
"self": {
"href": "http://localhost:1157/actuator",
"templated": false
},
"health-path": {
"href": "http://localhost:1157/actuator/health/{*path}",
"templated": true
},
"health": {
"href": "http://localhost:1157/actuator/health",
"templated": false
},
"env": {
"href": "http://localhost:1157/actuator/env",
"templated": false
},
"env-toMatch": {
"href": "http://localhost:1157/actuator/env/{toMatch}",
"templated": true
},
"metrics-requiredMetricName": {
"href": "http://localhost:1157/actuator/metrics/{requiredMetricName}",
"templated": true
},
"metrics": {
"href": "http://localhost:1157/actuator/metrics",
"templated": false
}
}
}
```
#### Add SpringBoot2 application monitoring in the HertzBeat monitoring ui
1. Click to add SpringBoot2 monitoring
Path: Menu -> Application Service Monitoring -> SpringBoot2 -> Add SpringBoot2 Monitoring
Path: Menu -> Application Service Monitoring -> SpringBoot2 -> Add SpringBoot2 Monitoring
![hertzbeat](/img/blog/monitor-springboot2-1.png)
![hertzbeat](/img/blog/monitor-springboot2-1.png)
2. Configure the parameters required for new monitoring SpringBoot2
Fill in the SpringBoot2 application **peer IP**, **service port** (default 8080), **account password, etc.** on the monitoring page, and finally click OK to add.
For other parameters such as **collection interval**, **timeout period**, etc., please refer to the help document <https://hertzbeat.com/docs/help/>
Fill in the SpringBoot2 application **peer IP**, **service port** (default 8080), **account password, etc.** on the monitoring page, and finally click OK to add.
For other parameters such as **collection interval**, **timeout period**, etc., please refer to the help document <https://hertzbeat.com/docs/help/>
![hertzbeat](/img/blog/monitor-springboot2-2.png)
![hertzbeat](/img/blog/monitor-springboot2-2.png)
3. Complete ✅, now we have added the monitoring of the SpringBoot2 application, check the monitoring list to see our additions.
![hertzbeat](/img/blog/monitor-springboot2-3.png)
![hertzbeat](/img/blog/monitor-springboot2-3.png)
4. Click **Operation**->**Monitoring Details Icon** of the monitoring list item to browse the real-time monitoring metric data of the SpringBoot2 application.
![hertzbeat](/img/blog/monitor-springboot2-4.png)
![hertzbeat](/img/blog/monitor-springboot2-4.png)
5. Click **Monitoring History Details TAB** to browse the historical monitoring metric data chart of the SpringBoot2 application📈.
![hertzbeat](/img/blog/monitor-springboot2-5.png)
![hertzbeat](/img/blog/monitor-springboot2-5.png)
**DONE! Done! It doesn't require us to deploy agents or various cumbersome operations, isn't it very simple**
@ -125,35 +125,35 @@ Of course, it is impossible to manually check the metrics in real time. Monitori
1. Configure an alarm threshold for an important metric
Path: Menu -> Threshold Rules -> Add Threshold
Path: Menu -> Threshold Rules -> Add Threshold
- Select the configured metric object. SpringBoot2 application monitoring mainly focuses on stack memory threads and other related metrics. For example, we set the threshold for the metric `threads` -> `threads`. When the number of threads in the `runnable` state is greater than At 300 an alert is issued.
- Here we configure to send an alarm when `size`, `state` of `equals(state, "runnable"") && size>300` of this metric, the alarm level is **warning alarm**, which will be triggered three times, specifically As shown below.
- Select the configured metric object. SpringBoot2 application monitoring mainly focuses on stack memory threads and other related metrics. For example, we set the threshold for the metric `threads` -> `threads`. When the number of threads in the `runnable` state is greater than At 300 an alert is issued.
- Here we configure to send an alarm when `size`, `state` of `equals(state, "runnable"") && size>300` of this metric, the alarm level is **warning alarm**, which will be triggered three times, specifically As shown below.
![hertzbeat](/img/blog/monitor-springboot2-6.png)
![hertzbeat](/img/blog/monitor-springboot2-6.png)
![hertzbeat](/img/blog/monitor-springboot2-7.png)
![hertzbeat](/img/blog/monitor-springboot2-7.png)
2. Add message notification recipients
> Configure the receiver to let the alarm message know who to send and how to send it.
> Configure the receiver to let the alarm message know who to send and how to send it.
Path: Menu -> Alarm Notification -> Alarm Recipient -> Add New Recipient
Path: Menu -> Alarm Notification -> Alarm Recipient -> Add New Recipient
Message notification methods support **email, DingTalk, WeChat Work, Feishu, WebHook, SMS**, etc. Here we take the commonly used DingTalk as an example.
Message notification methods support **email, DingTalk, WeChat Work, Feishu, WebHook, SMS**, etc. Here we take the commonly used DingTalk as an example.
- Refer to this [Help Documentation](https://hertzbeat.com/docs/help/alert_dingtalk) <https://hertzbeat.com/docs/help/alert_dingtalk> to configure the robot on DingTalk and set the security custom keyword `HertzBeat`, get the corresponding `access_token` value.
- Configure the receiver parameters in HertzBeat as follows.
- Refer to this [Help Documentation](https://hertzbeat.com/docs/help/alert_dingtalk) <https://hertzbeat.com/docs/help/alert_dingtalk> to configure the robot on DingTalk and set the security custom keyword `HertzBeat`, get the corresponding `access_token` value.
- Configure the receiver parameters in HertzBeat as follows.
【Alarm Notification】->【New Recipient】->【Select DingTalk Robot Notification Method】->【Set DingTalk Robot ACCESS_TOKEN】->【OK】
【Alarm Notification】->【New Recipient】->【Select DingTalk Robot Notification Method】->【Set DingTalk Robot ACCESS_TOKEN】->【OK】
![hertzbeat](/img/blog/alert-notice-1.png)
![hertzbeat](/img/blog/alert-notice-1.png)
3. Configure the associated alarm notification strategy ⚠️ [Add notification strategy] -> [Associate the recipient just set] -> [OK]
> Configure the alarm notification policy to bind the alarm message with the receiver, so that you can decide which alarms to send to whom.
> Configure the alarm notification policy to bind the alarm message with the receiver, so that you can decide which alarms to send to whom.
![hertzbeat](/img/blog/alert-notice-2.png)
![hertzbeat](/img/blog/alert-notice-2.png)
### Finished, now wait for the warning message to come. ding ding ding ding

View File

@ -43,16 +43,16 @@ You can refer to the [official documentation](https://docs.greptime.com/getting-
1. Docker installation of GreptimeDB
```shell
$ 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
```
```shell
$ 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.
- `-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.
2. Use ``$ docker ps | grep greptime`` to see if GreptimeDB started successfully.
@ -62,21 +62,21 @@ See the [official documentation](https://hertzbeat.com/zh-cn/docs/start/docker-d
1. Docker installs HertzBeat.
```shell
$ 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
```
```shell
$ 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/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.
- `-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)
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)
2. Go to <http://ip:1157/> with the default account and password admin/hertzbeat to see if HertzBeat starts successfully.
@ -84,25 +84,25 @@ Note that the ⚠️ local mount configuration file `application.yml` needs to e
1. Modify the HertzBeat configuration file.
Modify the locally mounted HertzBeat configuration file [application.yml](https://github.com/apache/hertzbeat/raw/master/script/application.yml), in package mode modify `hertzbeat/ config/application.yml
Modify the locally mounted HertzBeat configuration file [application.yml](https://github.com/apache/hertzbeat/raw/master/script/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`**.
**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`**.
```yaml
warehouse:
store:
jpa:
enabled: false
greptime:
enabled: true
endpoint: localhost:4001
```
```yaml
warehouse:
store:
jpa:
enabled: false
greptime:
enabled: true
endpoint: localhost:4001
```
2. Restart HertzBeat.
```shell
docker restart hertzbeat
```
```shell
docker restart hertzbeat
```
#### Observe the authentication effect

View File

@ -75,23 +75,23 @@ As for open source commercialization, the premise of open source commercializati
1. Just one command to get started:
```docker run -d -p 1157:1157 -p 1158:1158 --name hertzbeat apache/hertzbeat```
```docker run -d -p 1157:1157 -p 1158:1158 --name hertzbeat apache/hertzbeat```
```or use quay.io (if dockerhub network connect timeout)```
```or use quay.io (if dockerhub network connect timeout)```
```docker run -d -p 1157:1157 -p 1158:1158 --name hertzbeat quay.io/tancloud/hertzbeat```
```docker run -d -p 1157:1157 -p 1158:1158 --name hertzbeat quay.io/tancloud/hertzbeat```
2. Access `http://localhost:1157` to start, default account: `admin/hertzbeat`
3. Deploy collector clusters
```
docker run -d -e IDENTITY=custom-collector-name -e MANAGER_IP=127.0.0.1 -e MANAGER_PORT=1158 --name hertzbeat-collector apache/hertzbeat-collector
```
```
docker run -d -e IDENTITY=custom-collector-name -e MANAGER_IP=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 MANAGER_IP=127.0.0.1` : set the main hertzbeat server ip.
* `-e MANAGER_PORT=1158` : set the main hertzbeat server port, default 1158.
* `-e IDENTITY=custom-collector-name` : set the collector unique identity name.
* `-e MANAGER_IP=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.com/docs/start/docker-deploy)

View File

@ -58,23 +58,23 @@ keywords: [open source monitoring system, alerting system, Linux monitoring]
1. Just one command to get started:
```docker run -d -p 1157:1157 -p 1158:1158 --name hertzbeat apache/hertzbeat```
```docker run -d -p 1157:1157 -p 1158:1158 --name hertzbeat apache/hertzbeat```
```or use quay.io (if dockerhub network connect timeout)```
```or use quay.io (if dockerhub network connect timeout)```
```docker run -d -p 1157:1157 -p 1158:1158 --name hertzbeat quay.io/tancloud/hertzbeat```
```docker run -d -p 1157:1157 -p 1158:1158 --name hertzbeat quay.io/tancloud/hertzbeat```
2. Access `http://localhost:1157` to start, default account: `admin/hertzbeat`
3. Deploy collector clusters
```
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
```
```
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 MANAGER_HOST=127.0.0.1` : set the main hertzbeat server ip.
* `-e MANAGER_PORT=1158` : set the main hertzbeat server port, default 1158.
* `-e IDENTITY=custom-collector-name` : set the collector unique identity name.
* `-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.com/docs/start/docker-deploy)

View File

@ -40,23 +40,23 @@ keywords: [open source monitoring system, alerting system, Linux monitoring]
1. Just one command to get started:
```docker run -d -p 1157:1157 -p 1158:1158 --name hertzbeat apache/hertzbeat```
```docker run -d -p 1157:1157 -p 1158:1158 --name hertzbeat apache/hertzbeat```
```or use quay.io (if dockerhub network connect timeout)```
```or use quay.io (if dockerhub network connect timeout)```
```docker run -d -p 1157:1157 -p 1158:1158 --name hertzbeat quay.io/tancloud/hertzbeat```
```docker run -d -p 1157:1157 -p 1158:1158 --name hertzbeat quay.io/tancloud/hertzbeat```
2. Access `http://localhost:1157` to start, default account: `admin/hertzbeat`
3. Deploy collector clusters
```
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
```
```
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 MANAGER_HOST=127.0.0.1` : set the main hertzbeat server ip.
* `-e MANAGER_PORT=1158` : set the main hertzbeat server port, default 1158.
* `-e IDENTITY=custom-collector-name` : set the collector unique identity name.
* `-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.com/docs/start/docker-deploy)

View File

@ -46,23 +46,23 @@ Compatible with the Prometheus ecosystem, now we can monitor what Prometheus can
1. Just one command to get started:
```docker run -d -p 1157:1157 -p 1158:1158 --name hertzbeat apache/hertzbeat```
```docker run -d -p 1157:1157 -p 1158:1158 --name hertzbeat apache/hertzbeat```
```or use quay.io (if dockerhub network connect timeout)```
```or use quay.io (if dockerhub network connect timeout)```
```docker run -d -p 1157:1157 -p 1158:1158 --name hertzbeat quay.io/tancloud/hertzbeat```
```docker run -d -p 1157:1157 -p 1158:1158 --name hertzbeat quay.io/tancloud/hertzbeat```
2. Access `http://localhost:1157` to start, default account: `admin/hertzbeat`
3. Deploy collector clusters
```
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
```
```
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 MANAGER_HOST=127.0.0.1` : set the main hertzbeat server ip.
* `-e MANAGER_PORT=1158` : set the main hertzbeat server port, default 1158.
* `-e IDENTITY=custom-collector-name` : set the collector unique identity name.
* `-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.com/docs/start/docker-deploy)

View File

@ -47,23 +47,23 @@ keywords: [open source monitoring system, alerting system]
1. Just one command to get started:
```docker run -d -p 1157:1157 -p 1158:1158 --name hertzbeat apache/hertzbeat```
```docker run -d -p 1157:1157 -p 1158:1158 --name hertzbeat apache/hertzbeat```
```or use quay.io (if dockerhub network connect timeout)```
```or use quay.io (if dockerhub network connect timeout)```
```docker run -d -p 1157:1157 -p 1158:1158 --name hertzbeat quay.io/tancloud/hertzbeat```
```docker run -d -p 1157:1157 -p 1158:1158 --name hertzbeat quay.io/tancloud/hertzbeat```
2. Access `http://localhost:1157` to start, default account: `admin/hertzbeat`
3. Deploy collector clusters
```
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
```
```
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 MANAGER_HOST=127.0.0.1` : set the main hertzbeat server ip.
* `-e MANAGER_PORT=1158` : set the main hertzbeat server port, default 1158.
* `-e IDENTITY=custom-collector-name` : set the collector unique identity name.
* `-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.com/docs/start/docker-deploy)

View File

@ -206,9 +206,9 @@ Error code description:
2. Ensure code readability and intuitiveness
- The string in the `annotation` symbol doesn't need to be extracted as constant.
- The string in the `annotation` symbol doesn't need to be extracted as constant.
- The referenced `package` or `resource` name doesn't need to be extracted as constant.
- The referenced `package` or `resource` name doesn't need to be extracted as constant.
3. Variables that have not been reassigned must also be declared as <mark> final </mark> types.
@ -250,17 +250,17 @@ Error code description:
- returns <mark> Set </mark> if use `HashSet`
2. If there are multiple threads, the following declaration or returned types can be used:
```java
private CurrentHashMap map;
public CurrentHashMap funName();
```
```java
private CurrentHashMap map;
public CurrentHashMap funName();
```
3. Use `isEmpty()` instead of `length() == 0` or `size() == 0`
- Negative demo:
```java
if (pathPart.length() == 0) {
return;
return;
}
```
@ -268,7 +268,7 @@ public CurrentHashMap funName();
```java
if (pathPart.isEmpty()) {
return;
return;
}
```
@ -295,89 +295,89 @@ Generally speaking, if a method's code line depth exceeds `2+ Tabs` due to conti
to reduce code line depth and improve readability like follows:
- Union or merge the logic into the next level calling
- Negative demo:
- Negative demo:
```java
if (isInsert) {
save(platform);
} else {
updateById(platform);
}
```
```java
if (isInsert) {
save(platform);
} else {
updateById(platform);
}
```
- Positive demo:
- Positive demo:
```java
saveOrUpdate(platform);
```
```java
saveOrUpdate(platform);
```
- Merge the conditions
- Negative demo:
- Negative demo:
```java
if (expression1) {
if(expression2) {
......
}
}
```java
if (expression1) {
if (expression2) {
......
}
}
```
```
- Positive demo:
- Positive demo:
```java
if (expression1 && expression2) {
......
}
```
```java
if (expression1 && expression2) {
......
}
```
- Reverse the condition
- Negative demo:
- Negative demo:
```java
public void doSomething() {
// Ignored more deeper block lines
// .....
if (condition1) {
...
} else {
...
}
}
```
```java
public void doSomething() {
// Ignored more deeper block lines
// .....
if (condition1) {
// ...
} else {
// ...
}
}
```
- Positive demo:
- Positive demo:
```java
public void doSomething() {
// Ignored more deeper block lines
// .....
if (!condition1) {
...
return;
}
// ...
}
```
```java
public void doSomething() {
// Ignored more deeper block lines
// .....
if (!condition1) {
// ...
return;
}
// ...
}
```
- Using a single variable or method to reduce the complex conditional expression
- Negative demo:
- Negative demo:
```java
if (dbType.indexOf("sqlserver") >= 0 || dbType.indexOf("sql server") >= 0) {
...
}
```
```java
if (dbType.indexOf("sqlserver") >= 0 || dbType.indexOf("sql server") >= 0) {
// ...
}
```
- Positive demo:
- Positive demo:
```java
if (containsSqlServer(dbType)) {
....
}
//.....
// definition of the containsSqlServer
```
```java
if (containsSqlServer(dbType)) {
// ....
}
//.....
// definition of the containsSqlServer
```
> Using `sonarlint` and `better highlights` to check code depth looks like good in the future.
@ -385,20 +385,20 @@ if(expression2) {
1. Method lacks comments:
- `When`: When can the method be called
- `How`: How to use this method and how to pass parameters, etc.
- `What`: What functions does this method achieve
- `Note`: What should developers pay attention to when calling this method
- `When`: When can the method be called
- `How`: How to use this method and how to pass parameters, etc.
- `What`: What functions does this method achieve
- `Note`: What should developers pay attention to when calling this method
2. Missing necessary class header description comments.
Add `What`, `Note`, etc. like mentioned in the `1`.
Add `What`, `Note`, etc. like mentioned in the `1`.
3. The method declaration in the interface must be annotated.
- If the semantics of the implementation and the annotation content at the interface declaration are inconsistent, the specific implementation method also needs to be rewritten with annotations.
- If the semantics of the implementation and the annotation content at the interface declaration are inconsistent, the specific implementation method also needs to be rewritten with annotations.
- If the semantics of the method implementation are consistent with the annotation content at the interface declaration, it is not recommended to write annotations to avoid duplicate annotations.
- If the semantics of the method implementation are consistent with the annotation content at the interface declaration, it is not recommended to write annotations to avoid duplicate annotations.
4. The first word in the comment lines need to be capitalized, like `param` lines, `return` lines.
If a special reference as a subject does not need to be capitalized, special symbols such as quotation marks need to be noted.
@ -408,31 +408,31 @@ Add `What`, `Note`, etc. like mentioned in the `1`.
1. Prefer `non-capturing` lambdas (lambdas that do not contain references to the outer scope).
Capturing lambdas need to create a new object instance for every call. `Non-capturing` lambdas can use the same instance for each invocation.
- Negative demo:
- Negative demo:
```java
map.computeIfAbsent(key, x -> key.toLowerCase())
```
```java
map.computeIfAbsent(key, x -> key.toLowerCase())
```
- Positive demo:
- Positive demo:
```java
map.computeIfAbsent(key, k -> k.toLowerCase());
```
```java
map.computeIfAbsent(key, k -> k.toLowerCase());
```
2. Consider method references instead of inline lambdas
- Negative demo:
- Negative demo:
```java
map.computeIfAbsent(key, k-> Loader.load(k));
```
```java
map.computeIfAbsent(key, k-> Loader.load(k));
```
- Positive demo:
- Positive demo:
```java
map.computeIfAbsent(key, Loader::load);
```
```java
map.computeIfAbsent(key, Loader::load);
```
### 3.9 Java Streams
@ -450,127 +450,127 @@ Add `What`, `Note`, etc. like mentioned in the `1`.
1. Use `StringUtils.isBlank` instead of `StringUtils.isEmpty`
- Negative demo:
- Negative demo:
```java
if (StringUtils.isEmpty(name)) {
return;
}
```
```java
if (StringUtils.isEmpty(name)) {
return;
}
```
- Positive demo:
- Positive demo:
```java
if (StringUtils.isBlank(name)) {
return;
}
```
```java
if (StringUtils.isBlank(name)) {
return;
}
```
2. Use `StringUtils.isNotBlank` instead of `StringUtils.isNotEmpty`
- Negative demo:
- Negative demo:
```java
if (StringUtils.isNotEmpty(name)) {
return;
}
```
```java
if (StringUtils.isNotEmpty(name)) {
return;
}
```
- Positive demo:
- Positive demo:
```java
if (StringUtils.isNotBlank(name)) {
return;
}
```
```java
if (StringUtils.isNotBlank(name)) {
return;
}
```
3. Use `StringUtils.isAllBlank` instead of `StringUtils.isAllEmpty`
- Negative demo:
- Negative demo:
```java
if (StringUtils.isAllEmpty(name, age)) {
return;
}
```
```java
if (StringUtils.isAllEmpty(name, age)) {
return;
}
```
- Positive demo:
- Positive demo:
```java
if (StringUtils.isAllBlank(name, age)) {
return;
}
```
```java
if (StringUtils.isAllBlank(name, age)) {
return;
}
```
### 3.12 `Enum` Class
1. Enumeration value comparison
- Negative demo:
- Negative demo:
```java
if (status.equals(JobStatus.RUNNING)) {
return;
}
```
```java
if (status.equals(JobStatus.RUNNING)) {
return;
}
```
- Positive demo:
- Positive demo:
```java
if (status == JobStatus.RUNNING) {
return;
}
```
```java
if (status == JobStatus.RUNNING) {
return;
}
```
2. Enumeration classes do not need to implement Serializable
- Negative demo:
- Negative demo:
```java
public enum JobStatus implements Serializable {
...
}
```
```java
public enum JobStatus implements Serializable {
// ...
}
```
- Positive demo:
- Positive demo:
```java
public enum JobStatus {
...
}
```
```java
public enum JobStatus {
// ...
}
```
3. Use `Enum.name()` instead of `Enum.toString()`
- Negative demo:
- Negative demo:
```java
System.out.println(JobStatus.RUNNING.toString());
```
```java
System.out.println(JobStatus.RUNNING.toString());
```
- Positive demo:
- Positive demo:
```java
System.out.println(JobStatus.RUNNING.name());
```
```java
System.out.println(JobStatus.RUNNING.name());
```
4. Enumeration class names uniformly use the Enum suffix
- Negative demo:
- Negative demo:
```java
public enum JobStatus {
...
}
```
```java
public enum JobStatus {
// ...
}
```
- Positive demo:
- Positive demo:
```java
public enum JobStatusEnum {
...
}
```
```java
public enum JobStatusEnum {
// ...
}
```
### 3.13 `Deprecated` Annotation
@ -579,7 +579,7 @@ Add `What`, `Note`, etc. like mentioned in the `1`.
```java
@deprecated
public void process(String input) {
...
// ...
}
```
@ -588,7 +588,7 @@ public void process(String input) {
```java
@Deprecated
public void process(String input) {
...
// ...
}
```
@ -596,43 +596,43 @@ public void process(String input) {
1. Use `placeholders` for log output:
- Negative demo
- Negative demo
```java
log.info("Deploy cluster request " + deployRequest);
```
```java
log.info("Deploy cluster request " + deployRequest);
```
- Positive demo
- Positive demo
```java
log.info("load plugin:{} to {}", file.getName(), appPlugins);
```
```java
log.info("load plugin:{} to {}", file.getName(), appPlugins);
```
2. Pay attention to the selection of `log level` when printing logs
When printing the log content, if the actual parameters of the log placeholder are passed, it is necessary to avoid premature evaluation to avoid unnecessary evaluation caused by the log level.
When printing the log content, if the actual parameters of the log placeholder are passed, it is necessary to avoid premature evaluation to avoid unnecessary evaluation caused by the log level.
- Negative demo:
- Negative demo:
Assuming the current log level is `INFO`:
Assuming the current log level is `INFO`:
```java
// ignored declaration lines.
List<User> userList = getUsersByBatch(1000);
LOG.debug("All users: {}", getAllUserIds(userList));
```
```java
// ignored declaration lines.
List<User> userList = getUsersByBatch(1000);
LOG.debug("All users: {}", getAllUserIds(userList));
```
- Positive demo:
- Positive demo:
In this case, we should determine the log level in advance before making actual log calls as follows:
In this case, we should determine the log level in advance before making actual log calls as follows:
```java
// ignored declaration lines.
List<User> userList = getUsersByBatch(1000);
if (LOG.isDebugEnabled()) {
LOG.debug("All ids of users: {}", getAllIDsOfUsers(userList));
}
```
```java
// ignored declaration lines.
List<User> userList = getUsersByBatch(1000);
if (LOG.isDebugEnabled()) {
LOG.debug("All ids of users: {}", getAllIDsOfUsers(userList));
}
```
## 5 Testing

View File

@ -88,33 +88,33 @@ Of course, if you have a good idea, you can also propose it directly on GitHub D
1. First you need to fork your target [hertzbeat repository](https://github.com/apache/hertzbeat).
2. Then download the code locally with git command:
```shell
git clone git@github.com:${YOUR_USERNAME}/hertzbeat.git #Recommended
```
```shell
git clone git@github.com:${YOUR_USERNAME}/hertzbeat.git #Recommended
```
3. After the download is complete, please refer to the getting started guide or README file of the target repository to initialize the project.
4. Then, you can refer to the following command to submit the code:
```shell
git checkout -b a-feature-branch #Recommended
```
```shell
git checkout -b a-feature-branch #Recommended
```
5. Submit the coed as a commit, the commit message format specification required: [module name or type name]feature or bugfix or doc: custom message.
```shell
git add <modified file/path>
git commit -m '[docs]feature: necessary instructions' #Recommended
```
```shell
git add <modified file/path>
git commit -m '[docs]feature: necessary instructions' #Recommended
```
6. Push to the remote repository
```shell
git push origin a-feature-branch
```
```shell
git push origin a-feature-branch
```
7. Then you can initiate a new PR (Pull Request) on GitHub.
Please note that the title of the PR needs to conform to our spec, and write the necessary description in the PR to facilitate code review by Committers and other contributors.
Please note that the title of the PR needs to conform to our spec, and write the necessary description in the PR to facilitate code review by Committers and other contributors.
### Wait for the code to be merged

View File

@ -15,40 +15,40 @@ keywords: [open source monitoring tool, monitoring Apache ActiveMQ metrics]
1. Modify the `conf/activemq.xml` file in the installation directory to enable JMX
> Add `userJmx="true"` attribute in `broker` tag
> Add `userJmx="true"` attribute in `broker` tag
```xml
<broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" dataDirectory="${activemq.data}" useJmx="true">
<!-- others -->
</broker>
```
```xml
<broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" dataDirectory="${activemq.data}" useJmx="true">
<!-- others -->
</broker>
```
2. Modify the `bin/env` file in the installation directory, configure the JMX port IP, etc.
The original configuration information will be as follows
The original configuration information will be as follows
```text
# ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.port=11099"
# ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.password.file=${ACTIVEMQ_CONF}/jmx.password"
# ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.access.file=${ACTIVEMQ_CONF}/jmx.access"
# ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.ssl=false"
ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote"
```
```text
# ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.port=11099"
# ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.password.file=${ACTIVEMQ_CONF}/jmx.password"
# ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.access.file=${ACTIVEMQ_CONF}/jmx.access"
# ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.ssl=false"
ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote"
```
Update to the following configuration, ⚠️ pay attention to modify `local external IP`
Update to the following configuration, ⚠️ pay attention to modify `local external IP`
```text
# ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.password.file=${ACTIVEMQ_CONF}/jmx.password"
# ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.access.file=${ACTIVEMQ_CONF}/jmx.access"
ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.port=11099"
ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.ssl=false"
ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.authenticate=false"
ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Djava.rmi.server.hostname=本机对外IP"
ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote"
```
```text
# ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.password.file=${ACTIVEMQ_CONF}/jmx.password"
# ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.access.file=${ACTIVEMQ_CONF}/jmx.access"
ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.port=11099"
ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.ssl=false"
ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.authenticate=false"
ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Djava.rmi.server.hostname=本机对外IP"
ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote"
```
3. Restart the ACTIVEMQ service, and add the corresponding ActiveMQ monitoring in HertzBeat. The parameters use the IP port configured by JMX.

View File

@ -11,31 +11,31 @@ keywords: [open source monitoring tool, open source alerter, open source DingDin
1. **【DingDing desktop client】-> 【Group settings】-> 【Intelligent group assistant】-> 【Add new robot-select custom】-> 【Set robot name and avatar】-> 【Note⚠️Set custom keywords: HertzBeat】 ->【Copy its webhook address after adding successfully】**
> Note⚠️ When adding a robot, its custom keywords need to be set in the security setting block: HertzBeat. Other security settings or the IP segment don't need to be filled in.
> Note⚠️ When adding a robot, its custom keywords need to be set in the security setting block: HertzBeat. Other security settings or the IP segment don't need to be filled in.
![email](/img/docs/help/alert-notice-8.png)
![email](/img/docs/help/alert-notice-8.png)
2. **【Save access_token value of the WebHook address of the robot】**
> eg: webHook address:`https://oapi.dingtalk.com/robot/send?access_token=43aac28a236e001285ed84e473f8eabee70f63c7a70287acb0e0f8b65fade64f`
> Its robot access_token value is `43aac28a236e001285ed84e473f8eabee70f63c7a70287acb0e0f8b65fade64f`
> eg: webHook address:`https://oapi.dingtalk.com/robot/send?access_token=43aac28a236e001285ed84e473f8eabee70f63c7a70287acb0e0f8b65fade64f`
> Its robot access_token value is `43aac28a236e001285ed84e473f8eabee70f63c7a70287acb0e0f8b65fade64f`
3. **【Alarm notification】->【Add new recipient】 ->【Select DingDing robot notification method】->【Set DingDing robot ACCESS_TOKEN】-> 【Confirm】**
![email](/img/docs/help/alert-notice-9.png)
![email](/img/docs/help/alert-notice-9.png)
4. **Configure the associated alarm notification strategy⚠️ 【Add new notification strategy】-> 【Associate the recipient just set】-> 【Confirm】**
> **Note⚠️ Adding a new recipient does not mean that it is effective to receive alarm information. It is also necessary to configure the associated alarm notification strategy, that is, to specify which messages are sent to which recipients.**
> **Note⚠️ Adding a new recipient does not mean that it is effective to receive alarm information. It is also necessary to configure the associated alarm notification strategy, that is, to specify which messages are sent to which recipients.**
![email](/img/docs/help/alert-notice-4.png)
![email](/img/docs/help/alert-notice-4.png)
### DingDing robot common issues
1. DingDing group did not receive the robot alarm notification.
> Please check whether there is any triggered alarm information in the alarm center.
> Please check whether DingDing robot is configured with security custom keywords :HertzBeat.
> Please check whether the robot ACCESS_TOKEN is configured correctly and whether the alarm strategy association is configured.
> Please check whether there is any triggered alarm information in the alarm center.
> Please check whether DingDing robot is configured with security custom keywords :HertzBeat.
> Please check whether the robot ACCESS_TOKEN is configured correctly and whether the alarm strategy association is configured.
Other issues can be fed back through the communication group ISSUE!

View File

@ -13,56 +13,56 @@ keywords: [open source monitoring tool, open source alerter, open source Discord
1. Visit [https://discord.com/developers/applications](https://discord.com/developers/applications) to create an application
![bot](/img/docs/help/discord-bot-1.png)
![bot](/img/docs/help/discord-bot-1.png)
2. Create a robot under the application and get the robot Token
![bot](/img/docs/help/discord-bot-2.png)
![bot](/img/docs/help/discord-bot-2.png)
![bot](/img/docs/help/discord-bot-3.png)
![bot](/img/docs/help/discord-bot-3.png)
3. Authorize the bot to the chat server
> Authorize the robot under the OAuth2 menu, select `bot` for `SCOPES`, `BOT PERMISSIONS` select `Send Messages`
> Authorize the robot under the OAuth2 menu, select `bot` for `SCOPES`, `BOT PERMISSIONS` select `Send Messages`
![bot](/img/docs/help/discord-bot-4.png)
![bot](/img/docs/help/discord-bot-4.png)
> Obtain the URL generated at the bottom, and the browser accesses this URL to officially authorize the robot, that is, to set which chat server the robot will join.
> Obtain the URL generated at the bottom, and the browser accesses this URL to officially authorize the robot, that is, to set which chat server the robot will join.
4. Check if your chat server has joined robot members
![bot](/img/docs/help/discord-bot-5.png)
![bot](/img/docs/help/discord-bot-5.png)
### Enable developer mode and get Channel ID
1. Personal Settings -> Advanced Settings -> Enable Developer Mode
![bot](/img/docs/help/discord-bot-6.png)
![bot](/img/docs/help/discord-bot-6.png)
2. Get channel Channel ID
> Right-click the chat channel you want to send the robot message to, click the COPY ID button to get the Channel ID
> Right-click the chat channel you want to send the robot message to, click the COPY ID button to get the Channel ID
![bot](/img/docs/help/discord-bot-7.png)
![bot](/img/docs/help/discord-bot-7.png)
### Add an alarm notification person in HertzBeat, the notification method is Discord Bot
1. **[Alarm notification] -> [Add recipient] -> [Select Discord robot notification method] -> [Set robot Token and ChannelId] -> [OK]**
![email](/img/docs/help/discord-bot-8.png)
![email](/img/docs/help/discord-bot-8.png)
4. **Configure the associated alarm notification strategy⚠️ [Add notification strategy] -> [Associate the recipient just set] -> [OK]**
2. **Configure the associated alarm notification strategy⚠️ [Add notification strategy] -> [Associate the recipient just set] -> [OK]**
> **Note ⚠️ Adding a new recipient does not mean that it has taken effect and can receive alarm information. It is also necessary to configure the associated alarm notification strategy, that is, specify which messages are sent to which recipients**.
> **Note ⚠️ Adding a new recipient does not mean that it has taken effect and can receive alarm information. It is also necessary to configure the associated alarm notification strategy, that is, specify which messages are sent to which recipients**.
![email](/img/docs/help/alert-notice-policy.png)
![email](/img/docs/help/alert-notice-policy.png)
### Discord Bot Notification FAQ
1. Discord doesn't receive bot alert notifications
> Please check whether the alarm information has been triggered in the alarm center
> Please check whether the robot Token and ChannelId are configured correctly, and whether the alarm policy association has been configured
> Please check whether the bot is properly authorized by the Discord chat server
> Please check whether the alarm information has been triggered in the alarm center
> Please check whether the robot Token and ChannelId are configured correctly, and whether the alarm policy association has been configured
> Please check whether the bot is properly authorized by the Discord chat server
Other questions can be fed back through the communication group ISSUE!

View File

@ -11,23 +11,23 @@ keywords: [open source monitoring tool, open source alerter, open source email n
1. **【Alarm notification】->【Add new recipient】 ->【Select email notification method】**
![email](/img/docs/help/alert-notice-1.png)
![email](/img/docs/help/alert-notice-1.png)
2. **【Get verification code】-> 【Enter email verification code】-> 【Confirm】**
![email](/img/docs/help/alert-notice-2.png)
![email](/img/docs/help/alert-notice-3.png)
![email](/img/docs/help/alert-notice-3.png)
3. **Configure the associated alarm notification strategy⚠️ 【Add new notification strategy】-> 【Associate the recipient just set】-> 【Confirm】**
> **Note⚠️ Adding a new recipient does not mean that it is effective to receive alarm information. It is also necessary to configure the associated alarm notification strategy, that is, to specify which messages are sent to which recipients.**
> **Note⚠️ Adding a new recipient does not mean that it is effective to receive alarm information. It is also necessary to configure the associated alarm notification strategy, that is, to specify which messages are sent to which recipients.**
![email](/img/docs/help/alert-notice-4.png)
![email](/img/docs/help/alert-notice-4.png)
### Email notification common issues
1. Hertzbeat deployed on its own intranet cannot receive email notifications
> Hertzbeat needs to configure its own mail server. Please confirm whether you have configured its own mail server in application.yml
> Hertzbeat needs to configure its own mail server. Please confirm whether you have configured its own mail server in application.yml
Other issues can be fed back through the communication group ISSUE!

View File

@ -11,24 +11,24 @@ keywords: [open source monitoring tool, open source alerter, open source Enterpr
1. **【Enterprise Wechat backstage】-> 【App Management】-> 【Create an app】-> 【Set App message】->【Copy AgentId and Secret adding successfully】**
![email](/img/docs/help/alert-wechat-1.jpg)
![email](/img/docs/help/alert-wechat-1.jpg)
2. **【Alarm notification】->【Add new recipient】 ->【Select Enterprise WeChat App notification method】->【Set Enterprise WeChat ID,Enterprise App ID and Enterprise App Secret 】-> 【Confirm】**
![email](/img/docs/help/alert-wechat-2.jpg)
![email](/img/docs/help/alert-wechat-2.jpg)
3. **Configure the associated alarm notification strategy⚠️ 【Add new notification strategy】-> 【Associate the recipient just set】-> 【Confirm】**
> **Note⚠️ Adding a new recipient does not mean that it is effective to receive alarm information. It is also necessary to configure the associated alarm notification strategy, that is, to specify which messages are sent to which recipients.**
> **Note⚠️ Adding a new recipient does not mean that it is effective to receive alarm information. It is also necessary to configure the associated alarm notification strategy, that is, to specify which messages are sent to which recipients.**
![email](/img/docs/help/alert-wechat-3.jpg)
![email](/img/docs/help/alert-wechat-3.jpg)
### Enterprise WeChat App common issues
1. Enterprise WeChat App did not receive the alarm notification.
> Please check if the user has application permissions.
> Please check if the enterprise application callback address settings are normal.
> Please check if the server IP is on the enterprise application whitelist.
> Please check if the user has application permissions.
> Please check if the enterprise application callback address settings are normal.
> Please check if the server IP is on the enterprise application whitelist.
Other issues can be fed back through the communication group ISSUE!

View File

@ -13,22 +13,22 @@ keywords: [open source monitoring tool, open source alerter, open source feishu
2. **【Save the key value of the WebHook address of the robot】**
> eg: webHook address:`https://open.feishu.cn/open-apis/bot/v2/hook/3adafc96-23d0-4cd5-8feb-17f6e0b5fcs4`
> Its robot KEY value is `3adafc96-23d0-4cd5-8feb-17f6e0b5fcs4`
> eg: webHook address:`https://open.feishu.cn/open-apis/bot/v2/hook/3adafc96-23d0-4cd5-8feb-17f6e0b5fcs4`
> Its robot KEY value is `3adafc96-23d0-4cd5-8feb-17f6e0b5fcs4`
3. **【Alarm notification】->【Add new recipient】 ->【Select FeiShu robot notification method】->【Set FeiShu robot KEY】-> 【Confirm】**
4. **Configure the associated alarm notification strategy⚠️ 【Add new notification strategy】-> 【Associate the recipient just set】-> 【Confirm】**
> **Note⚠️ Adding a new recipient does not mean that it is effective to receive alarm information. It is also necessary to configure the associated alarm notification strategy, that is, to specify which messages are sent to which recipients.**
> **Note⚠️ Adding a new recipient does not mean that it is effective to receive alarm information. It is also necessary to configure the associated alarm notification strategy, that is, to specify which messages are sent to which recipients.**
![email](/img/docs/help/alert-notice-4.png)
![email](/img/docs/help/alert-notice-4.png)
### FeiShu robot notification common issues
1. FeiShu group did not receive the robot alarm notification.
> Please check whether there is any triggered alarm information in the alarm center.
> Please check whether the robot key is configured correctly and whether the alarm strategy association is configured.
> Please check whether there is any triggered alarm information in the alarm center.
> Please check whether the robot key is configured correctly and whether the alarm strategy association is configured.
Other issues can be fed back through the communication group ISSUE!

View File

@ -17,19 +17,19 @@ Refer to the official website document [Sending messages using Incoming Webhooks
1. **【Alarm Notification】->【Add Recipient】->【Select Slack Webhook Notification Method】->【Set Webhook URL】-> 【OK】**
![email](/img/docs/help/slack-bot-1.png)
![email](/img/docs/help/slack-bot-1.png)
2. **Configure the associated alarm notification strategy⚠️ [Add notification strategy] -> [Associate the recipient just set] -> [OK]**
> **Note ⚠️ Adding a new recipient does not mean that it has taken effect and can receive alarm information. It is also necessary to configure the associated alarm notification strategy, that is, specify which messages are sent to which recipients**.
> **Note ⚠️ Adding a new recipient does not mean that it has taken effect and can receive alarm information. It is also necessary to configure the associated alarm notification strategy, that is, specify which messages are sent to which recipients**.
![email](/img/docs/help/alert-notice-policy.png)
![email](/img/docs/help/alert-notice-policy.png)
### Slack Notification FAQ
1. Slack did not receive the robot warning notification
> Please check whether the alarm information has been triggered in the alarm center
> Please check whether the slack webhook url are configured correctly, and whether the alarm policy association has been configured
> Please check whether the alarm information has been triggered in the alarm center
> Please check whether the slack webhook url are configured correctly, and whether the alarm policy association has been configured
Other questions can be fed back through the communication group ISSUE!

View File

@ -11,33 +11,33 @@ keywords: [ open source monitoring tool, open source alerter, open source Huawei
1. **According to [Huawei Cloud SMN Official Document](https://support.huaweicloud.com/qs-smn/smn_json.html) activate the SMN service and configure SMN**
![alert-notice-10](/img/docs/help/alert-notice-10.png)
![alert-notice-10](/img/docs/help/alert-notice-10.png)
2. **Save topic URN for SMN**
![alert-notice-11](/img/docs/help/alert-notice-11.png)
![alert-notice-11](/img/docs/help/alert-notice-11.png)
3. **According to [Huawei Cloud Signature Document](https://support.huaweicloud.com/devg-apisign/api-sign-provide.html) obtain AK, SK, and project ID**
![alert-notice-12](/img/docs/help/alert-notice-12.png)
![alert-notice-12](/img/docs/help/alert-notice-12.png)
![alert-notice-13](/img/docs/help/alert-notice-13.png)
![alert-notice-13](/img/docs/help/alert-notice-13.png)
4. **【Alarm Notification】->【Add Recipient】->【Select Slack Webhook Notification Method】->【Set Huawei Cloud SMN AK, SK and other configurations】-> 【OK】**
![alert-notice-14](/img/docs/help/alert-notice-14.png)
![alert-notice-14](/img/docs/help/alert-notice-14.png)
5. **Configure the associated alarm notification strategy⚠️ [Add notification strategy] -> [Associate the recipient just set] -> [OK]**
> **Note ⚠️ Adding a new recipient does not mean that it has taken effect and can receive alarm information. It is also necessary to configure the associated alarm notification strategy, that is, specify which messages are sent to which recipients**.
> **Note ⚠️ Adding a new recipient does not mean that it has taken effect and can receive alarm information. It is also necessary to configure the associated alarm notification strategy, that is, specify which messages are sent to which recipients**.
![email](/img/docs/help/alert-notice-4.png)
![email](/img/docs/help/alert-notice-4.png)
### Huawei Cloud SMN Notification FAQ
1. Huawei Cloud SMN did not receive the robot warning notification
> Please check whether the alarm information has been triggered in the alarm center
> Please check whether the Huawei Cloud SMN AK, SK and other configurations are configured correctly, and whether the alarm policy association has been configured
> Please check whether the alarm information has been triggered in the alarm center
> Please check whether the Huawei Cloud SMN AK, SK and other configurations are configured correctly, and whether the alarm policy association has been configured
Other questions can be fed back through the communication group ISSUE!

View File

@ -13,32 +13,32 @@ keywords: [open source monitoring tool, open source alerter, open source Telegra
1. Use [@BotFather](https://t.me/BotFather) to create your own bot and get an access token `Token`
![telegram-bot](/img/docs/help/telegram-bot-1.png)
![telegram-bot](/img/docs/help/telegram-bot-1.png)
2. Get the `User ID` of the recipient
**Use the recipient account you want to notify to send a message to the newly created Bot account**,
Visit ```https://api.telegram.org/bot<TOKEN>/getUpdates```, **`use the Bot Token from the previous step to replace the <TOKEN>`**, and respond to the first in the `Json` data A `result.message.from.id` value is the recipient's `User ID`
**Use the recipient account you want to notify to send a message to the newly created Bot account**,
Visit ```https://api.telegram.org/bot<TOKEN>/getUpdates```, **`use the Bot Token from the previous step to replace the <TOKEN>`**, and respond to the first in the `Json` data A `result.message.from.id` value is the recipient's `User ID`
```json
{
"ok": true,
"result": [
{
"update_id": 632299191,
"message": {
"from":{
"id": "User ID"
},
"chat":{
},
"date": 1673858065,
"text": "111"
```json
{
"ok": true,
"result": [
{
"update_id": 632299191,
"message": {
"from":{
"id": "User ID"
},
"chat":{
},
"date": 1673858065,
"text": "111"
}
}
}
]
}
```
]
}
```
3. Record and save the `Token` and `User Id` we got
@ -46,20 +46,20 @@ Visit ```https://api.telegram.org/bot<TOKEN>/getUpdates```, **`use the Bot Token
1. **【Alarm Notification】->【Add Recipient】->【Select Telegram Robot Notification Method】->【Set Robot Token and UserId】-> 【OK】**
![email](/img/docs/help/telegram-bot-2.png)
![email](/img/docs/help/telegram-bot-2.png)
4. **Configure the associated alarm notification strategy⚠️ [Add notification strategy] -> [Associate the recipient just set] -> [OK]**
2. **Configure the associated alarm notification strategy⚠️ [Add notification strategy] -> [Associate the recipient just set] -> [OK]**
> **Note ⚠️ Adding a new recipient does not mean that it has taken effect and can receive alarm information. It is also necessary to configure the associated alarm notification strategy, that is, specify which messages are sent to which recipients**.
> **Note ⚠️ Adding a new recipient does not mean that it has taken effect and can receive alarm information. It is also necessary to configure the associated alarm notification strategy, that is, specify which messages are sent to which recipients**.
![email](/img/docs/help/alert-notice-policy.png)
![email](/img/docs/help/alert-notice-policy.png)
### Telegram Bot Notification FAQ
1. Telegram did not receive the robot warning notification
> Please check whether the alarm information has been triggered in the alarm center
> Please check whether the robot Token and UserId are configured correctly, and whether the alarm policy association has been configured
> UserId should be the UserId of the recipient of the message
> Please check whether the alarm information has been triggered in the alarm center
> Please check whether the robot Token and UserId are configured correctly, and whether the alarm policy association has been configured
> UserId should be the UserId of the recipient of the message
Other questions can be fed back through the communication group ISSUE!

View File

@ -11,13 +11,13 @@ keywords: [open source monitoring tool, open source alerter, open source webhook
1. **【Alarm notification】->【Add new recipient】 ->【Select WebHook notification method】-> 【Set WebHook callback address】 -> 【Confirm】**
![email](/img/docs/help/alert-notice-5.png)
![email](/img/docs/help/alert-notice-5.png)
2. **Configure the associated alarm notification strategy⚠️ 【Add new notification strategy】-> 【Associate the recipient just set】-> 【Confirm】**
> **Note⚠️ Adding a new recipient does not mean that it is effective to receive alarm information. It is also necessary to configure the associated alarm notification strategy, that is, to specify which messages are sent to which recipients.**
> **Note⚠️ Adding a new recipient does not mean that it is effective to receive alarm information. It is also necessary to configure the associated alarm notification strategy, that is, to specify which messages are sent to which recipients.**
![email](/img/docs/help/alert-notice-4.png)
![email](/img/docs/help/alert-notice-4.png)
### WebHook callback POST body BODY content
@ -60,7 +60,7 @@ Content format:JSON
1. WebHook callback did not take effect
> Please check whether there is any triggered alarm information in the alarm center.
> Please check whether the configured webhook callback address is correct.
> Please check whether there is any triggered alarm information in the alarm center.
> Please check whether the configured webhook callback address is correct.
Other issues can be fed back through the communication group ISSUE!

View File

@ -11,20 +11,20 @@ keywords: [open source monitoring tool, open source alerter, open source WeWork
1. **【Enterprise Wechat】-> 【Group settings】-> 【Group robot】-> 【Add new robot】-> 【Set robot name and avatar】-> 【Copy its webhook address after adding successfully】**
![email](/img/docs/help/alert-notice-6.jpg)
![email](/img/docs/help/alert-notice-6.jpg)
2. **【Save the key value of the WebHook address of the robot】**
> eg: webHook address:`https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=3adafc96-23d0-4cd5-8feb-17f6e0b5fcs4`
> Its robot KEY value is `3adafc96-23d0-4cd5-8feb-17f6e0b5fcs4`
> eg: webHook address:`https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=3adafc96-23d0-4cd5-8feb-17f6e0b5fcs4`
> Its robot KEY value is `3adafc96-23d0-4cd5-8feb-17f6e0b5fcs4`
3. **【Alarm notification】->【Add new recipient】 ->【Select enterprise Wechat robot notification method】->【Set enterprise Wechat robot KEY】-> 【Confirm】**
![email](/img/docs/help/alert-notice-7.png)
![email](/img/docs/help/alert-notice-7.png)
4. **Configure the associated alarm notification strategy⚠️ 【Add new notification strategy】-> 【Associate the recipient just set】-> 【Confirm】**
> **Note⚠️ Adding a new recipient does not mean that it is effective to receive alarm information. It is also necessary to configure the associated alarm notification strategy, that is, to specify which messages are sent to which recipients.**
> **Note⚠️ Adding a new recipient does not mean that it is effective to receive alarm information. It is also necessary to configure the associated alarm notification strategy, that is, to specify which messages are sent to which recipients.**
![email](/img/docs/help/alert-notice-4.png)
@ -32,7 +32,7 @@ keywords: [open source monitoring tool, open source alerter, open source WeWork
1. The enterprise wechat group did not receive the robot alarm notification.
> Please check whether there is any triggered alarm information in the alarm center.
> Please check whether the robot key is configured correctly and whether the alarm strategy association is configured.
> Please check whether there is any triggered alarm information in the alarm center.
> Please check whether the robot key is configured correctly and whether the alarm strategy association is configured.
Other issues can be fed back through the communication group ISSUE!

View File

@ -11,53 +11,53 @@ keywords: [open source monitoring tool, open source dynamicTp monitoring tool, m
1. Integration Using `DynamicTp`
`DynamicTp` is a lightweight dynamic thread pool based on the configuration center of the Jvm language. It has built-in monitoring and alarm functions, which can be realized through SPI custom extensions.
`DynamicTp` is a lightweight dynamic thread pool based on the configuration center of the Jvm language. It has built-in monitoring and alarm functions, which can be realized through SPI custom extensions.
For integrated use, please refer to the document [Quick Start](https://dynamictp.cn/guide/use/quick-start.html)
For integrated use, please refer to the document [Quick Start](https://dynamictp.cn/guide/use/quick-start.html)
2. Open SpringBoot Actuator Endpoint to expose `DynamicTp` Metric interface
```yaml
management:
endpoints:
web:
exposure:
include: '*'
```
```yaml
management:
endpoints:
web:
exposure:
include: '*'
```
Test whether the access Metric interface `ip:port/actuator/dynamic-tp` has response json data as follows:
Test whether the access Metric interface `ip:port/actuator/dynamic-tp` has response json data as follows:
```json
[
{
"poolName": "commonExecutor",
"corePoolSize": 1,
"maximumPoolSize": 1,
"queueType": "LinkedBlockingQueue",
"queueCapacity": 2147483647,
"queueSize": 0,
"fair": false,
"queueRemainingCapacity": 2147483647,
"activeCount": 0,
"taskCount": 0,
"completedTaskCount": 0,
"largestPoolSize": 0,
"poolSize": 0,
"waitTaskCount": 0,
"rejectCount": 0,
"rejectHandlerName": null,
"dynamic": false,
"runTimeoutCount": 0,
"queueTimeoutCount": 0
},
{
"maxMemory": "4GB",
"totalMemory": "444MB",
"freeMemory": "250.34 MB",
"usableMemory": "3.81GB"
}
]
```
```json
[
{
"poolName": "commonExecutor",
"corePoolSize": 1,
"maximumPoolSize": 1,
"queueType": "LinkedBlockingQueue",
"queueCapacity": 2147483647,
"queueSize": 0,
"fair": false,
"queueRemainingCapacity": 2147483647,
"activeCount": 0,
"taskCount": 0,
"completedTaskCount": 0,
"largestPoolSize": 0,
"poolSize": 0,
"waitTaskCount": 0,
"rejectCount": 0,
"rejectHandlerName": null,
"dynamic": false,
"runTimeoutCount": 0,
"queueTimeoutCount": 0
},
{
"maxMemory": "4GB",
"totalMemory": "444MB",
"freeMemory": "250.34 MB",
"usableMemory": "3.81GB"
}
]
```
3. Add DynamicTp monitoring under HertzBeat middleware monitoring

View File

@ -17,29 +17,29 @@ The main steps are as follows:
1. The metric collection is disabled by default, you need to modify the parameters in `conf/iotdb-metric.yml` first, then restart the server
```
# Whether to start the monitoring module, the default is false
enableMetric: true
# Whether to enable operation delay statistics
enablePerformanceStat: false
# Data provision method, externally provide metrics data through jmx and prometheus protocol, optional parameters: [JMX, PROMETHEUS, IOTDB], IOTDB is closed by default.
metricReporterList:
- JMX
- PROMETHEUS
# The metric architecture used at the bottom layer, optional parameters: [MICROMETER, DROPWIZARD]
monitorType: MICROMETER
# Initialize the level of the metric, optional parameters: [CORE, IMPORTANT, NORMAL, ALL]
metricLevel: IMPORTANT
# Predefined metrics set, optional parameters: [JVM, LOGBACK, FILE, PROCESS, SYSTEM]
predefinedMetrics:
- JVM
- FILE
```
```
# Whether to start the monitoring module, the default is false
enableMetric: true
# Whether to enable operation delay statistics
enablePerformanceStat: false
# Data provision method, externally provide metrics data through jmx and prometheus protocol, optional parameters: [JMX, PROMETHEUS, IOTDB], IOTDB is closed by default.
metricReporterList:
- JMX
- PROMETHEUS
# The metric architecture used at the bottom layer, optional parameters: [MICROMETER, DROPWIZARD]
monitorType: MICROMETER
# Initialize the level of the metric, optional parameters: [CORE, IMPORTANT, NORMAL, ALL]
metricLevel: IMPORTANT
# Predefined metrics set, optional parameters: [JVM, LOGBACK, FILE, PROCESS, SYSTEM]
predefinedMetrics:
- JVM
- FILE
```
2. Restart IoTDB, open a browser or use curl to access http://servier_ip:9091/metrics, and you can see the metric data.

View File

@ -8,50 +8,49 @@ sidebar_label: Common issues
1. **Page feedback:monitor.host: Monitoring Host must be ipv4, ipv6 or domain name**
> As shown in the information, the entered monitoring Host must be ipv4, ipv6 or domain name, and cannot carry a protocol header, such as http
> As shown in the information, the entered monitoring Host must be ipv4, ipv6 or domain name, and cannot carry a protocol header, such as http
2. **The website API and other monitoring feedback statusCode:403 or 401, but the opposite end service itself does not need authentication, and the direct access of the browser is OK**
> Please check whether it is blocked by the firewall. For example, BaoTa/aaPanel have set the blocking of `User-Agent=Apache-HttpClient` in the request header by default. If it is blocked, please delete this blocking rule. (user-agent has been simulated as a browser in the v1.0.beat5 version. This problem does not exist)
> Please check whether it is blocked by the firewall. For example, BaoTa/aaPanel have set the blocking of `User-Agent=Apache-HttpClient` in the request header by default. If it is blocked, please delete this blocking rule. (user-agent has been simulated as a browser in the v1.0.beat5 version. This problem does not exist)
3. Ping connectivity monitoring exception when installing hertzbeat for package deployment.
The hertzbeat installed and deployed by the installation package is not available for ping connectivity monitoring, but local direct ping is available 。
> The deployment of the installation package requires configuring the root permission of the Java virtual machine to start hertzbeat to use ICMP. If the root permission is not enabled, judge whether port 7 of telnet opposite end is opened.
> When you install HertzBeat via DockerDocker root is enabled by default. No such problem.
> See <https://stackoverflow.com/questions/11506321/how-to-ping-an-ip-address>
> The deployment of the installation package requires configuring the root permission of the Java virtual machine to start hertzbeat to use ICMP. If the root permission is not enabled, judge whether port 7 of telnet opposite end is opened.
> When you install HertzBeat via DockerDocker root is enabled by default. No such problem.
> See <https://stackoverflow.com/questions/11506321/how-to-ping-an-ip-address>
### Docker Deployment common issues
1. **MYSQL, TDENGINE 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 A:Configure application.yml. Change database connection address from localhost to external IP of the host machine.
> Solution B:Use the Host network mode to start Docker, namely making Docker container and hosting share network. `docker run -d --network host .....`
> Solution A:Configure application.yml. Change database connection address from localhost to external IP of the host machine.
> Solution B:Use 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 deploy,visit <http://ip:1157/> no interface**
Please refer to the following points to troubleshoot issues:
> one:Whether the MySQL database and tdengine database as dependent services have been successfully started, whether the corresponding hertzbeat database has been created, and whether the SQL script has been executed.
> two:Check whether dependent service, IP account and password configuration is correct in HertzBeat's configuration file `application.yml`.
>
>> three:`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.
> one:Whether the MySQL database and tdengine database as dependent services have been successfully started, whether the corresponding hertzbeat database has been created, and whether the SQL script has been executed.
> two:Check whether dependent service, IP account and password configuration is correct in HertzBeat's configuration file `application.yml`.
> three:`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. **Log an error TDengine connection or insert SQL failed**
> one:Check whether database account and password configured is correct, the database is created.
> two:If you install TDengine2.3+ version, you must execute `systemctl start taosadapter` to start adapter in addition to start the server.
> one:Check whether database account and password configured is correct, the database is created.
> two:If you install TDengine2.3+ version, you must execute `systemctl start taosadapter` to start adapter in addition to start the server.
### Package Deployment common issues
1. **According to the process deploy,visit <http://ip:1157/> no interface**
Please refer to the following points to troubleshoot issues:
> one:Whether the MySQL database and tdengine database as dependent services have been successfully started, whether the corresponding hertzbeat database has been created, and whether the SQL script has been executed.
> two:Check whether dependent services, IP account and password configuration is correct in HertzBeat's configuration file `hertzbeat/config/application.yml`.
> three: Check 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.
> one:Whether the MySQL database and tdengine database as dependent services have been successfully started, whether the corresponding hertzbeat database has been created, and whether the SQL script has been executed.
> two:Check whether dependent services, IP account and password configuration is correct in HertzBeat's configuration file `hertzbeat/config/application.yml`.
> three: Check 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.
2. **Log an error TDengine connection or insert SQL failed**
> one:Check whether database account and password configured is correct, the database is created.
> two:If you install TDengine2.3+ version, you must execute `systemctl start taosadapter` to start adapter in addition to start the server.
> one:Check whether database account and password configured is correct, the database is created.
> two:If you install TDengine2.3+ version, you must execute `systemctl start taosadapter` to start adapter in addition to start the server.

View File

@ -19,33 +19,33 @@ keywords: [open source monitoring tool, open source jetty web server monitoring
1. Start the JMX JMX-REMOTE module in Jetty
```shell
java -jar $JETTY_HOME/start.jar --add-module=jmx
java -jar $JETTY_HOME/start.jar --add-module=jmx-remote
```
```shell
java -jar $JETTY_HOME/start.jar --add-module=jmx
java -jar $JETTY_HOME/start.jar --add-module=jmx-remote
```
Successful command execution will create `${JETTY_BASE}/start.d/jmx-remote.ini` configuration file
Successful command execution will create `${JETTY_BASE}/start.d/jmx-remote.ini` configuration file
2. Edit the `${JETTY_BASE}/start.d/jmx-remote.ini` configuration file to modify the JMX IP port and other parameters.
**`localhost` needs to be modified to expose the IP**
**`localhost` needs to be modified to expose the IP**
```text
## The host/address to bind the RMI server to.
# jetty.jmxremote.rmiserverhost=localhost
## The port the RMI server listens to (0 means a random port is chosen).
# jetty.jmxremote.rmiserverport=1099
## The host/address to bind the RMI registry to.
# jetty.jmxremote.rmiregistryhost=localhost
## The port the RMI registry listens to.
# jetty.jmxremote.rmiregistryport=1099
## The host name exported in the RMI stub.
-Djava.rmi.server.hostname=localhost
```
```text
## The host/address to bind the RMI server to.
# jetty.jmxremote.rmiserverhost=localhost
## The port the RMI server listens to (0 means a random port is chosen).
# jetty.jmxremote.rmiserverport=1099
## The host/address to bind the RMI registry to.
# jetty.jmxremote.rmiregistryhost=localhost
## The port the RMI registry listens to.
# jetty.jmxremote.rmiregistryport=1099
## The host name exported in the RMI stub.
-Djava.rmi.server.hostname=localhost
```
3. Restart Jetty Server.

View File

@ -17,15 +17,15 @@ Refer to the steps to obtain token
1. Create a service account and bind the default cluster-admin administrator cluster role
```kubectl create serviceaccount dashboard-admin -n kube-system```
```kubectl create serviceaccount dashboard-admin -n kube-system```
2. User Authorization
```shell
kubectl create clusterrolebinding dashboard-admin --clusterrole=cluster-admin --serviceaccount=kube-system:dashboard-admin
kubectl -n kube-system get secret | grep dashboard-admin | awk '{print $1}'
kubectl describe secret {secret} -n kube-system
```
```shell
kubectl create clusterrolebinding dashboard-admin --clusterrole=cluster-admin --serviceaccount=kube-system:dashboard-admin
kubectl -n kube-system get secret | grep dashboard-admin | awk '{print $1}'
kubectl describe secret {secret} -n kube-system
```
### method two

View File

@ -14,9 +14,9 @@ keywords: [open source monitoring tool, open source middleware monitoring tool,
1. Deploy the Nacos cluster according to [deployment document](https://nacos.io/en-us/docs/deployment.html).
2. Configure the application. properties file to expose metrics data.
```
management.endpoints.web.exposure.include=*
```
```
management.endpoints.web.exposure.include=*
```
3. Access ```{ip}:8848/nacos/actuator/prometheus``` to see if metrics data can be accessed.

View File

@ -17,95 +17,97 @@ If you want to monitor information in 'Nginx' with this monitoring type, you nee
1. Check if `ngx_http_stub_status_module` has been added
```shell
nginx -V
```
```shell
nginx -V
```
View whether it contains `--with-http_stub_status_module`, if not, you need to recompile and install Nginx.
View whether it contains `--with-http_stub_status_module`, if not, you need to recompile and install Nginx.
2. Compile and install Nginx, add `ngx_http_stub_status_module` module
Download Nginx and unzip it, execute the following command in the directory
Download Nginx and unzip it, execute the following command in the directory
```shell
./configure --prefix=/usr/local/nginx --with-http_stub_status_module
make && make install
```
```shell
./configure --prefix=/usr/local/nginx --with-http_stub_status_module
make && make install
```
3. Modify Nginx configure file
Modify the `nginx.conf` file and add the monitoring module exposed endpoint, as follows:
Modify the `nginx.conf` file and add the monitoring module exposed endpoint, as follows:
```shell
# modify nginx.conf
server {
listen 80; # port
server_name localhost;
location /nginx-status {
stub_status on;
access_log on;
#allow 127.0.0.1; #only allow requests from localhost
#deny all; #deny all other hosts
}
}
```
```shell
# modify nginx.conf
server {
listen 80; # port
server_name localhost;
location /nginx-status {
stub_status on;
access_log on;
#allow 127.0.0.1; #only allow requests from localhost
#deny all; #deny all other hosts
}
}
```
4. Reload Nginx
```shell
nginx -s reload
```
```shell
nginx -s reload
```
5. Access `http://localhost/nginx-status` in the browser to view the Nginx monitoring status information.
### Enable `ngx_http_reqstat_module`
```shell
# install `ngx_http_reqstat_module`
wget https://github.com/zls0424/ngx_req_status/archive/master.zip -O ngx_req_status.zip
1. Install `ngx_http_reqstat_module`
unzip ngx_req_status.zip
patch -p1 < ../ngx_req_status-master/write_filter.patch
./configure --prefix=/usr/local/nginx --add-module=/path/to/ngx_req_status-master
make -j2
make install
```
```shell
# install `ngx_http_reqstat_module`
wget https://github.com/zls0424/ngx_req_status/archive/master.zip -O ngx_req_status.zip
unzip ngx_req_status.zip
patch -p1 < ../ngx_req_status-master/write_filter.patch
./configure --prefix=/usr/local/nginx --add-module=/path/to/ngx_req_status-master
make -j2
make install
```
2. Modify Nginx configure file
update `nginx.conf` file, add status module exposed endpoint, as follows:
update `nginx.conf` file, add status module exposed endpoint, as follows:
```shell
# modify nginx.conf
http {
req_status_zone server_name $server_name 256k;
req_status_zone server_addr $server_addr 256k;
req_status server_name server_addr;
server {
location /req-status {
req_status_show on;
#allow 127.0.0.1; #only allow requests from localhost
#deny all; #deny all other hosts
```shell
# modify nginx.conf
http {
req_status_zone server_name $server_name 256k;
req_status_zone server_addr $server_addr 256k;
req_status server_name server_addr;
server {
location /req-status {
req_status_show on;
#allow 127.0.0.1; #only allow requests from localhost
#deny all; #deny all other hosts
}
}
}
}
```
```
3. Reload Nginx
```shell
nginx -s reload
```
```shell
nginx -s reload
```
4. Access `http://localhost/req-status` in the browser to view the Nginx monitoring status information.

View File

@ -14,9 +14,9 @@ keywords: [open source monitoring tool, open source rabbitmq monitoring tool, mo
1. Open the Management plugin, or use the self-opening version
```shell
rabbitmq-plugins enable rabbitmq_management
```
```shell
rabbitmq-plugins enable rabbitmq_management
```
2. Access <http://ip:15672/> with a browser, and the default account password is `guest/guest`. Successful login means that it is successfully opened.

View File

@ -17,27 +17,27 @@ Two Steps Mainly:
1. add metrics plugin dependency in gateway's pom.xml.
```xml
<dependency>
<groupId>org.apache.shenyu</groupId>
<artifactId>shenyu-spring-boot-starter-plugin-metrics</artifactId>
<version>${project.version}</version>
</dependency>
```
```xml
<dependency>
<groupId>org.apache.shenyu</groupId>
<artifactId>shenyu-spring-boot-starter-plugin-metrics</artifactId>
<version>${project.version}</version>
</dependency>
```
2. modify this config in shenyu gateway yaml.
```yaml
shenyu:
metrics:
enabled: false #false is close, true is open
name : prometheus
host: 127.0.0.1
port: 8090
jmxConfig:
props:
jvm_enabled: true #enable jvm monitoring
```
```yaml
shenyu:
metrics:
enabled: false #false is close, true is open
name : prometheus
host: 127.0.0.1
port: 8090
jmxConfig:
props:
jvm_enabled: true #enable jvm monitoring
```
Finally, restart the access gateway metrics endpoint `http://ip:8090` to respond to prometheus format data.

View File

@ -16,44 +16,44 @@ The installation package can be decompressed and modified in `hertzbeat/config/a
1. Configure the SMS sending server
> Only when your own SMS server is successfully configured, the alarm SMS triggered in the monitoring tool will be sent normally.
> Only when your own SMS server is successfully configured, the alarm SMS triggered in the monitoring tool will be sent normally.
Add the following Tencent platform SMS server configuration in `application.yml` (parameters need to be replaced with your SMS server configuration)
Add the following Tencent platform SMS server configuration in `application.yml` (parameters need to be replaced with your SMS server configuration)
```yaml
common:
sms:
tencent:
secret-id: AKIDbQ4VhdMr89wDedFrIcgU2PaaMvOuBCzY
secret-key: PaXGl0ziY9UcWFjUyiFlCPMr77rLkJYlyA
app-id: 1435441637
sign-name: XX Technology
template-id: 1343434
```
```yaml
common:
sms:
tencent:
secret-id: AKIDbQ4VhdMr89wDedFrIcgU2PaaMvOuBCzY
secret-key: PaXGl0ziY9UcWFjUyiFlCPMr77rLkJYlyA
app-id: 1435441637
sign-name: XX Technology
template-id: 1343434
```
2. Configure alarm custom parameters
```yaml
alerter:
# Custom console address
console-url: https://console.tancloud.io
```
```yaml
alerter:
# Custom console address
console-url: https://console.tancloud.io
```
3. Use external redis instead of memory to store real-time metric data
> By default, the real-time data of our metrics is stored in memory, which can be configured as follows to use redis instead of memory storage.
> By default, the real-time data of our metrics is stored in memory, which can be configured as follows to use redis instead of memory storage.
Note ⚠️ `memory.enabled: false, redis.enabled: true`
Note ⚠️ `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
```
```yaml
warehouse:
store:
memory:
enabled: false
init-size: 1024
redis:
enabled: true
host: 127.0.0.1
port: 6379
password: 123456
```

View File

@ -15,47 +15,47 @@ Run the `docker compose version` command to check if you have a Docker Compose e
1. Download the startup script package
Download the installation script package `apache-hertzbeat-xxx-incubating-docker-compose.tar.gz` from the [download](https://github.com/apache/hertzbeat/releases/download/v1.6.0/apache-hertzbeat-1.6.0-incubating-docker-compose.tar.gz)
Download the installation script package `apache-hertzbeat-xxx-incubating-docker-compose.tar.gz` from the [download](https://github.com/apache/hertzbeat/releases/download/v1.6.0/apache-hertzbeat-1.6.0-incubating-docker-compose.tar.gz)
2. Choose to use the HertzBeat + PostgreSQL + VictoriaMetrics solution
:::tip
:::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.
- `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
- Unzip the script package
```
tar zxvf apache-hertzbeat-1.6.0-incubating-docker-compose.tar.gz
```
```
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
- Enter the decompression directory and select `HertzBeat + PostgreSQL + VictoriaMetrics` for one-click deployment
```
cd apache-hertzbeat-1.6.0-incubating-docker-compose
cd hertzbeat-postgresql-victoria-metrics
```
```
cd apache-hertzbeat-1.6.0-incubating-docker-compose
cd hertzbeat-postgresql-victoria-metrics
```
- One-click start
- One-click start
> Run script in `hertzbeat-postgresql-victoria-metrics` directory
> Run script in `hertzbeat-postgresql-victoria-metrics` directory
```
docker-compose up -d
```
```
docker-compose up -d
```
- View service status
- View service status
> View the running status of each container, up is the normal running status
> View the running status of each container, up is the normal running status
```
docker-compose ps
```
```
docker-compose ps
```
4. Start exploring HertzBeat
3. Start exploring HertzBeat
Access <http://ip:1157/> in the browser to start exploring and using it. The default account password is admin/hertzbeat.
**HAVE FUN**

View File

@ -17,39 +17,39 @@ It is necessary to have Docker environment in your environment. If not installed
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
```
```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
> 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 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://download.oracle.com/otn-pub/otn_software/jdbc/234/ojdbc8.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 .....`
- `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 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://download.oracle.com/otn-pub/otn_software/jdbc/234/ojdbc8.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
:::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 .....`
- 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/> using browser. You can explore HertzBeat with default account `admin/hertzbeat` now!
@ -65,36 +65,36 @@ By deploying multiple HertzBeat Collectors, high availability, load balancing, a
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
```
```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
> 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 .....`
- `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
:::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 .....`
- 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.
@ -109,49 +109,49 @@ $ docker run -d \
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 A:Configure application.yml. Change database connection address from localhost to external IP of the host machine.
> Solution B:Use the Host network mode to start Docker, namely making Docker container and hosting share network. `docker run -d --network host .....`
> Solution A:Configure application.yml. Change database connection address from localhost to external IP of the host machine.
> Solution B:Use 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 deploy,visit <http://ip:1157/> no interface
Please refer to the following points to troubleshoot issues:
> 1:If you switch to dependency service MYSQL database,check whether the database is created and started successfully.
> 2:Check 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.
> 1:If you switch to dependency service MYSQL database,check whether the database is created and started successfully.
> 2:Check 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
> 1:Check 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`.
> 1:Check 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 displayed,popup [please configure time series database]
> As shown in the popup window,the 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)
> As shown in the popup window,the 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
> 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)
> 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 directory,eg:`$(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)
> 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 directory,eg:`$(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)

View File

@ -17,28 +17,28 @@ It's designed to work on infrastructure of the cloud era, and users benefit from
### Install GreptimeDB via Docker
> Refer to the official website [installation tutorial](https://docs.greptime.com/getting-started/overview)
>
> 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.
>
> ```
> $ docker -v
> Docker version 20.10.12, build e91ed57
> ```
>
> 2. Install GreptimeDB with Docker
```shell
$ docker run -p 127.0.0.1:4000-4003:4000-4003 \
-v "$(pwd)/greptimedb:/tmp/greptimedb" \
--name greptime --rm \
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
```
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 -p 127.0.0.1:4000-4003:4000-4003 \
v "$(pwd)/greptimedb:/tmp/greptimedb" \
--name greptime --rm \
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
@ -50,24 +50,24 @@ use```$ docker ps``` to check if the database started successfully
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:
# disable jpa
jpa:
enabled: false
# enable greptime
greptime:
enabled: true
grpc-endpoints: localhost:4001
url: jdbc:mysql://localhost:4002/hertzbeat?connectionTimeZone=Asia/Shanghai&forceConnectionTimeZoneToSession=true
driver-class-name: com.mysql.cj.jdbc.Driver
username: greptime
password: greptime
expire-time: 30d
```
```yaml
warehouse:
store:
# disable jpa
jpa:
enabled: false
# enable greptime
greptime:
enabled: true
grpc-endpoints: localhost:4001
url: jdbc:mysql://localhost:4002/hertzbeat?connectionTimeZone=Asia/Shanghai&forceConnectionTimeZoneToSession=true
driver-class-name: com.mysql.cj.jdbc.Driver
username: greptime
password: greptime
expire-time: 30d
```
The default database is `hertzbeat` in the `url`, and it will be created automatically. The `expire-time` specifies the TTL(time-to-live) of the auto-created database, it's 30 days by default.
The default database is `hertzbeat` in the `url`, and it will be created automatically. The `expire-time` specifies the TTL(time-to-live) of the auto-created database, it's 30 days by default.
2. Restart HertzBeat
@ -75,4 +75,4 @@ The default database is `hertzbeat` in the `url`, and it will be created automat
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.
> 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.

View File

@ -23,26 +23,26 @@ Note⚠️ Need InfluxDB 1.x Version.
### 2. Install TDengine via Docker
> Refer to the official website [installation tutorial](https://hub.docker.com/_/influxdb)
>
> 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.
>
> ```
> $ docker -v
> Docker version 20.10.12, build e91ed57
> ```
>
> 2. Install InfluxDB with Docker
>
> ```
> $ 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
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
@ -51,21 +51,21 @@ Note⚠️ Need InfluxDB 1.x Version.
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
```
```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
@ -73,4 +73,4 @@ warehouse:
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.
> 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.

View File

@ -24,22 +24,22 @@ Apache IoTDB is a software system that integrates the collection, storage, manag
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
```
```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
`-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
@ -47,61 +47,61 @@ use```$ docker ps``` to check if the database started successfully
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.
```
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'
```
```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**
**IoTDB Cluster Configuration**
If you are using IoTDB for clustering, please refer to the configuration below:
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'
```
```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:
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) |
| 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.
> If both cluster configuration `node-urls` and standalone configuration are set simultaneously, the cluster `node-urls` configuration takes precedence.
4. Restart HertzBeat
@ -109,15 +109,15 @@ Configuration parameters:
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.
> 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
> 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
> 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

View File

@ -24,15 +24,15 @@ Deployment via package relies on Java runtime environment, ensure you have Java1
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.
:::
:::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
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)
- [Switch built-in H2 database to PostgreSQL](postgresql-change)
- [Using VictoriaMetrics to store metric data](victoria-metrics-init)
3. Configure the account file(optional)
@ -68,32 +68,32 @@ Deploying multiple HertzBeat Collectors can achieve high availability, load bala
2. Configure the collector configuration file
Unzip the installation package to the host eg: /opt/hertzbeat-collector
Unzip the installation package to the host eg: /opt/hertzbeat-collector
```
tar zxvf apache-hertzbeat-collector-xxx-incubating-bin.tar.gz
```
```
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`
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}
```
```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
> 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.
- `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
@ -127,6 +127,6 @@ collector:
2. According to the process deploy,visit <http://ip:1157/> no interface
Please refer to the following points to troubleshoot issues:
> 1:If you switch to dependency service MYSQL database,check whether the database is created and started successfully.
> 2:Check whether dependent services, IP account and password configuration is correct in HertzBeat's configuration file `hertzbeat/config/application.yml`.
> 3:Check 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.
> 1:If you switch to dependency service MYSQL database,check whether the database is created and started successfully.
> 2:Check whether dependent services, IP account and password configuration is correct in HertzBeat's configuration file `hertzbeat/config/application.yml`.
> 3:Check 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.

View File

@ -16,20 +16,20 @@ sidebar_label: Quick Start
1. Just one command to get started:
```docker run -d -p 1157:1157 -p 1158:1158 --name hertzbeat apache/hertzbeat```
```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)
```
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
```
```
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.
- `-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)

View File

@ -18,7 +18,7 @@ github: <https://github.com/apache/hertzbeat>
1. The `docker` environment can be installed with just one command
`docker run -d -p 1157:1157 --name hertzbeat apache/hertzbeat`
`docker run -d -p 1157:1157 --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`
@ -26,62 +26,62 @@ github: <https://github.com/apache/hertzbeat>
1. Click Add SSL Certificate Monitor
> System Page -> Monitor Menu -> SSL Certificate -> Add SSL Certificate
> System Page -> Monitor Menu -> SSL Certificate -> Add SSL Certificate
![](/img/docs/start/ssl_1.png)
![](/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 ⚠️Before adding, it will test the connectivity of the website by default, and the connection will be successful before adding. Of course, you can also gray out the **Test or not** button.
> Here we take the example of monitoring Baidu website, configure monitoring host domain name, name, collection interval, etc.
> Click OK Note ⚠️Before adding, it will test the connectivity of the website by default, and the connection will be successful before adding. Of course, you can also gray out the **Test or not** button.
![](/img/docs/start/ssl_2.png)
![](/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.
> In the monitoring list, you can view the monitoring status, and in the monitoring details, you can view the metric data chart, etc.
![](/img/docs/start/ssl_3.png)
![](/img/docs/start/ssl_3.png)
![](/img/docs/start/ssl_11.png)
![](/img/docs/start/ssl_11.png)
4. Set the threshold (triggered when the certificate expires)
> System Page -> Alarms -> Alarm Thresholds -> New Thresholds
> System Page -> Alarms -> Alarm Thresholds -> New Thresholds
![](/img/docs/start/ssl_4.png)
![](/img/docs/start/ssl_4.png)
> 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.
> 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.
![](/img/docs/start/ssl_5.png)
![](/img/docs/start/ssl_5.png)
> Associating thresholds with monitoring, in the threshold list, set which monitoring this threshold applies to.
> Associating thresholds with monitoring, in the threshold list, set which monitoring this threshold applies to.
![](/img/docs/start/ssl_6.png)
![](/img/docs/start/ssl_6.png)
5. Set the threshold (triggered one week before the certificate expires)
> In the same way, 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.
> In the same way, 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.
![](/img/docs/start/ssl_7.png)
![](/img/docs/start/ssl_7.png)
> Finally, you can see the triggered alarm in the alarm center.
> Finally, you can see the triggered alarm in the alarm center.
![](/img/docs/start/ssl_8.png)
![](/img/docs/start/ssl_8.png)
6. Alarm notification (in time notification via Dingding WeChat Feishu, etc.)
> Monitoring Tool -> Alarm Notification -> New Receiver
> Monitoring Tool -> Alarm Notification -> New Receiver
![](/img/docs/start/ssl_10.png)
![](/img/docs/start/ssl_10.png)
For token configuration such as Dingding WeChat Feishu, please refer to the help document
For token configuration such as Dingding WeChat Feishu, please refer to the help document
<https://hertzbeat.apache.org/docs/help/alert_dingtalk>
<https://hertzbeat.apache.org/docs/help/alert_dingtalk>
> Alarm Notification -> New Alarm Notification Policy -> Enable Notification for the Recipient Just Configured
> Alarm Notification -> New Alarm Notification Policy -> Enable Notification for the Recipient Just Configured
![](/img/docs/start/ssl_11.png)
![](/img/docs/start/ssl_11.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.

View File

@ -19,28 +19,28 @@ Note⚠️ Need TDengine 3.x Version.
### Install TDengine via Docker
> Refer to the official website [installation tutorial](https://docs.taosdata.com/get-started/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.
>
> ```
> $ 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
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
@ -88,20 +88,20 @@ Note⚠️ Need TDengine 3.x Version.
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
```
```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
@ -109,19 +109,19 @@ warehouse:
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.
> 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
> 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.
> 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
> 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

View File

@ -18,27 +18,27 @@ VictoriaMetrics is a fast, cost-effective and scalable monitoring solution and t
### Install VictoriaMetrics via Docker
> Refer to the official website [installation tutorial](https://docs.victoriametrics.com/Quick-Start.html#how-to-install)
>
> 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.
>
> ```
> $ docker -v
> Docker version 20.10.12, build e91ed57
> ```
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.
```
$ 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
```
```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
`-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
@ -46,19 +46,19 @@ use```$ docker ps``` to check if the database started successfully
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
```
```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
@ -66,4 +66,4 @@ warehouse:
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.
> 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.

View File

@ -24,11 +24,11 @@ gitee: <https://gitee.com/hertzbeat/hertzbeat>
#### 安装 HertzBeat
1.如果不想安装可以直接使用云服务 [TanCloud探云 console.tancloud.cn](https://console.tancloud.cn)
1. 如果不想安装可以直接使用云服务 [TanCloud探云 console.tancloud.cn](https://console.tancloud.cn)
2. `docker` 环境仅需一条命令即可安装
`docker run -d -p 1157:1157 --name hertzbeat apache/hertzbeat`
`docker run -d -p 1157:1157 --name hertzbeat apache/hertzbeat`
3. 安装成功浏览器访问 `localhost:1157` 即可开始,默认账号密码 `admin/hertzbeat`
@ -36,63 +36,63 @@ gitee: <https://gitee.com/hertzbeat/hertzbeat>
1. 点击新增SSL证书监控
> 系统页面 -> 监控菜单 -> SSL证书 -> 新增SSL证书
> 系统页面 -> 监控菜单 -> SSL证书 -> 新增SSL证书
![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/bd53f343a5b54feab62e71458d076441~tplv-k3u1fbpfcp-zoom-1.image)
![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/bd53f343a5b54feab62e71458d076441~tplv-k3u1fbpfcp-zoom-1.image)
2. 配置监控网站
> 我们这里举例监控百度网站, 配置监控host域名,名称,采集间隔等。
> 点击确定 注意⚠️新增前默认会先去测试网站连接性,连接成功才会新增,当然也可以把**是否测试**按钮置灰。
> 我们这里举例监控百度网站, 配置监控host域名,名称,采集间隔等。
> 点击确定 注意⚠️新增前默认会先去测试网站连接性,连接成功才会新增,当然也可以把**是否测试**按钮置灰。
![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/ad1154670648413bb82c8bdeb5b13609~tplv-k3u1fbpfcp-zoom-1.image)
![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/ad1154670648413bb82c8bdeb5b13609~tplv-k3u1fbpfcp-zoom-1.image)
3. 查看检测指标数据
> 在监控列表可以查看任务状态,进监控详情可以查看指标数据图表等。
> 在监控列表可以查看任务状态,进监控详情可以查看指标数据图表等。
![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/f874b45e909c4bb0acdd28b3fb034a61~tplv-k3u1fbpfcp-zoom-1.image)
![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/f874b45e909c4bb0acdd28b3fb034a61~tplv-k3u1fbpfcp-zoom-1.image)
![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/ef5d7443f8c04818ae5aa28d421203be~tplv-k3u1fbpfcp-zoom-1.image)
![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/ef5d7443f8c04818ae5aa28d421203be~tplv-k3u1fbpfcp-zoom-1.image)
4. 设置阈值(证书过期时触发)
> 系统页面 -> 告警 -> 告警阈值 -> 新增阈值
> 系统页面 -> 告警 -> 告警阈值 -> 新增阈值
![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/8d6205172d43463aa34e534477f132f1~tplv-k3u1fbpfcp-zoom-1.image)
![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/8d6205172d43463aa34e534477f132f1~tplv-k3u1fbpfcp-zoom-1.image)
> 配置阈值,选择SSL证书指标对象,配置告警表达式-当指标`expired`为`true`触发,即`equals(expired,"true")` , 设置告警级别通知模版信息等。
> 配置阈值,选择SSL证书指标对象,配置告警表达式-当指标`expired`为`true`触发,即`equals(expired,"true")` , 设置告警级别通知模版信息等。
![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/83d17b381d994f26a6240e01915b2001~tplv-k3u1fbpfcp-zoom-1.image)
![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/83d17b381d994f26a6240e01915b2001~tplv-k3u1fbpfcp-zoom-1.image)
> 关联阈值与监控, 在阈值列表设置此阈值应用于哪些监控。
> 关联阈值与监控, 在阈值列表设置此阈值应用于哪些监控。
![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/9b9063d7bcf9454387be0491fc382bd1~tplv-k3u1fbpfcp-zoom-1.image)
![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/9b9063d7bcf9454387be0491fc382bd1~tplv-k3u1fbpfcp-zoom-1.image)
5. 设置阈值(证书过期前一周触发)
> 同理如上,新增配置阈值,配置告警表达式-当指标有效期时间戳 `end_timestamp`,`now()`函数为当前时间戳,若配置提前一周触发告警即:`end_timestamp <= (now() + 604800000)` , 其中 `604800000` 为7天总时间差毫秒值。
> 同理如上,新增配置阈值,配置告警表达式-当指标有效期时间戳 `end_timestamp`,`now()`函数为当前时间戳,若配置提前一周触发告警即:`end_timestamp <= (now() + 604800000)` , 其中 `604800000` 为7天总时间差毫秒值。
![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/0d6f837f57c247e09f668f60eff4a0ff~tplv-k3u1fbpfcp-zoom-1.image)
![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/0d6f837f57c247e09f668f60eff4a0ff~tplv-k3u1fbpfcp-zoom-1.image)
> 最终可以在告警中心看到已触发的告警。
> 最终可以在告警中心看到已触发的告警。
![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/5a61b23127524976b2c209ce0ca6a339~tplv-k3u1fbpfcp-zoom-1.image)
![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/5a61b23127524976b2c209ce0ca6a339~tplv-k3u1fbpfcp-zoom-1.image)
6. 告警通知(通过钉钉微信飞书等及时通知)
> 监控系统 -> 告警通知 -> 新增接收人
> 监控系统 -> 告警通知 -> 新增接收人
![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/7f36956060ef410a82bbecafcbb2957f~tplv-k3u1fbpfcp-zoom-1.image)
![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/7f36956060ef410a82bbecafcbb2957f~tplv-k3u1fbpfcp-zoom-1.image)
钉钉微信飞书等token配置可以参考帮助文档
钉钉微信飞书等token配置可以参考帮助文档
<https://hertzbeat.com/docs/help/alert_dingtalk>
<https://tancloud.cn/docs/help/alert_dingtalk>
<https://hertzbeat.com/docs/help/alert_dingtalk>
<https://tancloud.cn/docs/help/alert_dingtalk>
> 告警通知 -> 新增告警通知策略 -> 将刚才配置的接收人启用通知
> 告警通知 -> 新增告警通知策略 -> 将刚才配置的接收人启用通知
![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/d976343e81f843138344a039f3aff8a3~tplv-k3u1fbpfcp-zoom-1.image)
![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/d976343e81f843138344a039f3aff8a3~tplv-k3u1fbpfcp-zoom-1.image)
7. OK 当阈值触发后我们就可以收到对应告警消息啦,如果没有配通知,也可以在告警中心查看告警信息。

View File

@ -32,15 +32,15 @@ keywords: [开源监控系统, 开源数据库监控, IotDB数据库监控]
1. metric 采集默认是关闭的,需要先到 `conf/iotdb-metric.yml` 中修改参数打开后重启 server
```
# 是否启动监控模块,默认为false
enableMetric: true
# 数据提供方式,对外部通过jmx和prometheus协议提供metrics的数据, 可选参数:[JMX, PROMETHEUS, IOTDB],IOTDB是默认关闭的。
metricReporterList:
- JMX
- PROMETHEUS
```
```
# 是否启动监控模块,默认为false
enableMetric: true
# 数据提供方式,对外部通过jmx和prometheus协议提供metrics的数据, 可选参数:[JMX, PROMETHEUS, IOTDB],IOTDB是默认关闭的。
metricReporterList:
- JMX
- PROMETHEUS
```
2. 重启 IoTDB, 打开浏览器或者用curl 访问 <http://ip:9091/metrics>, 就能看到metric数据了。
@ -48,28 +48,28 @@ metricReporterList:
1. 点击新增IoTDB监控
路径:菜单 -> 数据库监控 -> IoTDB监控 -> 新增IoTDB监控
路径:菜单 -> 数据库监控 -> IoTDB监控 -> 新增IoTDB监控
![hertzbeat](/img/blog/monitor-iotdb-1.png)
![hertzbeat](/img/blog/monitor-iotdb-1.png)
2. 配置监控IoTDB所需参数
在监控页面填写 IoTDB **服务IP**,**监控端口**(默认9091),最后点击确定添加即可。
其他参数如**采集间隔**,**超时时间**等可以参考[帮助文档](https://hertzbeat.com/docs/help/iotdb/) <https://hertzbeat.com/docs/help/iotdb/>
在监控页面填写 IoTDB **服务IP**,**监控端口**(默认9091),最后点击确定添加即可。
其他参数如**采集间隔**,**超时时间**等可以参考[帮助文档](https://hertzbeat.com/docs/help/iotdb/) <https://hertzbeat.com/docs/help/iotdb/>
![hertzbeat](/img/blog/monitor-iotdb-2.png)
![hertzbeat](/img/blog/monitor-iotdb-2.png)
3. 完成✅,现在我们已经添加好对 IoTDB 的监控了,查看监控列表即可看到我们的添加项。
![hertzbeat](/img/blog/monitor-iotdb-3.png)
![hertzbeat](/img/blog/monitor-iotdb-3.png)
4. 点击监控列表项的**操作**->**监控详情图标** 即可浏览 IoTDB的实时监控指标数据。
![hertzbeat](/img/blog/monitor-iotdb-4.png)
![hertzbeat](/img/blog/monitor-iotdb-4.png)
5. 点击**监控历史详情TAB** 即可浏览 IoTDB的历史监控指标数据图表📈。
![hertzbeat](/img/blog/monitor-iotdb-5.png)
![hertzbeat](/img/blog/monitor-iotdb-5.png)
**完成DONE!通过上面几步,总结起来其实也就是两步**
@ -84,29 +84,29 @@ metricReporterList:
1. 对某个重要指标配置阈值告警
路径:菜单 -> 告警阈值 -> 新增阈值
路径:菜单 -> 告警阈值 -> 新增阈值
- 选择配置的指标对象,IotDB监控有非常多的指标,其中有个指标关系到节点的状态 `cluster_node_status` -> `status` (节点状态,1=online 2=offline)。
- 这里我们就配置当此指标 `status==2` 时发出告警,告警级别为**紧急告警**,一次即触发,具体如下图。
- 选择配置的指标对象,IotDB监控有非常多的指标,其中有个指标关系到节点的状态 `cluster_node_status` -> `status` (节点状态,1=online 2=offline)。
- 这里我们就配置当此指标 `status==2` 时发出告警,告警级别为**紧急告警**,一次即触发,具体如下图。
![hertzbeat](/img/blog/monitor-iotdb-6.png)
![hertzbeat](/img/blog/monitor-iotdb-6.png)
2. 新增消息通知接收人
路径:菜单 -> 告警通知 -> 告警接收人 -> 新增接收人
路径:菜单 -> 告警通知 -> 告警接收人 -> 新增接收人
消息通知方式支持 **邮件,钉钉,企业微信,飞书,WebHook,短信**等,我们这里以常用的钉钉为例。
消息通知方式支持 **邮件,钉钉,企业微信,飞书,WebHook,短信**等,我们这里以常用的钉钉为例。
- 参照此[帮助文档](https://hertzbeat.com/docs/help/alert_dingtalk) <https://hertzbeat.com/docs/help/alert_dingtalk> 在钉钉端配置机器人,设置安全自定义关键词`HertzBeat`,获取对应`access_token`值。
- 在 HertzBeat 配置接收人参数如下。
- 参照此[帮助文档](https://hertzbeat.com/docs/help/alert_dingtalk) <https://hertzbeat.com/docs/help/alert_dingtalk> 在钉钉端配置机器人,设置安全自定义关键词`HertzBeat`,获取对应`access_token`值。
- 在 HertzBeat 配置接收人参数如下。
【告警通知】->【新增接收人】 ->【选择钉钉机器人通知方式】->【设置钉钉机器人ACCESS_TOKEN】-> 【确定】
【告警通知】->【新增接收人】 ->【选择钉钉机器人通知方式】->【设置钉钉机器人ACCESS_TOKEN】-> 【确定】
![hertzbeat](/img/blog/alert-notice-1.png)
![hertzbeat](/img/blog/alert-notice-1.png)
3. 配置关联的告警通知策略⚠️ 【新增通知策略】-> 【将刚设置的接收人关联】-> 【确定】
![hertzbeat](/img/blog/alert-notice-2.png)
![hertzbeat](/img/blog/alert-notice-2.png)
### 完毕,现在坐等告警消息过来了。叮叮叮叮

View File

@ -42,27 +42,27 @@ tags: [opensource, practice]
1. 在网关的 `pom.xml` 文件中添加 `metrics插件` 的依赖。
```xml
<dependency>
<groupId>org.apache.shenyu</groupId>
<artifactId>shenyu-spring-boot-starter-plugin-metrics</artifactId>
<version>${project.version}</version>
</dependency>
```
```xml
<dependency>
<groupId>org.apache.shenyu</groupId>
<artifactId>shenyu-spring-boot-starter-plugin-metrics</artifactId>
<version>${project.version}</version>
</dependency>
```
2. `metric`插件 采集默认是关闭的, 在网关的配置`yaml`文件中编辑如下内容:
```yaml
shenyu:
metrics:
enabled: true #设置为 true 表示开启
name : prometheus
host: 127.0.0.1 #暴露的ip
port: 8090 #暴露的端口
jmxConfig: #jmx配置
props:
jvm_enabled: true #开启jvm的监控指标
```
```yaml
shenyu:
metrics:
enabled: true #设置为 true 表示开启
name : prometheus
host: 127.0.0.1 #暴露的ip
port: 8090 #暴露的端口
jmxConfig: #jmx配置
props:
jvm_enabled: true #开启jvm的监控指标
```
3. 重启 ShenYu网关, 打开浏览器或者用curl 访问 `http://ip:8090`, 就能看到metric数据了。
@ -70,30 +70,30 @@ shenyu:
1. 点击新增 ShenYu 监控
路径:菜单 -> 中间件监控 -> ShenYu监控 -> 新增ShenYu监控
路径:菜单 -> 中间件监控 -> ShenYu监控 -> 新增ShenYu监控
![hertzbeat](/img/blog/monitor-shenyu-1.png)
![hertzbeat](/img/blog/monitor-shenyu-1.png)
2. 配置监控 ShenYu 所需参数
在监控页面填写 ShenYu **服务IP**,**监控端口**(默认8090),最后点击确定添加即可。
其他参数如**采集间隔**,**超时时间**等可以参考[帮助文档](https://hertzbeat.com/docs/help/shenyu/) <https://hertzbeat.com/docs/help/shenyu/>
在监控页面填写 ShenYu **服务IP**,**监控端口**(默认8090),最后点击确定添加即可。
其他参数如**采集间隔**,**超时时间**等可以参考[帮助文档](https://hertzbeat.com/docs/help/shenyu/) <https://hertzbeat.com/docs/help/shenyu/>
![hertzbeat](/img/blog/monitor-shenyu-1.png)
![hertzbeat](/img/blog/monitor-shenyu-1.png)
3. 完成✅,现在我们已经添加好对 ShenYu 的监控了,查看监控列表即可看到我们的添加项。
![hertzbeat](/img/blog/monitor-shenyu-3.png)
![hertzbeat](/img/blog/monitor-shenyu-3.png)
4. 点击监控列表项的**操作**->**监控详情图标** 即可浏览 ShenYu 的实时监控指标数据。
![hertzbeat](/img/blog/monitor-shenyu-4.png)
![hertzbeat](/img/blog/monitor-shenyu-4.png)
5. 点击**监控历史详情TAB** 即可浏览 ShenYu 的历史监控指标数据图表📈。
![hertzbeat](/img/blog/monitor-shenyu-5.png)
![hertzbeat](/img/blog/monitor-shenyu-5.png)
![hertzbeat](/img/blog/monitor-shenyu-6.png)
![hertzbeat](/img/blog/monitor-shenyu-6.png)
**DONE!完成啦!通过上面几步,总结起来其实也就只用两步**
@ -111,33 +111,33 @@ shenyu:
1. 对某个重要指标配置告警阈值
路径:菜单 -> 告警阈值 -> 新增阈值
路径:菜单 -> 告警阈值 -> 新增阈值
- 选择配置的指标对象,ShenYu 监控有非常多的指标,我们举例对 `打开的文件描述符的数量` `process_open_fds` -> `value` 这个指标进行阈值设置, 当服务端打开文件描述符数量大于3000时发出告警。
- 这里我们就配置当此指标`process_open_fds` 的 `value>3000` 时发出告警,告警级别为**警告告警**,三次即触发,具体如下图。
- 选择配置的指标对象,ShenYu 监控有非常多的指标,我们举例对 `打开的文件描述符的数量` `process_open_fds` -> `value` 这个指标进行阈值设置, 当服务端打开文件描述符数量大于3000时发出告警。
- 这里我们就配置当此指标`process_open_fds` 的 `value>3000` 时发出告警,告警级别为**警告告警**,三次即触发,具体如下图。
![hertzbeat](/img/blog/monitor-shenyu-7.png)
![hertzbeat](/img/blog/monitor-shenyu-7.png)
2. 新增消息通知接收人
> 配置接收人,让告警消息知道要发给谁,用什么方式发。
> 配置接收人,让告警消息知道要发给谁,用什么方式发。
路径:菜单 -> 告警通知 -> 告警接收人 -> 新增接收人
路径:菜单 -> 告警通知 -> 告警接收人 -> 新增接收人
消息通知方式支持 **邮件,钉钉,企业微信,飞书,WebHook,短信**等,我们这里以常用的钉钉为例。
消息通知方式支持 **邮件,钉钉,企业微信,飞书,WebHook,短信**等,我们这里以常用的钉钉为例。
- 参照此[帮助文档](https://hertzbeat.com/docs/help/alert_dingtalk) <https://hertzbeat.com/docs/help/alert_dingtalk> 在钉钉端配置机器人,设置安全自定义关键词`HertzBeat`,获取对应`access_token`值。
- 在 HertzBeat 配置接收人参数如下。
- 参照此[帮助文档](https://hertzbeat.com/docs/help/alert_dingtalk) <https://hertzbeat.com/docs/help/alert_dingtalk> 在钉钉端配置机器人,设置安全自定义关键词`HertzBeat`,获取对应`access_token`值。
- 在 HertzBeat 配置接收人参数如下。
【告警通知】->【新增接收人】 ->【选择钉钉机器人通知方式】->【设置钉钉机器人ACCESS_TOKEN】-> 【确定】
【告警通知】->【新增接收人】 ->【选择钉钉机器人通知方式】->【设置钉钉机器人ACCESS_TOKEN】-> 【确定】
![hertzbeat](/img/blog/alert-notice-1.png)
![hertzbeat](/img/blog/alert-notice-1.png)
3. 配置关联的告警通知策略⚠️ 【新增通知策略】-> 【将刚设置的接收人关联】-> 【确定】
> 配置告警通知策略,让告警消息与接收人绑定,这样就能决定哪些告警发给哪个人。
> 配置告警通知策略,让告警消息与接收人绑定,这样就能决定哪些告警发给哪个人。
![hertzbeat](/img/blog/alert-notice-2.png)
![hertzbeat](/img/blog/alert-notice-2.png)
### 完毕,现在坐等告警消息过来啦。叮叮叮叮

View File

@ -36,76 +36,76 @@ tags: [opensource, practice]
1. 开启 SpringBoot Actuator Endpoint 暴露出`DynamicTp`指标接口
```yaml
management:
endpoints:
web:
exposure:
include: '*'
```
```yaml
management:
endpoints:
web:
exposure:
include: '*'
```
2. 重启后测试访问指标接口 `ip:port/actuator/dynamic-tp` 是否有响应json数据如下:
```json
[
{
"poolName": "commonExecutor",
"corePoolSize": 1,
"maximumPoolSize": 1,
"queueType": "LinkedBlockingQueue",
"queueCapacity": 2147483647,
"queueSize": 0,
"fair": false,
"queueRemainingCapacity": 2147483647,
"activeCount": 0,
"taskCount": 0,
"completedTaskCount": 0,
"largestPoolSize": 0,
"poolSize": 0,
"waitTaskCount": 0,
"rejectCount": 0,
"rejectHandlerName": null,
"dynamic": false,
"runTimeoutCount": 0,
"queueTimeoutCount": 0
},
{
"maxMemory": "4 GB",
"totalMemory": "444 MB",
"freeMemory": "250.34 MB",
"usableMemory": "3.81 GB"
}
]
```
```json
[
{
"poolName": "commonExecutor",
"corePoolSize": 1,
"maximumPoolSize": 1,
"queueType": "LinkedBlockingQueue",
"queueCapacity": 2147483647,
"queueSize": 0,
"fair": false,
"queueRemainingCapacity": 2147483647,
"activeCount": 0,
"taskCount": 0,
"completedTaskCount": 0,
"largestPoolSize": 0,
"poolSize": 0,
"waitTaskCount": 0,
"rejectCount": 0,
"rejectHandlerName": null,
"dynamic": false,
"runTimeoutCount": 0,
"queueTimeoutCount": 0
},
{
"maxMemory": "4 GB",
"totalMemory": "444 MB",
"freeMemory": "250.34 MB",
"usableMemory": "3.81 GB"
}
]
```
#### 二. 在 HertzBeat 监控页面添加 DynamicTp 线程池监控
1. 点击新增 DynamicTp 监控
路径:菜单 -> 中间件监控 -> DynamicTp监控 -> 新增DynamicTp监控
路径:菜单 -> 中间件监控 -> DynamicTp监控 -> 新增DynamicTp监控
![hertzbeat](/img/blog/monitor-dynamic-tp-1.png)
![hertzbeat](/img/blog/monitor-dynamic-tp-1.png)
2. 配置监控 DynamicTp 所需参数
在监控页面填写 DynamicTp **服务IP**,**监控端口**(默认8080),最后点击确定添加即可。
其他参数如**采集间隔**,**超时时间**等可以参考[帮助文档](https://hertzbeat.com/docs/help/dynamic_tp/) <https://hertzbeat.com/docs/help/dynamic_tp/>
在监控页面填写 DynamicTp **服务IP**,**监控端口**(默认8080),最后点击确定添加即可。
其他参数如**采集间隔**,**超时时间**等可以参考[帮助文档](https://hertzbeat.com/docs/help/dynamic_tp/) <https://hertzbeat.com/docs/help/dynamic_tp/>
![hertzbeat](/img/blog/monitor-dynamic-tp-2.png)
![hertzbeat](/img/blog/monitor-dynamic-tp-2.png)
3. 完成✅,现在我们已经添加好对 DynamicTp 的监控了,查看监控列表即可看到我们的添加项。
![hertzbeat](/img/blog/monitor-dynamic-tp-1.png)
![hertzbeat](/img/blog/monitor-dynamic-tp-1.png)
4. 点击监控列表项的**操作**->**监控详情图标** 即可浏览 DynamicTp线程池 的实时监控指标数据。
![hertzbeat](/img/blog/monitor-dynamic-tp-3.png)
![hertzbeat](/img/blog/monitor-dynamic-tp-3.png)
5. 点击**监控历史详情TAB** 即可浏览 DynamicTp线程池 的历史监控指标数据图表📈。
![hertzbeat](/img/blog/monitor-dynamic-tp-4.png)
![hertzbeat](/img/blog/monitor-dynamic-tp-4.png)
![hertzbeat](/img/blog/monitor-dynamic-tp-5.png)
![hertzbeat](/img/blog/monitor-dynamic-tp-5.png)
**DONE!完成啦!通过上面几步,总结起来其实也就只用两步**
@ -123,33 +123,33 @@ management:
1. 对某个重要指标配置告警阈值
路径:菜单 -> 告警阈值 -> 新增阈值
路径:菜单 -> 告警阈值 -> 新增阈值
- 选择配置的指标对象,DynamicTp监控主要是一些线程池相关指标,我们举例对 `运行超时线程数量` `thread_pool_running` -> `run_timeout_count` 这个指标进行阈值设置, 当线程运行超时数量大于1时发出告警。
- 这里我们就配置当此指标`thread_pool_running` 的 `run_timeout_count>1` 时发出告警,告警级别为**严重告警**,三次即触发,具体如下图。
- 选择配置的指标对象,DynamicTp监控主要是一些线程池相关指标,我们举例对 `运行超时线程数量` `thread_pool_running` -> `run_timeout_count` 这个指标进行阈值设置, 当线程运行超时数量大于1时发出告警。
- 这里我们就配置当此指标`thread_pool_running` 的 `run_timeout_count>1` 时发出告警,告警级别为**严重告警**,三次即触发,具体如下图。
![hertzbeat](/img/blog/monitor-dynamic-tp-6.png)
![hertzbeat](/img/blog/monitor-dynamic-tp-6.png)
2. 新增消息通知接收人
> 配置接收人,让告警消息知道要发给谁,用什么方式发。
> 配置接收人,让告警消息知道要发给谁,用什么方式发。
路径:菜单 -> 告警通知 -> 告警接收人 -> 新增接收人
路径:菜单 -> 告警通知 -> 告警接收人 -> 新增接收人
消息通知方式支持 **邮件,钉钉,企业微信,飞书,WebHook,短信**等,我们这里以常用的钉钉为例。
消息通知方式支持 **邮件,钉钉,企业微信,飞书,WebHook,短信**等,我们这里以常用的钉钉为例。
- 参照此[帮助文档](https://hertzbeat.com/docs/help/alert_dingtalk) <https://hertzbeat.com/docs/help/alert_dingtalk> 在钉钉端配置机器人,设置安全自定义关键词`HertzBeat`,获取对应`access_token`值。
- 在 HertzBeat 配置接收人参数如下。
- 参照此[帮助文档](https://hertzbeat.com/docs/help/alert_dingtalk) <https://hertzbeat.com/docs/help/alert_dingtalk> 在钉钉端配置机器人,设置安全自定义关键词`HertzBeat`,获取对应`access_token`值。
- 在 HertzBeat 配置接收人参数如下。
【告警通知】->【新增接收人】 ->【选择钉钉机器人通知方式】->【设置钉钉机器人ACCESS_TOKEN】-> 【确定】
【告警通知】->【新增接收人】 ->【选择钉钉机器人通知方式】->【设置钉钉机器人ACCESS_TOKEN】-> 【确定】
![hertzbeat](/img/blog/alert-notice-1.png)
![hertzbeat](/img/blog/alert-notice-1.png)
3. 配置关联的告警通知策略⚠️ 【新增通知策略】-> 【将刚设置的接收人关联】-> 【确定】
> 配置告警通知策略,让告警消息与接收人绑定,这样就能决定哪些告警发给哪个人。
> 配置告警通知策略,让告警消息与接收人绑定,这样就能决定哪些告警发给哪个人。
![hertzbeat](/img/blog/alert-notice-2.png)
![hertzbeat](/img/blog/alert-notice-2.png)
### 完毕,现在坐等告警消息过来啦。叮叮叮叮

View File

@ -33,28 +33,28 @@ keywords: [开源监控系统, 开源数据库监控, Mysql数据库监控]
1. 点击新增 Mysql 监控
路径:菜单 -> 数据库监控 -> Mysql数据库 -> 新增Mysql数据库监控
路径:菜单 -> 数据库监控 -> Mysql数据库 -> 新增Mysql数据库监控
![hertzbeat](/img/blog/monitor-mysql-1.png)
![hertzbeat](/img/blog/monitor-mysql-1.png)
2. 配置新增监控 Mysql 数据库所需参数
在监控页面填写 Mysql **服务IP**,**监控端口**(默认3306),**账户密码等**,最后点击确定添加即可。
其他参数如**采集间隔**,**超时时间**等可以参考[帮助文档](https://hertzbeat.com/docs/help/mysql/) <https://hertzbeat.com/docs/help/mysql/>
在监控页面填写 Mysql **服务IP**,**监控端口**(默认3306),**账户密码等**,最后点击确定添加即可。
其他参数如**采集间隔**,**超时时间**等可以参考[帮助文档](https://hertzbeat.com/docs/help/mysql/) <https://hertzbeat.com/docs/help/mysql/>
![hertzbeat](/img/blog/monitor-mysql-2.png)
![hertzbeat](/img/blog/monitor-mysql-2.png)
3. 完成✅,现在我们已经添加好对 Mysql数据库 的监控了,查看监控列表即可看到我们的添加项。
![hertzbeat](/img/blog/monitor-mysql-1.png)
![hertzbeat](/img/blog/monitor-mysql-1.png)
4. 点击监控列表项的**操作**->**监控详情图标** 即可浏览 Mysql数据库 的实时监控指标数据。
![hertzbeat](/img/blog/monitor-mysql-3.png)
![hertzbeat](/img/blog/monitor-mysql-3.png)
5. 点击**监控历史详情TAB** 即可浏览 Mysql数据库 的历史监控指标数据图表📈。
![hertzbeat](/img/blog/monitor-mysql-4.png)
![hertzbeat](/img/blog/monitor-mysql-4.png)
**DONE!完成啦!通过上面几步,总结起来其实也就只用一步即可**
@ -71,35 +71,35 @@ keywords: [开源监控系统, 开源数据库监控, Mysql数据库监控]
1. 对某个重要指标配置告警阈值
路径:菜单 -> 阈值规则 -> 新增阈值
路径:菜单 -> 阈值规则 -> 新增阈值
- 选择配置的指标对象,Mysql 数据库监控主要是数据库性能等相关指标,我们举例对 `查询缓存命中率` `cache` -> `query_cache_hit_rate` 这个指标进行阈值设置, 当Mysql的查询缓存命中率很低小于30%时发出告警。
- 这里我们就配置当此指标`cache` 的 `query_cache_hit_rate<30` 时发出告警,告警级别为**严重告警**,三次即触发,具体如下图。
- 选择配置的指标对象,Mysql 数据库监控主要是数据库性能等相关指标,我们举例对 `查询缓存命中率` `cache` -> `query_cache_hit_rate` 这个指标进行阈值设置, 当Mysql的查询缓存命中率很低小于30%时发出告警。
- 这里我们就配置当此指标`cache` 的 `query_cache_hit_rate<30` 时发出告警,告警级别为**严重告警**,三次即触发,具体如下图。
![hertzbeat](/img/blog/monitor-mysql-5.png)
![hertzbeat](/img/blog/monitor-mysql-5.png)
![hertzbeat](/img/blog/monitor-mysql-6.png)
![hertzbeat](/img/blog/monitor-mysql-6.png)
2. 新增消息通知接收人
> 配置接收人,让告警消息知道要发给谁,用什么方式发。
> 配置接收人,让告警消息知道要发给谁,用什么方式发。
路径:菜单 -> 告警通知 -> 告警接收人 -> 新增接收人
路径:菜单 -> 告警通知 -> 告警接收人 -> 新增接收人
消息通知方式支持 **邮件,钉钉,企业微信,飞书,WebHook,短信**等,我们这里以常用的钉钉为例。
消息通知方式支持 **邮件,钉钉,企业微信,飞书,WebHook,短信**等,我们这里以常用的钉钉为例。
- 参照此[帮助文档](https://hertzbeat.com/docs/help/alert_dingtalk) <https://hertzbeat.com/docs/help/alert_dingtalk> 在钉钉端配置机器人,设置安全自定义关键词`HertzBeat`,获取对应`access_token`值。
- 在 HertzBeat 配置接收人参数如下。
- 参照此[帮助文档](https://hertzbeat.com/docs/help/alert_dingtalk) <https://hertzbeat.com/docs/help/alert_dingtalk> 在钉钉端配置机器人,设置安全自定义关键词`HertzBeat`,获取对应`access_token`值。
- 在 HertzBeat 配置接收人参数如下。
【告警通知】->【新增接收人】 ->【选择钉钉机器人通知方式】->【设置钉钉机器人ACCESS_TOKEN】-> 【确定】
【告警通知】->【新增接收人】 ->【选择钉钉机器人通知方式】->【设置钉钉机器人ACCESS_TOKEN】-> 【确定】
![hertzbeat](/img/blog/alert-notice-1.png)
![hertzbeat](/img/blog/alert-notice-1.png)
3. 配置关联的告警通知策略⚠️ 【新增通知策略】-> 【将刚设置的接收人关联】-> 【确定】
> 配置告警通知策略,让告警消息与接收人绑定,这样就能决定哪些告警发给哪个人。
> 配置告警通知策略,让告警消息与接收人绑定,这样就能决定哪些告警发给哪个人。
![hertzbeat](/img/blog/alert-notice-2.png)
![hertzbeat](/img/blog/alert-notice-2.png)
### 完毕,现在坐等告警消息过来啦。叮叮叮叮

View File

@ -30,32 +30,32 @@ Github: <https://github.com/apache/hertzbeat>
1. 点击新增 Linux 监控
路径:菜单 -> 操作系统监控 -> Linux操作系统 -> 新增Linux操作系统监控
路径:菜单 -> 操作系统监控 -> Linux操作系统 -> 新增Linux操作系统监控
![hertzbeat](/img/blog/monitor-linux-1.png)
![hertzbeat](/img/blog/monitor-linux-1.png)
2. 配置新增监控 Linux 所需参数
在监控页面填写 Linux **对端IP**,**SSH端口**(默认22),**账户密码等**,最后点击确定添加即可。
其他参数如**采集间隔**,**超时时间**等可以参考帮助文档 <https://hertzbeat.com/docs/help/mysql/>
在监控页面填写 Linux **对端IP**,**SSH端口**(默认22),**账户密码等**,最后点击确定添加即可。
其他参数如**采集间隔**,**超时时间**等可以参考帮助文档 <https://hertzbeat.com/docs/help/mysql/>
![hertzbeat](/img/blog/monitor-linux-2.png)
![hertzbeat](/img/blog/monitor-linux-2.png)
3. 完成✅,现在我们已经添加好对 Linux 的监控了,查看监控列表即可看到我们的添加项。
![hertzbeat](/img/blog/monitor-linux-3.png)
![hertzbeat](/img/blog/monitor-linux-3.png)
4. 点击监控列表项的**操作**->**监控详情图标** 即可浏览 Linux 的实时监控指标数据。
![hertzbeat](/img/blog/monitor-linux-4.png)
![hertzbeat](/img/blog/monitor-linux-4.png)
![hertzbeat](/img/blog/monitor-linux-7.png)
![hertzbeat](/img/blog/monitor-linux-7.png)
5. 点击**监控历史详情TAB** 即可浏览 Linux 的历史监控指标数据图表📈。
![hertzbeat](/img/blog/monitor-linux-5.png)
![hertzbeat](/img/blog/monitor-linux-5.png)
![hertzbeat](/img/blog/monitor-linux-6.png)
![hertzbeat](/img/blog/monitor-linux-6.png)
**DONE!完成啦!不需要我们去部署agent或者各种繁琐操作,是不是很简单**
@ -132,35 +132,35 @@ Github: <https://github.com/apache/hertzbeat>
1. 对某个重要指标配置告警阈值
路径:菜单 -> 阈值规则 -> 新增阈值
路径:菜单 -> 阈值规则 -> 新增阈值
- 选择配置的指标对象,Linux 监控主要是cpu 内存 磁盘 网络性能等相关指标,我们举例对 `CPU利用率` `cpu` -> `usage` 这个指标进行阈值设置, 当Linux cpu利用率大于90%时发出告警。
- 这里我们就配置当此指标`cpu` 的 `usage>90` 时发出告警,告警级别为**警告告警**,三次即触发,具体如下图。
- 选择配置的指标对象,Linux 监控主要是cpu 内存 磁盘 网络性能等相关指标,我们举例对 `CPU利用率` `cpu` -> `usage` 这个指标进行阈值设置, 当Linux cpu利用率大于90%时发出告警。
- 这里我们就配置当此指标`cpu` 的 `usage>90` 时发出告警,告警级别为**警告告警**,三次即触发,具体如下图。
![hertzbeat](/img/blog/monitor-linux-8.png)
![hertzbeat](/img/blog/monitor-linux-8.png)
![hertzbeat](/img/blog/monitor-linux-9.png)
![hertzbeat](/img/blog/monitor-linux-9.png)
2. 新增消息通知接收人
> 配置接收人,让告警消息知道要发给谁,用什么方式发。
> 配置接收人,让告警消息知道要发给谁,用什么方式发。
路径:菜单 -> 告警通知 -> 告警接收人 -> 新增接收人
路径:菜单 -> 告警通知 -> 告警接收人 -> 新增接收人
消息通知方式支持 **邮件,钉钉,企业微信,飞书,WebHook,短信**等,我们这里以常用的钉钉为例。
消息通知方式支持 **邮件,钉钉,企业微信,飞书,WebHook,短信**等,我们这里以常用的钉钉为例。
- 参照此[帮助文档](https://hertzbeat.com/docs/help/alert_dingtalk) <https://hertzbeat.com/docs/help/alert_dingtalk> 在钉钉端配置机器人,设置安全自定义关键词`HertzBeat`,获取对应`access_token`值。
- 在 HertzBeat 配置接收人参数如下。
- 参照此[帮助文档](https://hertzbeat.com/docs/help/alert_dingtalk) <https://hertzbeat.com/docs/help/alert_dingtalk> 在钉钉端配置机器人,设置安全自定义关键词`HertzBeat`,获取对应`access_token`值。
- 在 HertzBeat 配置接收人参数如下。
【告警通知】->【新增接收人】 ->【选择钉钉机器人通知方式】->【设置钉钉机器人ACCESS_TOKEN】-> 【确定】
【告警通知】->【新增接收人】 ->【选择钉钉机器人通知方式】->【设置钉钉机器人ACCESS_TOKEN】-> 【确定】
![hertzbeat](/img/blog/alert-notice-1.png)
![hertzbeat](/img/blog/alert-notice-1.png)
3. 配置关联的告警通知策略⚠️ 【新增通知策略】-> 【将刚设置的接收人关联】-> 【确定】
> 配置告警通知策略,让告警消息与接收人绑定,这样就能决定哪些告警发给哪个人。
> 配置告警通知策略,让告警消息与接收人绑定,这样就能决定哪些告警发给哪个人。
![hertzbeat](/img/blog/alert-notice-2.png)
![hertzbeat](/img/blog/alert-notice-2.png)
### 完毕,现在坐等告警消息过来啦。叮叮叮叮

View File

@ -30,81 +30,81 @@ Github: <https://github.com/apache/hertzbeat>
1. 开启 SpringBoot Actuator Endpoint 暴露出`metrics health env`指标接口
```yaml
management:
endpoints:
web:
exposure:
include:
- 'metrics'
- 'health'
- 'env'
enabled-by-default: on
```
```yaml
management:
endpoints:
web:
exposure:
include:
- 'metrics'
- 'health'
- 'env'
enabled-by-default: on
```
2. 重启后测试访问指标接口 `ip:port/actuator` 是否有响应json数据如下:
```json
{
"_links": {
"self": {
"href": "http://localhost:1157/actuator",
"templated": false
},
"health-path": {
"href": "http://localhost:1157/actuator/health/{*path}",
"templated": true
},
"health": {
"href": "http://localhost:1157/actuator/health",
"templated": false
},
"env": {
"href": "http://localhost:1157/actuator/env",
"templated": false
},
"env-toMatch": {
"href": "http://localhost:1157/actuator/env/{toMatch}",
"templated": true
},
"metrics-requiredMetricName": {
"href": "http://localhost:1157/actuator/metrics/{requiredMetricName}",
"templated": true
},
"metrics": {
"href": "http://localhost:1157/actuator/metrics",
"templated": false
```json
{
"_links": {
"self": {
"href": "http://localhost:1157/actuator",
"templated": false
},
"health-path": {
"href": "http://localhost:1157/actuator/health/{*path}",
"templated": true
},
"health": {
"href": "http://localhost:1157/actuator/health",
"templated": false
},
"env": {
"href": "http://localhost:1157/actuator/env",
"templated": false
},
"env-toMatch": {
"href": "http://localhost:1157/actuator/env/{toMatch}",
"templated": true
},
"metrics-requiredMetricName": {
"href": "http://localhost:1157/actuator/metrics/{requiredMetricName}",
"templated": true
},
"metrics": {
"href": "http://localhost:1157/actuator/metrics",
"templated": false
}
}
}
}
}
```
```
#### 在开源监控系统 HertzBeat 监控页面添加对 SpringBoot2 应用监控
1. 点击新增 SpringBoot2 监控
路径:菜单 -> 应用服务监控 -> SpringBoot2 -> 新增SpringBoot2监控
路径:菜单 -> 应用服务监控 -> SpringBoot2 -> 新增SpringBoot2监控
![hertzbeat](/img/blog/monitor-springboot2-1.png)
![hertzbeat](/img/blog/monitor-springboot2-1.png)
2. 配置新增监控 SpringBoot2 所需参数
在监控页面填写 SpringBoot2应用 **对端IP**,**服务端口**(默认8080),**账户密码等**,最后点击确定添加即可。
其他参数如**采集间隔**,**超时时间**等可以参考帮助文档 <https://hertzbeat.com/docs/help/>
在监控页面填写 SpringBoot2应用 **对端IP**,**服务端口**(默认8080),**账户密码等**,最后点击确定添加即可。
其他参数如**采集间隔**,**超时时间**等可以参考帮助文档 <https://hertzbeat.com/docs/help/>
![hertzbeat](/img/blog/monitor-springboot2-2.png)
![hertzbeat](/img/blog/monitor-springboot2-2.png)
3. 完成✅,现在我们已经添加好对 SpringBoot2应用 的监控了,查看监控列表即可看到我们的添加项。
![hertzbeat](/img/blog/monitor-springboot2-3.png)
![hertzbeat](/img/blog/monitor-springboot2-3.png)
4. 点击监控列表项的**操作**->**监控详情图标** 即可浏览 SpringBoot2应用 的实时监控指标数据。
![hertzbeat](/img/blog/monitor-springboot2-4.png)
![hertzbeat](/img/blog/monitor-springboot2-4.png)
5. 点击**监控历史详情TAB** 即可浏览 SpringBoot2应用 的历史监控指标数据图表📈。
![hertzbeat](/img/blog/monitor-springboot2-5.png)
![hertzbeat](/img/blog/monitor-springboot2-5.png)
**DONE!完成啦!不需要我们去部署agent或者各种繁琐操作,是不是很简单**
@ -121,35 +121,35 @@ management:
1. 对某个重要指标配置告警阈值
路径:菜单 -> 阈值规则 -> 新增阈值
路径:菜单 -> 阈值规则 -> 新增阈值
- 选择配置的指标对象,SpringBoot2应用 监控主要是 堆栈内存 线程等相关指标,我们举例对 `状态线程数` `threads` -> `threads` 这个指标进行阈值设置, 当`runnable`状态的线程数量大于300时发出告警。
- 这里我们就配置当此指标`size`,`state` 的 `equals(state,"runnable"") && size>300` 时发出告警,告警级别为**警告告警**,三次即触发,具体如下图。
- 选择配置的指标对象,SpringBoot2应用 监控主要是 堆栈内存 线程等相关指标,我们举例对 `状态线程数` `threads` -> `threads` 这个指标进行阈值设置, 当`runnable`状态的线程数量大于300时发出告警。
- 这里我们就配置当此指标`size`,`state` 的 `equals(state,"runnable"") && size>300` 时发出告警,告警级别为**警告告警**,三次即触发,具体如下图。
![hertzbeat](/img/blog/monitor-springboot2-6.png)
![hertzbeat](/img/blog/monitor-springboot2-6.png)
![hertzbeat](/img/blog/monitor-springboot2-7.png)
![hertzbeat](/img/blog/monitor-springboot2-7.png)
2. 新增消息通知接收人
> 配置接收人,让告警消息知道要发给谁,用什么方式发。
> 配置接收人,让告警消息知道要发给谁,用什么方式发。
路径:菜单 -> 告警通知 -> 告警接收人 -> 新增接收人
路径:菜单 -> 告警通知 -> 告警接收人 -> 新增接收人
消息通知方式支持 **邮件,钉钉,企业微信,飞书,WebHook,短信**等,我们这里以常用的钉钉为例。
消息通知方式支持 **邮件,钉钉,企业微信,飞书,WebHook,短信**等,我们这里以常用的钉钉为例。
- 参照此[帮助文档](https://hertzbeat.com/docs/help/alert_dingtalk) <https://hertzbeat.com/docs/help/alert_dingtalk> 在钉钉端配置机器人,设置安全自定义关键词`HertzBeat`,获取对应`access_token`值。
- 在 HertzBeat 配置接收人参数如下。
- 参照此[帮助文档](https://hertzbeat.com/docs/help/alert_dingtalk) <https://hertzbeat.com/docs/help/alert_dingtalk> 在钉钉端配置机器人,设置安全自定义关键词`HertzBeat`,获取对应`access_token`值。
- 在 HertzBeat 配置接收人参数如下。
【告警通知】->【新增接收人】 ->【选择钉钉机器人通知方式】->【设置钉钉机器人ACCESS_TOKEN】-> 【确定】
【告警通知】->【新增接收人】 ->【选择钉钉机器人通知方式】->【设置钉钉机器人ACCESS_TOKEN】-> 【确定】
![hertzbeat](/img/blog/alert-notice-1.png)
![hertzbeat](/img/blog/alert-notice-1.png)
3. 配置关联的告警通知策略⚠️ 【新增通知策略】-> 【将刚设置的接收人关联】-> 【确定】
> 配置告警通知策略,让告警消息与接收人绑定,这样就能决定哪些告警发给哪个人。
> 配置告警通知策略,让告警消息与接收人绑定,这样就能决定哪些告警发给哪个人。
![hertzbeat](/img/blog/alert-notice-2.png)
![hertzbeat](/img/blog/alert-notice-2.png)
### 完毕,现在坐等告警消息过来啦。叮叮叮叮

View File

@ -43,16 +43,16 @@ Cloud: **[TanCloud](https://console.tancloud.cn/)**
1. Docker 安装 GreptimeDB
```shell
$ 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:4000 \
--rpc-addr 0.0.0.0:4001
```
```shell
$ 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:4000 \
--rpc-addr 0.0.0.0:4001
```
- `-v "$(pwd)/greptimedb:/tmp/greptimedb"` 为 greptimeDB 数据目录本地持久化挂载,建议将`$(pwd)/greptimedb`替换为您想指定存放的实际本地目录
- `-v "$(pwd)/greptimedb:/tmp/greptimedb"` 为 greptimeDB 数据目录本地持久化挂载,建议将`$(pwd)/greptimedb`替换为您想指定存放的实际本地目录
2. 使用```$ docker ps | grep greptime```查看 GreptimeDB 是否启动成功
@ -62,21 +62,21 @@ $ docker run -p 4000-4004:4000-4004 \
1. Docker 安装 HertzBeat
```shell
$ 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
```
```shell
$ 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` : (可选,数据持久化)重要⚠️ 挂载H2数据库文件到本地主机,保证数据不会因为容器的创建删除而丢失
- `-v /opt/data:/opt/hertzbeat/data` : (可选,数据持久化)重要⚠️ 挂载H2数据库文件到本地主机,保证数据不会因为容器的创建删除而丢失
- `-v /opt/application.yml:/opt/hertzbeat/config/application.yml` : 挂载自定义本地配置文件到容器中,即使用本地配置文件覆盖容器配置文件。
- `-v /opt/application.yml:/opt/hertzbeat/config/application.yml` : 挂载自定义本地配置文件到容器中,即使用本地配置文件覆盖容器配置文件。
注意⚠️ 本地挂载配置文件 `application.yml` 需提前存在,文件完整内容见项目仓库[/script/application.yml](https://github.com/apache/hertzbeat/raw/master/script/application.yml)
注意⚠️ 本地挂载配置文件 `application.yml` 需提前存在,文件完整内容见项目仓库[/script/application.yml](https://github.com/apache/hertzbeat/raw/master/script/application.yml)
2. 浏览器访问 <http://ip:1157/> 默认账户密码 admin/hertzbeat,查看 HertzBeat 是否启动成功。
@ -84,26 +84,26 @@ $ docker run -d -p 1157:1157 \
1. 修改 HertzBeat 端配置文件
修改挂载到本地的 HertzBeat 配置文件 [application.yml](https://github.com/apache/hertzbeat/raw/master/script/application.yml), 安装包模式下修改 `hertzbeat/config/application.yml`
修改挂载到本地的 HertzBeat 配置文件 [application.yml](https://github.com/apache/hertzbeat/raw/master/script/application.yml), 安装包模式下修改 `hertzbeat/config/application.yml`
**修改里面的`warehouse.store.jpa.enabled`参数为`false`, 配置里面的`warehouse.store.greptime`数据源参数,URL账户密码,并启用`enabled`为`true`**
**修改里面的`warehouse.store.jpa.enabled`参数为`false`, 配置里面的`warehouse.store.greptime`数据源参数,URL账户密码,并启用`enabled`为`true`**
```yaml
warehouse:
store:
# 关闭默认JPA
jpa:
enabled: false
greptime:
enabled: true
endpoint: localhost:4001
```
```yaml
warehouse:
store:
# 关闭默认JPA
jpa:
enabled: false
greptime:
enabled: true
endpoint: localhost:4001
```
2. 重启 HertzBeat
```shell
docker restart hertzbeat
```
```shell
docker restart hertzbeat
```
#### 观察验证效果

View File

@ -77,23 +77,23 @@ HertzBeat 提供云边协同能力,可以在多个隔离网络部署边缘采
1. `docker` 环境仅需一条命令即可开始
```docker run -d -p 1157:1157 -p 1158:1158 --name hertzbeat apache/hertzbeat```
```docker run -d -p 1157:1157 -p 1158:1158 --name hertzbeat apache/hertzbeat```
```或者使用 quay.io (若 dockerhub 网络链接超时)```
```或者使用 quay.io (若 dockerhub 网络链接超时)```
```docker run -d -p 1157:1157 -p 1158:1158 --name hertzbeat quay.io/tancloud/hertzbeat```
```docker run -d -p 1157:1157 -p 1158:1158 --name hertzbeat quay.io/tancloud/hertzbeat```
2. 浏览器访问 `http://localhost:1157` 即可开始,默认账号密码 `admin/hertzbeat`
3. 部署采集器集群
```
docker run -d -e IDENTITY=custom-collector-name -e MANAGER_HOST=127.0.0.1 -e MANAGER_IP=1158 --name hertzbeat-collector apache/hertzbeat-collector
```
```shell
docker run -d -e IDENTITY=custom-collector-name -e MANAGER_HOST=127.0.0.1 -e MANAGER_IP=1158 --name hertzbeat-collector apache/hertzbeat-collector
```
- `-e IDENTITY=custom-collector-name` : 配置此采集器的唯一性标识符名称,多个采集器名称不能相同,建议自定义英文名称。
- `-e MANAGER_IP=127.0.0.1` : 配置连接主HertzBeat服务的对外IP。
- `-e MANAGER_PORT=1158` : 配置连接主HertzBeat服务的对外端口,默认1158。
- `-e IDENTITY=custom-collector-name` : 配置此采集器的唯一性标识符名称,多个采集器名称不能相同,建议自定义英文名称。
- `-e MANAGER_IP=127.0.0.1` : 配置连接主HertzBeat服务的对外IP。
- `-e MANAGER_PORT=1158` : 配置连接主HertzBeat服务的对外端口,默认1158。
更多配置详细步骤参考 [通过Docker方式安装HertzBeat](https://hertzbeat.com/docs/start/docker-deploy)

View File

@ -70,23 +70,23 @@ keywords: [open source monitoring system, alerting system, Linux monitoring]
1. `docker` 环境仅需一条命令即可开始
```docker run -d -p 1157:1157 -p 1158:1158 --name hertzbeat apache/hertzbeat```
```docker run -d -p 1157:1157 -p 1158:1158 --name hertzbeat apache/hertzbeat```
```或者使用 quay.io (若 dockerhub 网络链接超时)```
```或者使用 quay.io (若 dockerhub 网络链接超时)```
```docker run -d -p 1157:1157 -p 1158:1158 --name hertzbeat quay.io/tancloud/hertzbeat```
```docker run -d -p 1157:1157 -p 1158:1158 --name hertzbeat quay.io/tancloud/hertzbeat```
2. 浏览器访问 `http://localhost:1157` 即可开始,默认账号密码 `admin/hertzbeat`
3. 部署采集器集群
```
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
```
```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` : 配置此采集器的唯一性标识符名称,多个采集器名称不能相同,建议自定义英文名称。
- `-e MANAGER_HOST=127.0.0.1` : 配置连接主HertzBeat服务的对外IP。
- `-e MANAGER_PORT=1158` : 配置连接主HertzBeat服务的对外端口,默认1158。
- `-e IDENTITY=custom-collector-name` : 配置此采集器的唯一性标识符名称,多个采集器名称不能相同,建议自定义英文名称。
- `-e MANAGER_HOST=127.0.0.1` : 配置连接主HertzBeat服务的对外IP。
- `-e MANAGER_PORT=1158` : 配置连接主HertzBeat服务的对外端口,默认1158。
更多配置详细步骤参考 [通过Docker方式安装HertzBeat](https://hertzbeat.com/docs/start/docker-deploy)

View File

@ -47,23 +47,23 @@ keywords: [open source monitoring system, alerting system, Linux monitoring]
1. `docker` 环境仅需一条命令即可开始
```docker run -d -p 1157:1157 -p 1158:1158 --name hertzbeat apache/hertzbeat```
```docker run -d -p 1157:1157 -p 1158:1158 --name hertzbeat apache/hertzbeat```
```或者使用 quay.io (若 dockerhub 网络链接超时)```
```或者使用 quay.io (若 dockerhub 网络链接超时)```
```docker run -d -p 1157:1157 -p 1158:1158 --name hertzbeat quay.io/tancloud/hertzbeat```
```docker run -d -p 1157:1157 -p 1158:1158 --name hertzbeat quay.io/tancloud/hertzbeat```
2. 浏览器访问 `http://localhost:1157` 即可开始,默认账号密码 `admin/hertzbeat`
3. 部署采集器集群
```
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
```
```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` : 配置此采集器的唯一性标识符名称,多个采集器名称不能相同,建议自定义英文名称。
- `-e MANAGER_HOST=127.0.0.1` : 配置连接主HertzBeat服务的对外IP。
- `-e MANAGER_PORT=1158` : 配置连接主HertzBeat服务的对外端口,默认1158。
- `-e IDENTITY=custom-collector-name` : 配置此采集器的唯一性标识符名称,多个采集器名称不能相同,建议自定义英文名称。
- `-e MANAGER_HOST=127.0.0.1` : 配置连接主HertzBeat服务的对外IP。
- `-e MANAGER_PORT=1158` : 配置连接主HertzBeat服务的对外端口,默认1158。
更多配置详细步骤参考 [通过Docker方式安装HertzBeat](https://hertzbeat.com/docs/start/docker-deploy)

View File

@ -42,23 +42,23 @@ keywords: [open source monitoring system, alerting system]
1. `docker` 环境仅需一条命令即可开始
```docker run -d -p 1157:1157 -p 1158:1158 --name hertzbeat apache/hertzbeat```
```docker run -d -p 1157:1157 -p 1158:1158 --name hertzbeat apache/hertzbeat```
```或者使用 quay.io (若 dockerhub 网络链接超时)```
```或者使用 quay.io (若 dockerhub 网络链接超时)```
```docker run -d -p 1157:1157 -p 1158:1158 --name hertzbeat quay.io/tancloud/hertzbeat```
```docker run -d -p 1157:1157 -p 1158:1158 --name hertzbeat quay.io/tancloud/hertzbeat```
2. 浏览器访问 `http://localhost:1157` 即可开始,默认账号密码 `admin/hertzbeat`
3. 部署采集器集群
```
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
```
```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` : 配置此采集器的唯一性标识符名称,多个采集器名称不能相同,建议自定义英文名称。
- `-e MANAGER_HOST=127.0.0.1` : 配置连接主HertzBeat服务的对外IP。
- `-e MANAGER_PORT=1158` : 配置连接主HertzBeat服务的对外端口,默认1158。
- `-e IDENTITY=custom-collector-name` : 配置此采集器的唯一性标识符名称,多个采集器名称不能相同,建议自定义英文名称。
- `-e MANAGER_HOST=127.0.0.1` : 配置连接主HertzBeat服务的对外IP。
- `-e MANAGER_PORT=1158` : 配置连接主HertzBeat服务的对外端口,默认1158。
更多配置详细步骤参考 [通过Docker方式安装HertzBeat](https://hertzbeat.com/docs/start/docker-deploy)

View File

@ -43,23 +43,23 @@ keywords: [open source monitoring system, alerting system]
1. `docker` 环境仅需一条命令即可开始
```docker run -d -p 1157:1157 -p 1158:1158 --name hertzbeat apache/hertzbeat```
```docker run -d -p 1157:1157 -p 1158:1158 --name hertzbeat apache/hertzbeat```
```或者使用 quay.io (若 dockerhub 网络链接超时)```
```或者使用 quay.io (若 dockerhub 网络链接超时)```
```docker run -d -p 1157:1157 -p 1158:1158 --name hertzbeat quay.io/tancloud/hertzbeat```
```docker run -d -p 1157:1157 -p 1158:1158 --name hertzbeat quay.io/tancloud/hertzbeat```
2. 浏览器访问 `http://localhost:1157` 即可开始,默认账号密码 `admin/hertzbeat`
3. 部署采集器集群
```
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
```
```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` : 配置此采集器的唯一性标识符名称,多个采集器名称不能相同,建议自定义英文名称。
- `-e MANAGER_HOST=127.0.0.1` : 配置连接主HertzBeat服务的对外IP。
- `-e MANAGER_PORT=1158` : 配置连接主HertzBeat服务的对外端口,默认1158。
- `-e IDENTITY=custom-collector-name` : 配置此采集器的唯一性标识符名称,多个采集器名称不能相同,建议自定义英文名称。
- `-e MANAGER_HOST=127.0.0.1` : 配置连接主HertzBeat服务的对外IP。
- `-e MANAGER_PORT=1158` : 配置连接主HertzBeat服务的对外端口,默认1158。
更多配置详细步骤参考 [通过Docker方式安装HertzBeat](https://hertzbeat.com/docs/start/docker-deploy)

View File

@ -81,10 +81,7 @@
**要求:**
1. 使⽤ Java 基于 UDP 协议实现原⽣的 IPMI2 协议(查询部分),不依赖任何第三⽅包。
2. 利⽤实现的 IPMI2 协议查询开启 IPMI 的服务器的各项指标信息,包括主板信息、⽹卡信息、电源信息、⻛扇信
息、温度传感器信息和时钟信息。
2. 利⽤实现的 IPMI2 协议查询开启 IPMI 的服务器的各项指标信息,包括主板信息、⽹卡信息、电源信息、⻛扇信息、温度传感器信息和时钟信息。
3. 对查询到的指标信息进⾏抽象和规范化处理,实现配置化管理(可选)。
4. 输出详细的项⽬⽂档,包括设计思路、实现细节、使⽤说明等。

View File

@ -8,184 +8,184 @@
1. 升级Java环境
由于1.6.0版本使用Java17,且安装包不再提供内置jdk的版本,参考以下情况使用新版Hertzbeat。
由于1.6.0版本使用Java17,且安装包不再提供内置jdk的版本,参考以下情况使用新版Hertzbeat。
- 当你的服务器中默认环境变量为Java17时,这一步你无需任何操作。
- 当你的服务器中默认环境变量不为Java17时,如Java8、Java11,若你服务器中**没有**其他应用需要低版本Java,根据你的系统,到 [https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html](https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html) 选择相应的发行版下载,并在搜索引擎搜索如何设置新的环境变量指向新的Java17。
- 当你的服务器中默认环境变量不为Java17时,如Java8、Java11,若你服务器中**有**其他应用需要低版本Java,根据你的系统,到 [https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html](https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html) 选择相应的发行版下载,并将解压后的文件夹重命名为java,复制到Hertzbeat的解压目录下。
- 当你的服务器中默认环境变量为Java17时,这一步你无需任何操作。
- 当你的服务器中默认环境变量不为Java17时,如Java8、Java11,若你服务器中**没有**其他应用需要低版本Java,根据你的系统,到 [https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html](https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html) 选择相应的发行版下载,并在搜索引擎搜索如何设置新的环境变量指向新的Java17。
- 当你的服务器中默认环境变量不为Java17时,如Java8、Java11,若你服务器中**有**其他应用需要低版本Java,根据你的系统,到 [https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html](https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html) 选择相应的发行版下载,并将解压后的文件夹重命名为java,复制到Hertzbeat的解压目录下。
2. 升级数据库
打开[https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/db/migration](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/db/migration),
选择你使用的数据库的目录下相应的 `V160__update_column.sql`文件执行升级sql。
打开[https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/db/migration](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/db/migration),
选择你使用的数据库的目录下相应的 `V160__update_column.sql`文件执行升级sql。
3. 升级配置文件
由于 `application.yml``sureness.yml`更新变动较大,建议直接使用新的yml配置文件,然后在自己的需求基础上进行修改。
由于 `application.yml``sureness.yml`更新变动较大,建议直接使用新的yml配置文件,然后在自己的需求基础上进行修改。
- `application.yml`一般需要修改以下部分
- `application.yml`一般需要修改以下部分
默认为:
默认为:
```yaml
datasource:
driver-class-name: org.h2.Driver
username: sa
password: 123456
url: jdbc:h2:./data/hertzbeat;MODE=MYSQL
hikari:
max-lifetime: 120000
```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
```
jpa:
show-sql: false
database-platform: org.eclipse.persistence.platform.database.MySQLPlatform
database: h2
properties:
eclipselink:
logging:
level: SEVERE
```
如若修改为mysql数据库,给出一个示例:
如若修改为mysql数据库,给出一个示例:
```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
```
```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
- `sureness.yml`修改是可选的,一般在你需要修改账号密码时
jpa:
show-sql: false
database-platform: org.eclipse.persistence.platform.database.MySQLPlatform
database: mysql
properties:
eclipselink:
logging:
level: SEVERE
```
- `sureness.yml`修改是可选的,一般在你需要修改账号密码时
```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]
```
```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]
```
4. 添加相应的数据库驱动
由于apache基金会对于license合规的要求,HertzBeat的安装包不能包含mysql,oracle等gpl许可的依赖,需要用户自行添加,用户可通过以下链接自行下载驱动,复制到安装目录下`ext-lib`中。
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.18.zip)
oracle(如果你要监控oracle,这两个驱动是必须的)
[https://download.oracle.com/otn-pub/otn_software/jdbc/234/ojdbc8.jar](https://download.oracle.com/otn-pub/otn_software/jdbc/234/ojdbc8.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?utm_source=mavenlibs.com)
接下来,像之前那样运行启动脚本,即可体验最新的HertzBeat1.6.0!
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.18.zip)
oracle(如果你要监控oracle,这两个驱动是必须的):
[https://download.oracle.com/otn-pub/otn_software/jdbc/234/ojdbc8.jar](https://download.oracle.com/otn-pub/otn_software/jdbc/234/ojdbc8.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?utm_source=mavenlibs.com)
接下来,像之前那样运行启动脚本,即可体验最新的HertzBeat1.6.0!
### Docker 方式升级 - Mysql数据库
1. 关闭 HertzBeat 容器
```
docker stop hertzbeat
```
```shell
docker stop hertzbeat
```
2. 升级数据库脚本
打开[https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/db/migration](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/db/migration),
选择你使用的数据库的目录下相应的 `V160__update_column.sql`文件在 Mysql 执行升级sql。
打开[https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/db/migration](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/db/migration),
选择你使用的数据库的目录下相应的 `V160__update_column.sql`文件在 Mysql 执行升级sql。
3. 升级配置文件
由于 `application.yml``sureness.yml`更新变动较大,建议直接挂载使用新的yml配置文件,然后在自己的需求基础上进行修改。
由于 `application.yml``sureness.yml`更新变动较大,建议直接挂载使用新的yml配置文件,然后在自己的需求基础上进行修改。
- `application.yml`一般需要修改以下部分
- `application.yml`一般需要修改以下部分
默认为:
默认为:
```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
```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
```
jpa:
show-sql: false
database-platform: org.eclipse.persistence.platform.database.MySQLPlatform
database: mysql
properties:
eclipselink:
logging:
level: SEVERE
```
- `sureness.yml`修改是可选的,一般在你需要修改账号密码时
- `sureness.yml`修改是可选的,一般在你需要修改账号密码时
```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]
```
```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]
```
4. 添加相应的数据库驱动
由于apache基金会对于license合规的要求,HertzBeat的安装包不能包含mysql,oracle等gpl许可的依赖,需要用户自行添加,用户可通过以下链接自行下载驱动 jar 放到本地 `ext-lib`目录下,然后启动时将`ext-lib`挂载到容器的 `/opt/hertzbeat/ext-lib`目录。
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.18.zip)
oracle(如果你要监控oracle,这两个驱动是必须的)
[https://download.oracle.com/otn-pub/otn_software/jdbc/234/ojdbc8.jar](https://download.oracle.com/otn-pub/otn_software/jdbc/234/ojdbc8.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?utm_source=mavenlibs.com)
接下来,像之前那样 Docker 运行启动 HertzBeat,即可体验最新的HertzBeat1.6.0!
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.18.zip)
oracle(如果你要监控oracle,这两个驱动是必须的):
[https://download.oracle.com/otn-pub/otn_software/jdbc/234/ojdbc8.jar](https://download.oracle.com/otn-pub/otn_software/jdbc/234/ojdbc8.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?utm_source=mavenlibs.com)
接下来,像之前那样 Docker 运行启动 HertzBeat,即可体验最新的HertzBeat1.6.0!
### Docker安装升级 - H2内置数据库(生产环境不推荐使用H2)
1. 关闭 HertzBeat 容器
```
docker stop hertzbeat
```
```shell
docker stop hertzbeat
```
2. 编辑H2数据库文件
@ -193,75 +193,75 @@ docker stop hertzbeat
下载 h2 驱动 jar [https://mvnrepository.com/artifact/com.h2database/h2/2.2.220](https://mvnrepository.com/artifact/com.h2database/h2/2.2.220)
使用 h2 驱动 jar 本地启动数据库
```
java -jar h2-2.2.220.jar -url jdbc:h2:file:./hertzbeat -user sa -password 123456
```
```shell
java -jar h2-2.2.220.jar -url jdbc:h2:file:./hertzbeat -user sa -password 123456
```
打开[https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/db/migration](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/db/migration),
选择你使用的数据库的目录下相应的 `V160__update_column.sql`文件在 H2 执行升级sql。
打开[https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/db/migration](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/db/migration),
选择你使用的数据库的目录下相应的 `V160__update_column.sql`文件在 H2 执行升级sql。
3. 升级配置文件
由于 `application.yml``sureness.yml`更新变动较大,建议直接挂载使用新的yml配置文件,然后在自己的需求基础上进行修改。
由于 `application.yml``sureness.yml`更新变动较大,建议直接挂载使用新的yml配置文件,然后在自己的需求基础上进行修改。
- `application.yml`一般需要修改以下部分
- `application.yml`一般需要修改以下部分
默认为:
默认为:
```yaml
datasource:
driver-class-name: org.h2.Driver
username: sa
password: 123456
url: jdbc:h2:./data/hertzbeat;MODE=MYSQL
hikari:
max-lifetime: 120000
```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
```
jpa:
show-sql: false
database-platform: org.eclipse.persistence.platform.database.MySQLPlatform
database: h2
properties:
eclipselink:
logging:
level: SEVERE
```
- `sureness.yml`修改是可选的,一般在你需要修改账号密码时
- `sureness.yml`修改是可选的,一般在你需要修改账号密码时
```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]
```
```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]
```
4. 添加相应的数据库驱动
由于apache基金会对于license合规的要求,HertzBeat的安装包不能包含mysql,oracle等gpl许可的依赖,需要用户自行添加,用户可通过以下链接自行下载驱动 jar 放到本地 `ext-lib`目录下,然后启动时将`ext-lib`挂载到容器的 `/opt/hertzbeat/ext-lib`目录。
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.18.zip)
oracle(如果你要监控oracle,这两个驱动是必须的)
[https://download.oracle.com/otn-pub/otn_software/jdbc/234/ojdbc8.jar](https://download.oracle.com/otn-pub/otn_software/jdbc/234/ojdbc8.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?utm_source=mavenlibs.com)
接下来,像之前那样 Docker 运行启动,即可体验最新的HertzBeat1.6.0!
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.18.zip)
oracle(如果你要监控oracle,这两个驱动是必须的)
[https://download.oracle.com/otn-pub/otn_software/jdbc/234/ojdbc8.jar](https://download.oracle.com/otn-pub/otn_software/jdbc/234/ojdbc8.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?utm_source=mavenlibs.com)
接下来,像之前那样 Docker 运行启动,即可体验最新的HertzBeat1.6.0!
### 通过导出导入升级

View File

@ -208,9 +208,9 @@ limitations under the License.
2. 确保代码的可读性和直观性
- `annotation` 符号中的字符串不需要提取为常量。
- `annotation` 符号中的字符串不需要提取为常量。
- 被引用的 `package``resource` 名称不需要提取为常量。
- 被引用的 `package``resource` 名称不需要提取为常量。
3. 未被重新分配的变量也必须声明为 <mark> final </mark> 类型。
@ -252,17 +252,17 @@ limitations under the License.
- 如果使用 `HashSet`,则返回 <mark> Set </mark>
2. 如果存在多线程,可以使用以下声明或返回类型:
```java
private CurrentHashMap map;
public CurrentHashMap funName();
```
```java
private CurrentHashMap map;
public CurrentHashMap funName();
```
3. 使用 `isEmpty()` 而不是 `length() == 0` 或者 `size() == 0`
- 负面示例:
```java
if (pathPart.length() == 0) {
return;
return;
}
```
@ -270,7 +270,7 @@ public CurrentHashMap funName();
```java
if (pathPart.isEmpty()) {
return;
return;
}
```
@ -297,89 +297,88 @@ public CurrentHashMap funName();
以减少代码行深度并提高可读性,例如:
- 联合或将逻辑合并到下一级调用中
- 负面示例:
- 负面示例:
```java
if (isInsert) {
save(platform);
} else {
updateById(platform);
}
```
```java
if (isInsert) {
save(platform);
} else {
updateById(platform);
}
```
- 正面示例:
- 正面示例:
```java
saveOrUpdate(platform);
```
```java
saveOrUpdate(platform);
```
- 合并条件
- 负面示例:
- 负面示例:
```java
if (expression1) {
if(expression2) {
......
}
}
```java
if (expression1) {
if(expression2) {
// ......
}
}
```
```
- 正面示例:
- 正面示例:
```java
if (expression1 && expression2) {
......
}
```
```java
if (expression1 && expression2) {
// ......
}
```
- 反转条件
- 负面示例:
- 负面示例:
```java
public void doSomething() {
// 忽略更深的代码块行
// .....
if (condition1) {
...
} else {
...
}
}
```
```java
public void doSomething() {
// 忽略更深的代码块行
// .....
if (condition1) {
// ...
} else {
// ...
}
}
```
- 正面示例:
- 正面示例:
```java
public void doSomething() {
// 忽略更深的代码块行
// .....
if (!condition1) {
...
return;
}
// ...
}
```
```java
public void doSomething() {
// 忽略更深的代码块行
// .....
if (!condition1) {
// ...
return;
}
// ...
}
```
- 使用单一变量或方法减少复杂的条件表达式
- 负面示例:
- 负面示例:
```java
if (dbType.indexOf("sqlserver") >= 0 || dbType.indexOf("sql server") >= 0) {
...
}
```
```java
if (dbType.indexOf("sqlserver") >= 0 || dbType.indexOf("sql server") >= 0) {
// ...
}
```
- 正面示例:
- 正面示例:
```java
if (containsSqlServer(dbType)) {
....
}
//.....
// containsSqlServer的定义
```
```java
if (containsSqlServer(dbType)) {
// ....
}
//.....
// containsSqlServer的定义
```
> 在未来,使用 `sonarlint``better highlights` 检查代码深度看起来是个不错的选择。
@ -387,20 +386,20 @@ if(expression2) {
1. 方法缺少注释:
- `When`:该方法何时可以被调用
- `How`:如何使用此方法以及如何传递参数等
- `What`:此方法实现了哪些功能
- `Note`:在调用此方法时开发人员应注意什么
- `When`:该方法何时可以被调用
- `How`:如何使用此方法以及如何传递参数等
- `What`:此方法实现了哪些功能
- `Note`:在调用此方法时开发人员应注意什么
2. 缺少必要的类头部描述注释。
添加 `What`,`Note` 等,如上述 `1` 中提到的。
添加 `What`,`Note` 等,如上述 `1` 中提到的。
3. 在接口中的方法声明必须被注释。
- 如果实现的语义和接口声明的注释内容不一致,则具体的实现方法也需要用注释重写。
- 如果实现的语义和接口声明的注释内容不一致,则具体的实现方法也需要用注释重写。
- 如果方法实现的语义与接口声明的注释内容一致,则建议不写注释以避免重复的注释。
- 如果方法实现的语义与接口声明的注释内容一致,则建议不写注释以避免重复的注释。
4. 在注释行中的第一个词需要大写,如 `param` 行,`return` 行。
如果特殊引用作为主题不需要大写,需要注意特殊符号,例如引号。
@ -410,31 +409,31 @@ if(expression2) {
1. 更倾向于使用 `non-capturing` lambda(不包含对外部范围的引用的lambda)。
Capturing lambda 在每次调用时都需要创建一个新的对象实例。`Non-capturing` lambda 可以为每次调用使用相同的实例。
- 负面示例:
- 负面示例:
```java
map.computeIfAbsent(key, x -> key.toLowerCase())
```
```java
map.computeIfAbsent(key, x -> key.toLowerCase())
```
- 正面示例:
- 正面示例:
```java
map.computeIfAbsent(key, k -> k.toLowerCase());
```
```java
map.computeIfAbsent(key, k -> k.toLowerCase());
```
2. 考虑使用方法引用而不是内联lambda
- 负面示例:
- 负面示例:
```java
map.computeIfAbsent(key, k-> Loader.load(k));
```
```java
map.computeIfAbsent(key, k-> Loader.load(k));
```
- 正面示例:
- 正面示例:
```java
map.computeIfAbsent(key, Loader::load);
```
```java
map.computeIfAbsent(key, Loader::load);
```
### 3.9 Java Streams
@ -452,127 +451,127 @@ if(expression2) {
1. 使用 `StringUtils.isBlank` 而不是 `StringUtils.isEmpty`
- 负面示例:
- 负面示例:
```java
if (StringUtils.isEmpty(name)) {
return;
}
```
```java
if (StringUtils.isEmpty(name)) {
return;
}
```
- 正面示例:
- 正面示例:
```java
if (StringUtils.isBlank(name)) {
return;
}
```
```java
if (StringUtils.isBlank(name)) {
return;
}
```
2. 使用 `StringUtils.isNotBlank` 而不是 `StringUtils.isNotEmpty`
- 负面示例:
- 负面示例:
```java
if (StringUtils.isNotEmpty(name)) {
return;
}
```
```java
if (StringUtils.isNotEmpty(name)) {
return;
}
```
- 正面示例:
- 正面示例:
```java
if (StringUtils.isNotBlank(name)) {
return;
}
```
```java
if (StringUtils.isNotBlank(name)) {
return;
}
```
3. 使用 `StringUtils.isAllBlank` 而不是 `StringUtils.isAllEmpty`
- 负面示例:
- 负面示例:
```java
if (StringUtils.isAllEmpty(name, age)) {
return;
}
```
```java
if (StringUtils.isAllEmpty(name, age)) {
return;
}
```
- 正面示例:
- 正面示例:
```java
if (StringUtils.isAllBlank(name, age)) {
return;
}
```
```java
if (StringUtils.isAllBlank(name, age)) {
return;
}
```
### 3.12 `Enum`
1. 枚举值比较
- 负面示例:
- 负面示例:
```java
if (status.equals(JobStatus.RUNNING)) {
return;
}
```
```java
if (status.equals(JobStatus.RUNNING)) {
return;
}
```
- 正面示例:
- 正面示例:
```java
if (status == JobStatus.RUNNING) {
return;
}
```
```java
if (status == JobStatus.RUNNING) {
return;
}
```
2. 枚举类不需要实现 Serializable
- 负面示例:
- 负面示例:
```java
public enum JobStatus implements Serializable {
...
}
```
```java
public enum JobStatus implements Serializable {
// ...
}
```
- 正面示例:
- 正面示例:
```java
public enum JobStatus {
...
}
```
```java
public enum JobStatus {
// ...
}
```
3. 使用 `Enum.name()` 而不是 `Enum.toString()`
- 负面示例:
- 负面示例:
```java
System.out.println(JobStatus.RUNNING.toString());
```
```java
System.out.println(JobStatus.RUNNING.toString());
```
- 正面示例:
- 正面示例:
```java
System.out.println(JobStatus.RUNNING.name());
```
```java
System.out.println(JobStatus.RUNNING.name());
```
4. 枚举类名称统一使用 Enum 后缀
- 负面示例:
- 负面示例:
```java
public enum JobStatus {
...
}
```
```java
public enum JobStatus {
// ...
}
```
- 正面示例:
- 正面示例:
```java
public enum JobStatusEnum {
...
}
```
```java
public enum JobStatusEnum {
// ...
}
```
### 3.13 `Deprecated` 注解
@ -581,7 +580,7 @@ if(expression2) {
```java
@deprecated
public void process(String input) {
...
// ...
}
```
@ -590,7 +589,7 @@ public void process(String input) {
```java
@Deprecated
public void process(String input) {
...
// ...
}
```
@ -598,43 +597,43 @@ public void process(String input) {
1. 使用 `占位符` 进行日志输出:
- 负面示例
- 负面示例
```java
log.info("Deploy cluster request " + deployRequest);
```
```java
log.info("Deploy cluster request " + deployRequest);
```
- 正面示例
- 正面示例
```java
log.info("load plugin:{} to {}", file.getName(), appPlugins);
```
```java
log.info("load plugin:{} to {}", file.getName(), appPlugins);
```
2. 打印日志时,注意选择 `日志级别`
当打印日志内容时,如果传递了日志占位符的实际参数,必须避免过早评估,以避免由日志级别导致的不必要评估。
当打印日志内容时,如果传递了日志占位符的实际参数,必须避免过早评估,以避免由日志级别导致的不必要评估。
- 负面示例:
- 负面示例:
假设当前日志级别为 `INFO`
假设当前日志级别为 `INFO`
```java
// 忽略声明行。
List<User> userList = getUsersByBatch(1000);
LOG.debug("All users: {}", getAllUserIds(userList));
```
```java
// 忽略声明行。
List<User> userList = getUsersByBatch(1000);
LOG.debug("All users: {}", getAllUserIds(userList));
```
- 正面示例:
- 正面示例:
在这种情况下,我们应该在进行实际的日志调用之前提前确定日志级别,如下所示:
在这种情况下,我们应该在进行实际的日志调用之前提前确定日志级别,如下所示:
```java
// 忽略声明行。
List<User> userList = getUsersByBatch(1000);
if (LOG.isDebugEnabled()) {
LOG.debug("All ids of users: {}", getAllIDsOfUsers(userList));
}
```
```java
// 忽略声明行。
List<User> userList = getUsersByBatch(1000);
if (LOG.isDebugEnabled()) {
LOG.debug("All ids of users: {}", getAllIDsOfUsers(userList));
}
```
## 5 测试

View File

@ -88,33 +88,33 @@ limitations under the License.
1. 首先您需要 Fork 目标仓库 [hertzbeat repository](https://github.com/apache/hertzbeat).
2. 然后 用 git 命令 将代码下载到本地:
```shell
git clone git@github.com:${YOUR_USERNAME}/hertzbeat.git #Recommended
```
```shell
git clone git@github.com:${YOUR_USERNAME}/hertzbeat.git #Recommended
```
3. 下载完成后,请参考目标仓库的入门指南或者 README 文件对项目进行初始化。
4. 接着,您可以参考如下命令进行代码的提交, 切换新的分支, 进行开发:
```shell
git checkout -b a-feature-branch #Recommended
```
```shell
git checkout -b a-feature-branch #Recommended
```
5. 提交 commit, commit 描述信息需要符合约定格式: [module name or type name]feature or bugfix or doc: custom message.
```shell
git add <modified file/path>
git commit -m '[docs]feature: necessary instructions' #Recommended
```
```shell
git add <modified file/path>
git commit -m '[docs]feature: necessary instructions' #Recommended
```
6. 推送到远程仓库
```shell
git push origin a-feature-branch
```
```shell
git push origin a-feature-branch
```
7. 然后您就可以在 GitHub 上发起新的 PR (Pull Request)。
请注意 PR 的标题需要符合我们的规范,并且在 PR 中写上必要的说明,来方便 Committer 和其他贡献者进行代码审查。
请注意 PR 的标题需要符合我们的规范,并且在 PR 中写上必要的说明,来方便 Committer 和其他贡献者进行代码审查。
### 等待PR代码被合并

View File

@ -348,73 +348,73 @@ hi, i accept. Thanks for invitaion.
1. 下载iCLA申请表
打开访问:[https://www.apache.org/licenses/#clas](https://www.apache.org/licenses/#clas)
打开访问:[https://www.apache.org/licenses/#clas](https://www.apache.org/licenses/#clas)
找到`CLAs`点击进入页面
找到`CLAs`点击进入页面
![](/img/docs/community/clas-web.png)
![](/img/docs/community/clas-web.png)
找到`ICLA(个人贡献者许可协议)`,点击[Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf)
找到`ICLA(个人贡献者许可协议)`,点击[Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf)
![](/img/docs/community/icla-web.png)
![](/img/docs/community/icla-web.png)
跳转后,会显示需要签署的协议,这里可以在网页上直接填写,也可以下载后填写。
跳转后,会显示需要签署的协议,这里可以在网页上直接填写,也可以下载后填写。
![](/img/docs/community/icla-pdf.png)
![](/img/docs/community/icla-pdf.png)
2. 填写iCLA
> tips: 签名时需要手写签名,其他的可以直接填写后打印。
> tips: 签名时需要手写签名,其他的可以直接填写后打印。
需要填写的内容:
需要填写的内容:
![](/img/docs/community/icla-content-1.png)
![](/img/docs/community/icla-content-2.png)
![](/img/docs/community/icla-content-1.png)
![](/img/docs/community/icla-content-2.png)
在PDF中需要填写的字段:
在PDF中需要填写的字段:
- `Full name`
- `Public name`
- `Postal Address`
- `Country`
- `E-Mail`
- `(optional) preferred Apache id(s)`
- `(optional) notify project`
- `Date`
- `Full name`
- `Public name`
- `Postal Address`
- `Country`
- `E-Mail`
- `(optional) preferred Apache id(s)`
- `(optional) notify project`
- `Date`
> 填写样例
> ![](/img/docs/community/icla-content-3.png)
> ![](/img/docs/community/icla-content-4.png)
> 填写样例
> ![](/img/docs/community/icla-content-3.png)
> ![](/img/docs/community/icla-content-4.png)
3. 打印并签署
![](/img/docs/community/icla-content-5.png)
![](/img/docs/community/icla-content-5.png)
`Please sign`字段需要将文件打印出来然后手写签名,内容为自己姓名的全拼。
`Please sign`字段需要将文件打印出来然后手写签名,内容为自己姓名的全拼。
4. 将签名后的文件拍照或扫描转为PDF,并重命名为`姓名拼音-icla.pdf`
5. 发送邮件到指定邮箱
邮件发送到`secretary@apache.org`,抄送到`private@hertzbeat.apache.org`。
邮件发送到`secretary@apache.org`,抄送到`private@hertzbeat.apache.org`。
注意⚠️此邮件内容需要附加上之前的 committer 邀请邮件信息, 建议在之前的往来邮件点击回复然后修改标题和收件人等。
注意⚠️此邮件内容需要附加上之前的 committer 邀请邮件信息, 建议在之前的往来邮件点击回复然后修改标题和收件人等。
**发送模板**
**发送模板**
主题:`Accept to become a Hertzbeat(incubating) committer`
主题:`Accept to become a Hertzbeat(incubating) committer`
正文:
正文:
```
Hello Apache,
I am willing contribute to the ASF. The attachment is my ICLA information. My Github account is : https://github.com/xxxx.
Thanks !
```
```
Hello Apache,
I am willing contribute to the ASF. The attachment is my ICLA information. My Github account is : https://github.com/xxxx.
Thanks !
```
大概1-5个工作日你就会收到一封来自`root@apache.org`的邮件。
大概1-5个工作日你就会收到一封来自`root@apache.org`的邮件。
当您收到邮件标题为:`Welcome to the Apache Software Foundation`的邮件,恭喜你,你已经获取到Apache ID了!
当您收到邮件标题为:`Welcome to the Apache Software Foundation`的邮件,恭喜你,你已经获取到Apache ID了!
### 设置Apache密码

View File

@ -15,40 +15,40 @@ keywords: [开源监控系统, 开源中间件监控, ActiveMQ消息中间件监
1. 修改安装目录下的 `conf/activemq.xml` 文件,开启JMX
> 在 `broker` 标签中添加 `userJmx="true"` 属性
> 在 `broker` 标签中添加 `userJmx="true"` 属性
```xml
<broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" dataDirectory="${activemq.data}" useJmx="true">
<!-- others -->
</broker>
```
```xml
<broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" dataDirectory="${activemq.data}" useJmx="true">
<!-- others -->
</broker>
```
2. 修改安装目录下的 `bin/env` 文件,配置JMX 端口 IP等
将如下原配置信息
将如下原配置信息
```text
# ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.port=11099"
# ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.password.file=${ACTIVEMQ_CONF}/jmx.password"
# ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.access.file=${ACTIVEMQ_CONF}/jmx.access"
# ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.ssl=false"
ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote"
```
```text
# ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.port=11099"
# ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.password.file=${ACTIVEMQ_CONF}/jmx.password"
# ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.access.file=${ACTIVEMQ_CONF}/jmx.access"
# ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.ssl=false"
ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote"
```
更新为如下配置,⚠️注意修改`本机对外IP`
更新为如下配置,⚠️注意修改`本机对外IP`
```text
# ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.password.file=${ACTIVEMQ_CONF}/jmx.password"
# ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.access.file=${ACTIVEMQ_CONF}/jmx.access"
ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.port=11099"
ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.ssl=false"
ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.authenticate=false"
ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Djava.rmi.server.hostname=本机对外IP"
ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote"
```
```text
# ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.password.file=${ACTIVEMQ_CONF}/jmx.password"
# ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.access.file=${ACTIVEMQ_CONF}/jmx.access"
ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.port=11099"
ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.ssl=false"
ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.authenticate=false"
ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Djava.rmi.server.hostname=本机对外IP"
ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote"
```
3. 重启 ACTIVEMQ 服务,在 HertzBeat 添加对应 ActiveMQ 监控即可,参数使用 JMX 配置的 IP 端口。

View File

@ -11,24 +11,24 @@ keywords: [告警钉钉机器人通知, 开源告警系统, 开源监控告警
1. **【钉钉桌面客户端】-> 【群设置】-> 【智能群助手】-> 【添加新建机器人-选自定义】-> 【设置机器人名称头像】-> 【注意⚠️设置自定义关键字: HertzBeat】 ->【添加成功后复制其WebHook地址】**
> 注意⚠️ 新增机器人时需在安全设置块需设置其自定义关键字: HertzBeat ,其它安全设置加签或IP段不填写
> 注意⚠️ 新增机器人时需在安全设置块需设置其自定义关键字: HertzBeat ,其它安全设置加签或IP段不填写
![email](/img/docs/help/alert-notice-8.png)
![email](/img/docs/help/alert-notice-8.png)
2. **【保存机器人的WebHook地址access_token值】**
> 例如: webHook地址:`https://oapi.dingtalk.com/robot/send?access_token=43aac28a236e001285ed84e473f8eabee70f63c7a70287acb0e0f8b65fade64f`
> 其机器人access_token值为 `43aac28a236e001285ed84e473f8eabee70f63c7a70287acb0e0f8b65fade64f`
> 例如: webHook地址:`https://oapi.dingtalk.com/robot/send?access_token=43aac28a236e001285ed84e473f8eabee70f63c7a70287acb0e0f8b65fade64f`
> 其机器人access_token值为 `43aac28a236e001285ed84e473f8eabee70f63c7a70287acb0e0f8b65fade64f`
3. **【告警通知】->【新增接收人】 ->【选择钉钉机器人通知方式】->【设置钉钉机器人ACCESS_TOKEN】-> 【确定】**
![email](/img/docs/help/alert-notice-9.png)
![email](/img/docs/help/alert-notice-9.png)
4. **配置关联的告警通知策略⚠️ 【新增通知策略】-> 【将刚设置的接收人关联】-> 【确定】**
> **注意⚠️ 新增了接收人并不代表已经生效可以接收告警信息,还需配置关联的告警通知策略,即指定哪些消息发给哪些接收人**
> **注意⚠️ 新增了接收人并不代表已经生效可以接收告警信息,还需配置关联的告警通知策略,即指定哪些消息发给哪些接收人**
![email](/img/docs/help/alert-notice-4.png)
![email](/img/docs/help/alert-notice-4.png)
### 钉钉机器人通知常见问题

View File

@ -15,31 +15,31 @@ keywords: [告警 Discord 机器人通知, 开源告警系统, 开源监控告
1. 访问 [https://discord.com/developers/applications](https://discord.com/developers/applications) 创建应用
![bot](/img/docs/help/discord-bot-1.png)
![bot](/img/docs/help/discord-bot-1.png)
2. 在应用下创建机器人,获取机器人 Token
![bot](/img/docs/help/discord-bot-2.png)
![bot](/img/docs/help/discord-bot-2.png)
![bot](/img/docs/help/discord-bot-3.png)
![bot](/img/docs/help/discord-bot-3.png)
3. 授权机器人到聊天服务器
> 在 OAuth2 菜单下给此机器人授权,`SCOPES` 范围选 `bot`, `BOT PERMISSIONS` 选发送消息 `Send Messages`
> 在 OAuth2 菜单下给此机器人授权,`SCOPES` 范围选 `bot`, `BOT PERMISSIONS` 选发送消息 `Send Messages`
![bot](/img/docs/help/discord-bot-4.png)
![bot](/img/docs/help/discord-bot-4.png)
> 获取到最下方生成的 URL, 浏览器访问此 URL 给机器人正式授权,即设置将机器人加入哪个聊天服务器。
> 获取到最下方生成的 URL, 浏览器访问此 URL 给机器人正式授权,即设置将机器人加入哪个聊天服务器。
4. 查看您的聊天服务器是否已经加入机器人成员
![bot](/img/docs/help/discord-bot-5.png)
![bot](/img/docs/help/discord-bot-5.png)
### 开启开发者模式,获取频道 Channel ID
1. 个人设置 -> 高级设置 -> 开启开发者模式
![bot](/img/docs/help/discord-bot-6.png)
![bot](/img/docs/help/discord-bot-6.png)
2. 获取频道 Channel ID
@ -51,13 +51,13 @@ keywords: [告警 Discord 机器人通知, 开源告警系统, 开源监控告
1. **【告警通知】->【新增接收人】 ->【选择 Discord 机器人通知方式】->【设置机器人Token和ChannelId】-> 【确定】**
![email](/img/docs/help/discord-bot-8.png)
![email](/img/docs/help/discord-bot-8.png)
4. **配置关联的告警通知策略⚠️ 【新增通知策略】-> 【将刚设置的接收人关联】-> 【确定】**
2. **配置关联的告警通知策略⚠️ 【新增通知策略】-> 【将刚设置的接收人关联】-> 【确定】**
> **注意⚠️ 新增了接收人并不代表已经生效可以接收告警信息,还需配置关联的告警通知策略,即指定哪些消息发给哪些接收人**
> **注意⚠️ 新增了接收人并不代表已经生效可以接收告警信息,还需配置关联的告警通知策略,即指定哪些消息发给哪些接收人**
![email](/img/docs/help/alert-notice-policy.png)
![email](/img/docs/help/alert-notice-policy.png)
### Discord 机器人通知常见问题

View File

@ -11,29 +11,29 @@ keywords: [告警邮件通知, 开源告警系统, 开源监控告警系统]
1. **【告警通知】->【新增接收人】 ->【选择邮件通知方式】**
![email](/img/docs/help/alert-notice-1.png)
![email](/img/docs/help/alert-notice-1.png)
2. **【获取验证码】-> 【输入邮箱验证码】-> 【确定】**
![email](/img/docs/help/alert-notice-2.png)
![email](/img/docs/help/alert-notice-3.png)
![email](/img/docs/help/alert-notice-3.png)
3. **配置关联的告警通知策略⚠️ 【新增通知策略】-> 【将刚设置的接收人关联】-> 【确定】**
> **注意⚠️ 新增了接收人并不代表已经生效可以接收告警信息,还需配置关联的告警通知策略,即指定哪些消息发给哪些接收人**
> **注意⚠️ 新增了接收人并不代表已经生效可以接收告警信息,还需配置关联的告警通知策略,即指定哪些消息发给哪些接收人**
![email](/img/docs/help/alert-notice-4.png)
![email](/img/docs/help/alert-notice-4.png)
### 邮件通知常见问题
1. 自己内网部署的HertzBeat无法接收到邮件通知
> HertzBeat需要自己配置邮件服务器,TanCloud无需,请确认是否在application.yml配置了自己的邮件服务器
> HertzBeat需要自己配置邮件服务器,TanCloud无需,请确认是否在application.yml配置了自己的邮件服务器
2. 云环境TanCloud无法接收到邮件通知
> 请排查在告警中心是否已有触发的告警信息
> 请排查是否配置正确邮箱,是否已配置告警策略关联
> 请查询邮箱的垃圾箱里是否把告警邮件拦截
> 请排查在告警中心是否已有触发的告警信息
> 请排查是否配置正确邮箱,是否已配置告警策略关联
> 请查询邮箱的垃圾箱里是否把告警邮件拦截
其它问题可以通过交流群ISSUE反馈哦!

View File

@ -11,17 +11,17 @@ keywords: [开源告警系统, 开源监控告警系统, 企业微信应用告
1. **【企业微信后台管理】-> 【App管理】-> 【创建一个新的应用】-> 【设置应用信息】->【添加成功后复制应用的AgentId和Secret】**
![email](/img/docs/help/alert-wechat-1.jpg)
![email](/img/docs/help/alert-wechat-1.jpg)
2. **【告警通知】->【新增接收人】 ->【选择企业微信应用通知方式】->【设置企业ID,企业应用id和应用的secret 】-> 【确定】**
![email](/img/docs/help/alert-wechat-2.jpg)
![email](/img/docs/help/alert-wechat-2.jpg)
3. **配置关联的告警通知策略⚠️ 【新增通知策略】-> 【将刚设置的接收人关联】-> 【确定】**
> **注意⚠️ 新增了接收人并不代表已经生效可以接收告警信息,还需配置关联的告警通知策略,即指定哪些消息发给哪些接收人。**
> **注意⚠️ 新增了接收人并不代表已经生效可以接收告警信息,还需配置关联的告警通知策略,即指定哪些消息发给哪些接收人。**
![email](/img/docs/help/alert-wechat-3.jpg)
![email](/img/docs/help/alert-wechat-3.jpg)
### 企业微信应用通知常见问题

View File

@ -13,16 +13,17 @@ keywords: [告警飞书机器人通知, 开源告警系统, 开源监控告警
2. **【保存机器人的WebHook地址的KEY值】**
> 例如: webHook地址:`https://open.feishu.cn/open-apis/bot/v2/hook/3adafc96-23d0-4cd5-8feb-17f6e0b5fcs4`
> 其机器人KEY值为 `3adafc96-23d0-4cd5-8feb-17f6e0b5fcs4`
> 例如: webHook地址:`https://open.feishu.cn/open-apis/bot/v2/hook/3adafc96-23d0-4cd5-8feb-17f6e0b5fcs4`
>
> 其机器人KEY值为 `3adafc96-23d0-4cd5-8feb-17f6e0b5fcs4`
3. **【告警通知】->【新增接收人】 ->【选择飞书机器人通知方式】->【设置飞书机器人KEY】-> 【确定】**
4. **配置关联的告警通知策略⚠️ 【新增通知策略】-> 【将刚设置的接收人关联】-> 【确定】**
> **注意⚠️ 新增了接收人并不代表已经生效可以接收告警信息,还需配置关联的告警通知策略,即指定哪些消息发给哪些接收人**
> **注意⚠️ 新增了接收人并不代表已经生效可以接收告警信息,还需配置关联的告警通知策略,即指定哪些消息发给哪些接收人**
![email](/img/docs/help/alert-notice-4.png)
![email](/img/docs/help/alert-notice-4.png)
### 飞书机器人通知常见问题

View File

@ -19,19 +19,19 @@ keywords: [告警 Slack Webhook 通知, 开源告警系统, 开源监控告警
1. **【告警通知】->【新增接收人】 ->【选择 Slack Webhook 通知方式】->【设置 Webhook URL】-> 【确定】**
![email](/img/docs/help/slack-bot-1.png)
![email](/img/docs/help/slack-bot-1.png)
2. **配置关联的告警通知策略⚠️ 【新增通知策略】-> 【将刚设置的接收人关联】-> 【确定】**
> **注意⚠️ 新增了接收人并不代表已经生效可以接收告警信息,还需配置关联的告警通知策略,即指定哪些消息发给哪些接收人**
> **注意⚠️ 新增了接收人并不代表已经生效可以接收告警信息,还需配置关联的告警通知策略,即指定哪些消息发给哪些接收人**
![email](/img/docs/help/alert-notice-policy.png)
![email](/img/docs/help/alert-notice-policy.png)
### Slack 机器人通知常见问题
1. Slack 未收到机器人告警通知
> 请排查在告警中心是否已有触发的告警信息
> 请排查在告警中心是否已有触发的告警信息
> 请排查是否配置正确 Slack Webhook URL,是否已配置告警策略关联
其它问题可以通过交流群ISSUE反馈哦!

View File

@ -11,33 +11,33 @@ keywords: [ 告警华为云SMN通知, 开源告警系统, 开源监控告警系
1. **按照[华为云SMN官方文档](https://support.huaweicloud.com/qs-smn/smn_json.html)开通SMN服务并配置SMN**
![alert-notice-10](/img/docs/help/alert-notice-10.png)
![alert-notice-10](/img/docs/help/alert-notice-10.png)
2. **保存SMN的主题URN**
![alert-notice-11](/img/docs/help/alert-notice-11.png)
![alert-notice-11](/img/docs/help/alert-notice-11.png)
3. **按照[华为云签名文档](https://support.huaweicloud.com/devg-apisign/api-sign-provide.html)获取AK、SK和项目ID**
![alert-notice-12](/img/docs/help/alert-notice-12.png)
![alert-notice-12](/img/docs/help/alert-notice-12.png)
![alert-notice-13](/img/docs/help/alert-notice-13.png)
![alert-notice-13](/img/docs/help/alert-notice-13.png)
4. **【告警通知】->【新增接收人】 ->【选择华为云SMN通知方式】->【设置华为云SMN AK、SK等配置】-> 【确定】**
![alert-notice-14](/img/docs/help/alert-notice-14.png)
![alert-notice-14](/img/docs/help/alert-notice-14.png)
5. **配置关联的告警通知策略⚠️ 【新增通知策略】-> 【将刚设置的接收人关联】-> 【确定】**
> **注意⚠️ 新增了接收人并不代表已经生效可以接收告警信息,还需配置关联的告警通知策略,即指定哪些消息发给哪些接收人**
> **注意⚠️ 新增了接收人并不代表已经生效可以接收告警信息,还需配置关联的告警通知策略,即指定哪些消息发给哪些接收人**
![email](/img/docs/help/alert-notice-4.png)
![email](/img/docs/help/alert-notice-4.png)
### 华为云SMN通知常见问题
1. 华为云SMN群未收到告警通知
> 请排查在告警中心是否已有触发的告警信息
> 请排查在告警中心是否已有触发的告警信息
> 请排查是否正确配置华为云SMN AK、SK等配置,是否已配置告警策略关联
其它问题可以通过交流群ISSUE反馈哦!

View File

@ -15,32 +15,32 @@ keywords: [告警 Telegram 通知, 开源告警系统, 开源监控告警系统]
1. 使用 [@BotFather](https://t.me/BotFather) 创建自己的机器人并获取访问令牌`Token`
![telegram-bot](/img/docs/help/telegram-bot-1.png)
![telegram-bot](/img/docs/help/telegram-bot-1.png)
2. 获取接收人的 `User ID`
**使用您要通知的接收人账户给刚创建 Bot 账户随便发送一个信息**,
访问 ```https://api.telegram.org/bot<TOKEN>/getUpdates``` , **`使用上一步的 Bot Token 替换其中的<TOKEN>`**, 响应`Json`数据中第一个`result.message.from.id` 值即为接收人的 `User ID`
**使用您要通知的接收人账户给刚创建 Bot 账户随便发送一个信息**,
访问 ```https://api.telegram.org/bot<TOKEN>/getUpdates``` , **`使用上一步的 Bot Token 替换其中的<TOKEN>`**, 响应`Json`数据中第一个`result.message.from.id` 值即为接收人的 `User ID`
```json
{
"ok":true,
"result":[
{
"update_id":632299191,
"message":{
"from":{
"id": "User ID"
},
"chat":{
},
"date":1673858065,
"text":"111"
```json
{
"ok":true,
"result":[
{
"update_id":632299191,
"message":{
"from":{
"id": "User ID"
},
"chat":{
},
"date":1673858065,
"text":"111"
}
}
}
]
}
```
]
}
```
3. 记录保存我们获得的 `Token``User Id`
@ -48,20 +48,20 @@ keywords: [告警 Telegram 通知, 开源告警系统, 开源监控告警系统]
1. **【告警通知】->【新增接收人】 ->【选择 Telegram 机器人通知方式】->【设置机器人Token和UserId】-> 【确定】**
![email](/img/docs/help/telegram-bot-2.png)
![email](/img/docs/help/telegram-bot-2.png)
4. **配置关联的告警通知策略⚠️ 【新增通知策略】-> 【将刚设置的接收人关联】-> 【确定】**
2. **配置关联的告警通知策略⚠️ 【新增通知策略】-> 【将刚设置的接收人关联】-> 【确定】**
> **注意⚠️ 新增了接收人并不代表已经生效可以接收告警信息,还需配置关联的告警通知策略,即指定哪些消息发给哪些接收人**
> **注意⚠️ 新增了接收人并不代表已经生效可以接收告警信息,还需配置关联的告警通知策略,即指定哪些消息发给哪些接收人**
![email](/img/docs/help/alert-notice-policy.png)
![email](/img/docs/help/alert-notice-policy.png)
### Telegram 机器人通知常见问题
1. Telegram 未收到机器人告警通知
> 请排查在告警中心是否已有触发的告警信息
> 请排查是否配置正确机器人Token, UserId,是否已配置告警策略关联
> 请排查在告警中心是否已有触发的告警信息
> 请排查是否配置正确机器人Token, UserId,是否已配置告警策略关联
> UserId 应为消息接收对象的UserId
其它问题可以通过交流群ISSUE反馈哦!

View File

@ -11,13 +11,13 @@ keywords: [告警 Webhook 回调通知, 开源告警系统, 开源监控告警
1. **【告警通知】->【新增接收人】 ->【选择WebHook通知方式】-> 【设置WebHook回调地址】 -> 【确定】**
![email](/img/docs/help/alert-notice-5.png)
![email](/img/docs/help/alert-notice-5.png)
2. **配置关联的告警通知策略⚠️ 【新增通知策略】-> 【将刚设置的接收人关联】-> 【确定】**
> **注意⚠️ 新增了接收人并不代表已经生效可以接收告警信息,还需配置关联的告警通知策略,即指定哪些消息发给哪些接收人**
> **注意⚠️ 新增了接收人并不代表已经生效可以接收告警信息,还需配置关联的告警通知策略,即指定哪些消息发给哪些接收人**
![email](/img/docs/help/alert-notice-4.png)
![email](/img/docs/help/alert-notice-4.png)
### WebHook回调POST请求体BODY内容
@ -60,7 +60,7 @@ keywords: [告警 Webhook 回调通知, 开源告警系统, 开源监控告警
1. WebHook回调未生效
> 请查看告警中心是否已经产生此条告警信息
> 请查看告警中心是否已经产生此条告警信息
> 请排查配置的WebHook回调地址是否正确
其它问题可以通过交流群ISSUE反馈哦!

View File

@ -11,28 +11,29 @@ keywords: [告警企业微信通知, 开源告警系统, 开源监控告警系
1. **【企业微信端】-> 【群设置】-> 【群机器人】-> 【添加新建机器人】-> 【设置机器人名称头像】-> 【添加成功后复制其WebHook地址】**
![email](/img/docs/help/alert-notice-6.jpg)
![email](/img/docs/help/alert-notice-6.jpg)
2. **【保存机器人的WebHook地址的KEY值】**
> 例如: webHook地址:`https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=3adafc96-23d0-4cd5-8feb-17f6e0b5fcs4`
> 其机器人KEY值为 `3adafc96-23d0-4cd5-8feb-17f6e0b5fcs4`
> 例如: webHook地址:`https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=3adafc96-23d0-4cd5-8feb-17f6e0b5fcs4`
>
> 其机器人KEY值为 `3adafc96-23d0-4cd5-8feb-17f6e0b5fcs4`
3. **【告警通知】->【新增接收人】 ->【选择企业微信机器人通知方式】->【设置企业微信机器人KEY】-> 【确定】**
![email](/img/docs/help/alert-notice-7.png)
![email](/img/docs/help/alert-notice-7.png)
4. **配置关联的告警通知策略⚠️ 【新增通知策略】-> 【将刚设置的接收人关联】-> 【确定】**
> **注意⚠️ 新增了接收人并不代表已经生效可以接收告警信息,还需配置关联的告警通知策略,即指定哪些消息发给哪些接收人**
> **注意⚠️ 新增了接收人并不代表已经生效可以接收告警信息,还需配置关联的告警通知策略,即指定哪些消息发给哪些接收人**
![email](/img/docs/help/alert-notice-4.png)
![email](/img/docs/help/alert-notice-4.png)
### 企业微信机器人通知常见问题
1. 企业微信群未收到机器人告警通知
> 请排查在告警中心是否已有触发的告警信息
> 请排查在告警中心是否已有触发的告警信息
> 请排查是否配置正确机器人KEY,是否已配置告警策略关联
其它问题可以通过交流群ISSUE反馈哦!

View File

@ -11,53 +11,53 @@ keywords: [开源监控系统, 开源中间件监控, DynamicTp线程池监控]
1. 集成使用 `DynamicTp`
`DynamicTp` 是Jvm语言的基于配置中心的轻量级动态线程池,内置监控告警功能,可通过SPI自定义扩展实现。
`DynamicTp` 是Jvm语言的基于配置中心的轻量级动态线程池,内置监控告警功能,可通过SPI自定义扩展实现。
集成使用,请参考文档 [快速接入](https://dynamictp.cn/guide/use/quick-start.html)
集成使用,请参考文档 [快速接入](https://dynamictp.cn/guide/use/quick-start.html)
2. 开启SpringBoot Actuator Endpoint 暴露出`DynamicTp`指标接口
```yaml
management:
endpoints:
web:
exposure:
include: '*'
```
```yaml
management:
endpoints:
web:
exposure:
include: '*'
```
测试访问指标接口 `ip:port/actuator/dynamic-tp` 是否有响应json数据如下:
测试访问指标接口 `ip:port/actuator/dynamic-tp` 是否有响应json数据如下:
```json
[
{
"poolName": "commonExecutor",
"corePoolSize": 1,
"maximumPoolSize": 1,
"queueType": "LinkedBlockingQueue",
"queueCapacity": 2147483647,
"queueSize": 0,
"fair": false,
"queueRemainingCapacity": 2147483647,
"activeCount": 0,
"taskCount": 0,
"completedTaskCount": 0,
"largestPoolSize": 0,
"poolSize": 0,
"waitTaskCount": 0,
"rejectCount": 0,
"rejectHandlerName": null,
"dynamic": false,
"runTimeoutCount": 0,
"queueTimeoutCount": 0
},
{
"maxMemory": "4 GB",
"totalMemory": "444 MB",
"freeMemory": "250.34 MB",
"usableMemory": "3.81 GB"
}
]
```
```json
[
{
"poolName": "commonExecutor",
"corePoolSize": 1,
"maximumPoolSize": 1,
"queueType": "LinkedBlockingQueue",
"queueCapacity": 2147483647,
"queueSize": 0,
"fair": false,
"queueRemainingCapacity": 2147483647,
"activeCount": 0,
"taskCount": 0,
"completedTaskCount": 0,
"largestPoolSize": 0,
"poolSize": 0,
"waitTaskCount": 0,
"rejectCount": 0,
"rejectHandlerName": null,
"dynamic": false,
"runTimeoutCount": 0,
"queueTimeoutCount": 0
},
{
"maxMemory": "4 GB",
"totalMemory": "444 MB",
"freeMemory": "250.34 MB",
"usableMemory": "3.81 GB"
}
]
```
3. 在HertzBeat中间件监控下添加DynamicTp监控即可

View File

@ -17,29 +17,29 @@ keywords: [开源监控系统, 开源数据库监控, IoTDB数据库监控]
1. metric 采集默认是关闭的,需要先到 `conf/iotdb-metric.yml` 中修改参数打开后重启 server
```
# 是否启动监控模块,默认为false
enableMetric: true
# 是否启用操作延迟统计
enablePerformanceStat: false
# 数据提供方式,对外部通过jmx和prometheus协议提供metrics的数据, 可选参数:[JMX, PROMETHEUS, IOTDB],IOTDB是默认关闭的。
metricReporterList:
- JMX
- PROMETHEUS
# 底层使用的metric架构,可选参数:[MICROMETER, DROPWIZARD]
monitorType: MICROMETER
# 初始化metric的级别,可选参数: [CORE, IMPORTANT, NORMAL, ALL]
metricLevel: IMPORTANT
# 预定义的指标集, 可选参数: [JVM, LOGBACK, FILE, PROCESS, SYSTEM]
predefinedMetrics:
- JVM
- FILE
```
```
# 是否启动监控模块,默认为false
enableMetric: true
# 是否启用操作延迟统计
enablePerformanceStat: false
# 数据提供方式,对外部通过jmx和prometheus协议提供metrics的数据, 可选参数:[JMX, PROMETHEUS, IOTDB],IOTDB是默认关闭的。
metricReporterList:
- JMX
- PROMETHEUS
# 底层使用的metric架构,可选参数:[MICROMETER, DROPWIZARD]
monitorType: MICROMETER
# 初始化metric的级别,可选参数: [CORE, IMPORTANT, NORMAL, ALL]
metricLevel: IMPORTANT
# 预定义的指标集, 可选参数: [JVM, LOGBACK, FILE, PROCESS, SYSTEM]
predefinedMetrics:
- JVM
- FILE
```
2. 重启 IoTDB, 打开浏览器或者用curl 访问 <http://ip:9091/metrics>, 就能看到metric数据了。

View File

@ -8,25 +8,25 @@ sidebar_label: 常见问题
1. **页面反馈:monitor.host:监控Host必须是ipv4,ipv6或域名**
> 如信息所示,输入的监控Host须是ipv4,ipv6或域名,不能携带协议头,例如协议头http
> 如信息所示,输入的监控Host须是ipv4,ipv6或域名,不能携带协议头,例如协议头http
2. **网站API等监控反馈statusCode:403或401,但对端服务本身无需认证,浏览器直接访问是OK**
> 请排查是否是被防火墙拦截,如宝塔等默认设置了对请求header中`User-Agent=Apache-HttpClient`的拦截,若被拦截请删除此拦截规则。(v1.0.beat5版本已将user-agent模拟成浏览器此问题不存在)
> 请排查是否是被防火墙拦截,如宝塔等默认设置了对请求header中`User-Agent=Apache-HttpClient`的拦截,若被拦截请删除此拦截规则。(v1.0.beat5版本已将user-agent模拟成浏览器此问题不存在)
3. 安装包部署的hertzbeat下ping连通性监控异常
安装包安装部署的hertzbeat,对ping连通性监控不可用,但本地直接ping是可用的。
> 安装包部署需要配置java虚拟机root权限启动hertzbeat从而使用ICMP,若未启用root权限则是判断telnet对端7号端口是否开通
> docker安装默认启用无此问题
> 详见 <https://stackoverflow.com/questions/11506321/how-to-ping-an-ip-address>
> 安装包部署需要配置java虚拟机root权限启动hertzbeat从而使用ICMP,若未启用root权限则是判断telnet对端7号端口是否开通
> docker安装默认启用无此问题
> 详见 <https://stackoverflow.com/questions/11506321/how-to-ping-an-ip-address>
4. 配置了k8s监控,但是实际监控时间并未按照正确间隔时间执行
请参考下面几点排查问题:
> 一:首先查看hertzbeat的错误日志,如果出现了'desc: SQL statement too long, check maxSQLLength config',信息
> 二:需要调整tdengine配置文件,可在服务器创建taos.cfg文件,调整# max length of an SQL : maxSQLLength 654800,然后重启tdengine,需要加入配置文件的挂载
> 三:如果遇到了重启tdengine失败,需要调整挂载数据文件中的配置,见 .../taosdata/dnode/dnodeEps.json,中dnodeFqdn调整为启动失败的dockerId即可,然后docker restart tdengine
> 一:首先查看hertzbeat的错误日志,如果出现了'desc: SQL statement too long, check maxSQLLength config',信息
> 二:需要调整tdengine配置文件,可在服务器创建taos.cfg文件,调整# max length of an SQL : maxSQLLength 654800,然后重启tdengine,需要加入配置文件的挂载
> 三:如果遇到了重启tdengine失败,需要调整挂载数据文件中的配置,见 .../taosdata/dnode/dnodeEps.json,中dnodeFqdn调整为启动失败的dockerId即可,然后docker restart tdengine
5. 配置http api监控,用于进行业务接口探测,确保业务可以用,另外接口有进行token鉴权校验,"Authorization:Bearer eyJhbGciOiJIUzI1....",配置后测试,提示“StatusCode 401”。服务端应用收到的token为"Authorization:Bearer%20eyJhbGciOiJIUzI1....",hertzbeat对空格进行转义为“%20”,服务器没有转义导致鉴权失败,建议转义功能作为可选项。
@ -35,31 +35,31 @@ sidebar_label: 常见问题
1. **MYSQL,TDENGINE和HertzBeat都Docker部署在同一主机上,HertzBeat使用localhost或127.0.0.1连接数据库失败**
此问题本质为Docker容器访问宿主机端口连接失败,由于docker默认网络模式为Bridge模式,其通过localhost访问不到宿主机。
> 解决办法一:配置application.yml将数据库的连接地址由localhost修改为宿主机的对外IP
> 解决办法二:使用Host网络模式启动Docker,即使Docker容器和宿主机共享网络 `docker run -d --network host .....`
> 解决办法一:配置application.yml将数据库的连接地址由localhost修改为宿主机的对外IP
> 解决办法二:使用Host网络模式启动Docker,即使Docker容器和宿主机共享网络 `docker run -d --network host .....`
2. **按照流程部署,访问 <http://ip:1157/> 无界面**
请参考下面几点排查问题:
> 一:依赖服务MYSQL数据库,TDENGINE数据库是否已按照启动成功,对应hertzbeat数据库是否已创建,SQL脚本是否执行
> 二:HertzBeat的配置文件 `application.yml` 里面的依赖服务IP账户密码等配置是否正确
> 三:若都无问题可以 `docker logs hertzbeat` 查看容器日志是否有明显错误,提issue或交流群或社区反馈
> 一:依赖服务MYSQL数据库,TDENGINE数据库是否已按照启动成功,对应hertzbeat数据库是否已创建,SQL脚本是否执行
> 二:HertzBeat的配置文件 `application.yml` 里面的依赖服务IP账户密码等配置是否正确
> 三:若都无问题可以 `docker logs hertzbeat` 查看容器日志是否有明显错误,提issue或交流群或社区反馈
3. **日志报错TDengine连接或插入SQL失败**
> 一:排查配置的数据库账户密码是否正确,数据库是否创建
> 二:若是安装包安装的TDengine2.3+,除了启动server外,还需执行 `systemctl start taosadapter` 启动 adapter
> 一:排查配置的数据库账户密码是否正确,数据库是否创建
> 二:若是安装包安装的TDengine2.3+,除了启动server外,还需执行 `systemctl start taosadapter` 启动 adapter
### 安装包部署常见问题
1. **按照流程部署,访问 <http://ip:1157/> 无界面**
请参考下面几点排查问题:
> 一:依赖服务MYSQL数据库,TDENGINE数据库是否已按照启动成功,对应hertzbeat数据库是否已创建,SQL脚本是否执行
> 二:HertzBeat的配置文件 `hertzbeat/config/application.yml` 里面的依赖服务IP账户密码等配置是否正确
> 三:若都无问题可以查看 `hertzbeat/logs/` 目录下面的运行日志是否有明显错误,提issue或交流群或社区反馈
> 一:依赖服务MYSQL数据库,TDENGINE数据库是否已按照启动成功,对应hertzbeat数据库是否已创建,SQL脚本是否执行
> 二:HertzBeat的配置文件 `hertzbeat/config/application.yml` 里面的依赖服务IP账户密码等配置是否正确
> 三:若都无问题可以查看 `hertzbeat/logs/` 目录下面的运行日志是否有明显错误,提issue或交流群或社区反馈
2. **日志报错TDengine连接或插入SQL失败**
> 一:排查配置的数据库账户密码是否正确,数据库是否创建
> 二:若是安装包安装的TDengine2.3+,除了启动server外,还需执行 `systemctl start taosadapter` 启动 adapter
> 一:排查配置的数据库账户密码是否正确,数据库是否创建
> 二:若是安装包安装的TDengine2.3+,除了启动server外,还需执行 `systemctl start taosadapter` 启动 adapter

View File

@ -19,33 +19,33 @@ keywords: [开源监控系统, 开源中间件监控, Jetty应用服务器监控
1. 在 Jetty 启动 JMX JMX-REMOTE 模块
```shell
java -jar $JETTY_HOME/start.jar --add-module=jmx
java -jar $JETTY_HOME/start.jar --add-module=jmx-remote
```
```shell
java -jar $JETTY_HOME/start.jar --add-module=jmx
java -jar $JETTY_HOME/start.jar --add-module=jmx-remote
```
命令执行成功会创建出 `${JETTY_BASE}/start.d/jmx-remote.ini` 配置文件
命令执行成功会创建出 `${JETTY_BASE}/start.d/jmx-remote.ini` 配置文件
2. 编辑 `${JETTY_BASE}/start.d/jmx-remote.ini` 配置文件,修改 JMX 的 IP 端口等参数。
**`localhost` 需修改为对外暴露 IP**
**`localhost` 需修改为对外暴露 IP**
```text
## The host/address to bind the RMI server to.
# jetty.jmxremote.rmiserverhost=localhost
## The port the RMI server listens to (0 means a random port is chosen).
# jetty.jmxremote.rmiserverport=1099
## The host/address to bind the RMI registry to.
# jetty.jmxremote.rmiregistryhost=localhost
## The port the RMI registry listens to.
# jetty.jmxremote.rmiregistryport=1099
## The host name exported in the RMI stub.
-Djava.rmi.server.hostname=localhost
```
```text
## The host/address to bind the RMI server to.
# jetty.jmxremote.rmiserverhost=localhost
## The port the RMI server listens to (0 means a random port is chosen).
# jetty.jmxremote.rmiserverport=1099
## The host/address to bind the RMI registry to.
# jetty.jmxremote.rmiregistryhost=localhost
## The port the RMI registry listens to.
# jetty.jmxremote.rmiregistryport=1099
## The host name exported in the RMI stub.
-Djava.rmi.server.hostname=localhost
```
3. 重启 Jetty Server 即可。

View File

@ -17,16 +17,16 @@ keywords: [开源监控系统, 开源消息中间件监控, Kafka监控]
2. 修改 Kafka 启动脚本
修改 Kafka 安装目录下的启动脚本 `/bin/kafka-server-start.sh`
在脚本正文(即非注释行)的第一行前添加如下内容, ⚠️注意替换您自己的端口和对外 IP 地址
修改 Kafka 安装目录下的启动脚本 `/bin/kafka-server-start.sh`
在脚本正文(即非注释行)的第一行前添加如下内容, ⚠️注意替换您自己的端口和对外 IP 地址
```shell
export JMX_PORT=9999;
export KAFKA_JMX_OPTS="-Djava.rmi.server.hostname=ip地址 -Dcom.sun.management.jmxremote.rmi.port=9999 -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false";
# 这是最后一行本来就存在的
# exec $base_dir/kafka-run-class.sh $EXTRA_ARGS kafka.Kafka "$@"
```
```shell
export JMX_PORT=9999;
export KAFKA_JMX_OPTS="-Djava.rmi.server.hostname=ip地址 -Dcom.sun.management.jmxremote.rmi.port=9999 -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false";
# 这是最后一行本来就存在的
# exec $base_dir/kafka-run-class.sh $EXTRA_ARGS kafka.Kafka "$@"
```
3. 重启 Kafka 服务

View File

@ -17,15 +17,15 @@ keywords: [开源监控系统, 开源Kubernetes监控]
1. 创建service account并绑定默认cluster-admin管理员集群角色
```kubectl create serviceaccount dashboard-admin -n kube-system```
```kubectl create serviceaccount dashboard-admin -n kube-system```
2. 用户授权
```shell
kubectl create clusterrolebinding dashboard-admin --clusterrole=cluster-admin --serviceaccount=kube-system:dashboard-admin
kubectl -n kube-system get secret | grep dashboard-admin | awk '{print $1}'
kubectl describe secret {secret} -n kube-system
```
```shell
kubectl create clusterrolebinding dashboard-admin --clusterrole=cluster-admin --serviceaccount=kube-system:dashboard-admin
kubectl -n kube-system get secret | grep dashboard-admin | awk '{print $1}'
kubectl describe secret {secret} -n kube-system
```
### 方式二

View File

@ -14,9 +14,9 @@ keywords: [开源监控系统, 中间件监控, Nacos分布式监控]
1. 按照[部署文档](https://nacos.io/zh-cn/docs/deployment.html)搭建好Nacos集群。
2. 配置application.properties文件,暴露metrics数据。
```
management.endpoints.web.exposure.include=*
```
```
management.endpoints.web.exposure.include=*
```
3. 访问```{ip}:8848/nacos/actuator/prometheus```,查看是否能访问到metrics数据。

View File

@ -17,45 +17,45 @@ keywords: [开源监控工具, 开源Java监控工具, 监控Nginx指标]
1. 检查是否已添加 `ngx_http_stub_status_module`
```shell
nginx -V
```
```shell
nginx -V
```
查看是否包含 `--with-http_stub_status_module`,如果没有则需要重新编译安装 Nginx。
查看是否包含 `--with-http_stub_status_module`,如果没有则需要重新编译安装 Nginx。
2. 编译安装 Nginx, 添加 `ngx_http_stub_status_module` 模块
下载 Nginx 并解压,在目录下执行
下载 Nginx 并解压,在目录下执行
```shell
./configure --prefix=/usr/local/nginx --with-http_stub_status_module
make && make install
```
```shell
./configure --prefix=/usr/local/nginx --with-http_stub_status_module
make && make install
```
3. 修改 Nginx 配置文件
修改 `nginx.conf` 文件,添加监控模块暴露端点,如下配置:
修改 `nginx.conf` 文件,添加监控模块暴露端点,如下配置:
```shell
# modify nginx.conf
server {
listen 80; # port
server_name localhost;
location /nginx-status {
stub_status on;
access_log on;
#allow 127.0.0.1; #only allow requests from localhost
#deny all; #deny all other hosts
}
}
```
```shell
# modify nginx.conf
server {
listen 80; # port
server_name localhost;
location /nginx-status {
stub_status on;
access_log on;
#allow 127.0.0.1; #only allow requests from localhost
#deny all; #deny all other hosts
}
}
```
4. 重新加载 Nginx
```shell
nginx -s reload
```
```shell
nginx -s reload
```
5. 在浏览器访问 `http://localhost/nginx-status` 即可查看 Nginx 监控状态信息。
@ -63,48 +63,48 @@ nginx -s reload
1. 安装 `ngx_http_reqstat_module` 模块
```shell
# install `ngx_http_reqstat_module`
wget https://github.com/zls0424/ngx_req_status/archive/master.zip -O ngx_req_status.zip
unzip ngx_req_status.zip
patch -p1 < ../ngx_req_status-master/write_filter.patch
./configure --prefix=/usr/local/nginx --add-module=/path/to/ngx_req_status-master
make -j2
make install
```
```shell
# install `ngx_http_reqstat_module`
wget https://github.com/zls0424/ngx_req_status/archive/master.zip -O ngx_req_status.zip
unzip ngx_req_status.zip
patch -p1 < ../ngx_req_status-master/write_filter.patch
./configure --prefix=/usr/local/nginx --add-module=/path/to/ngx_req_status-master
make -j2
make install
```
2. 修改 Nginx 配置文件
修改 `nginx.conf` 文件,添加状态模块暴露端点,如下配置:
修改 `nginx.conf` 文件,添加状态模块暴露端点,如下配置:
```shell
# modify nginx.conf
http {
req_status_zone server_name $server_name 256k;
req_status_zone server_addr $server_addr 256k;
req_status server_name server_addr;
server {
location /req-status {
req_status_show on;
#allow 127.0.0.1; #only allow requests from localhost
#deny all; #deny all other hosts
```shell
# modify nginx.conf
http {
req_status_zone server_name $server_name 256k;
req_status_zone server_addr $server_addr 256k;
req_status server_name server_addr;
server {
location /req-status {
req_status_show on;
#allow 127.0.0.1; #only allow requests from localhost
#deny all; #deny all other hosts
}
}
}
}
```
```
3. 重新加载 Nginx
```shell
nginx -s reload
```
```shell
nginx -s reload
```
4. 在浏览器访问 `http://localhost/req-status` 即可查看 Nginx 监控状态信息。

View File

@ -14,9 +14,9 @@ keywords: [开源监控系统, 开源消息中间件监控, RabbitMQ消息中间
1. 开启 Management 插件,或使用自开启版本
```shell
rabbitmq-plugins enable rabbitmq_management
```
```shell
rabbitmq-plugins enable rabbitmq_management
```
2. 浏览器访问 <http://ip:15672/> ,默认账户密码 `guest/guest`. 成功登录即开启成功。

View File

@ -17,27 +17,27 @@ keywords: [开源监控系统, 开源消息中间件监控, ShenYu网关监控
1. 在网关的 pom.xml 文件中添加 metrics 的依赖。
```xml
<dependency>
<groupId>org.apache.shenyu</groupId>
<artifactId>shenyu-spring-boot-starter-plugin-metrics</artifactId>
<version>${project.version}</version>
</dependency>
```
```xml
<dependency>
<groupId>org.apache.shenyu</groupId>
<artifactId>shenyu-spring-boot-starter-plugin-metrics</artifactId>
<version>${project.version}</version>
</dependency>
```
2. 在网关的配置yaml文件中编辑如下内容:
```yaml
shenyu:
metrics:
enabled: true #设置为 true 表示开启
name : prometheus
host: 127.0.0.1 #暴露的ip
port: 8090 #暴露的端口
jmxConfig: #jmx配置
props:
jvm_enabled: true #开启jvm的监控指标
```
```yaml
shenyu:
metrics:
enabled: true #设置为 true 表示开启
name : prometheus
host: 127.0.0.1 #暴露的ip
port: 8090 #暴露的端口
jmxConfig: #jmx配置
props:
jvm_enabled: true #开启jvm的监控指标
```
最后重启访问网关指标接口 `http://ip:8090` 响应 prometheus 格式数据即可。

View File

@ -14,23 +14,23 @@ keywords: [开源监控系统, Zookeeper监控监控]
1. 加白名单步骤
> 1.找到我们 zookeeper 的配置文件,一般是 `zoo.cfg`
>
> 2.配置文件中加入以下命令
1. 找到我们 zookeeper 的配置文件,一般是 `zoo.cfg`
```shell
# 将需要的命令添加到白名单中
4lw.commands.whitelist=stat, ruok, conf, isro
2. 配置文件中加入以下命令
# 将所有命令添加到白名单中
4lw.commands.whitelist=*
```
```shell
# 将需要的命令添加到白名单中
4lw.commands.whitelist=stat, ruok, conf, isro
# 将所有命令添加到白名单中
4lw.commands.whitelist=*
```
> 3.重启服务
3. 重启服务
```shell
zkServer.sh restart
```
```shell
zkServer.sh restart
```
2. netcat 协议

View File

@ -16,61 +16,61 @@ sidebar_label: 常见参数配置
1. 配置短信发送服务器
> 只有成功配置了您自己的短信服务器,监控系统内触发的告警短信才会正常发送。
> 只有成功配置了您自己的短信服务器,监控系统内触发的告警短信才会正常发送。
在`application.yml`新增如下腾讯平台短信服务器配置(参数需替换为您的短信服务器配置)
在`application.yml`新增如下腾讯平台短信服务器配置(参数需替换为您的短信服务器配置)
```yaml
common:
sms:
tencent:
secret-id: AKIDbQ4VhdMr89wDedFrIcgU2PaaMvOuBCzY
secret-key: PaXGl0ziY9UcWFjUyiFlCPMr77rLkJYlyA
app-id: 1435441637
sign-name: 赫兹跳动
template-id: 1343434
```
```yaml
common:
sms:
tencent:
secret-id: AKIDbQ4VhdMr89wDedFrIcgU2PaaMvOuBCzY
secret-key: PaXGl0ziY9UcWFjUyiFlCPMr77rLkJYlyA
app-id: 1435441637
sign-name: 赫兹跳动
template-id: 1343434
```
1.1 腾讯云短信创建签名(sign-name)
![image](https://github.com/apache/hertzbeat/assets/40455946/3a4c287d-b23d-4398-8562-4894296af485)
1.1 腾讯云短信创建签名(sign-name)
![image](https://github.com/apache/hertzbeat/assets/40455946/3a4c287d-b23d-4398-8562-4894296af485)
1.2 腾讯云短信创建正文模板(template-id)
1.2 腾讯云短信创建正文模板(template-id)
```
监控:{1},告警级别:{2}。内容:{3}
```
```
监控:{1},告警级别:{2}。内容:{3}
```
![image](https://github.com/apache/hertzbeat/assets/40455946/face71a6-46d5-452c-bed3-59d2a975afeb)
![image](https://github.com/apache/hertzbeat/assets/40455946/face71a6-46d5-452c-bed3-59d2a975afeb)
1.3 腾讯云短信创建应用(app-id)
![image](https://github.com/apache/hertzbeat/assets/40455946/2732d710-37fa-4455-af64-48bba273c2f8)
1.3 腾讯云短信创建应用(app-id)
![image](https://github.com/apache/hertzbeat/assets/40455946/2732d710-37fa-4455-af64-48bba273c2f8)
1.4 腾讯云访问管理(secret-id、secret-key)
![image](https://github.com/apache/hertzbeat/assets/40455946/36f056f0-94e7-43db-8f07-82893c98024e)
1.4 腾讯云访问管理(secret-id、secret-key)
![image](https://github.com/apache/hertzbeat/assets/40455946/36f056f0-94e7-43db-8f07-82893c98024e)
2. 配置告警自定义参数
```yaml
alerter:
# 自定义控制台地址
console-url: https://console.tancloud.io
```
```yaml
alerter:
# 自定义控制台地址
console-url: https://console.tancloud.io
```
3. 使用外置redis代替内存存储实时指标数据
> 默认我们的指标实时数据存储在内存中,可以配置如下来使用redis代替内存存储。
> 默认我们的指标实时数据存储在内存中,可以配置如下来使用redis代替内存存储。
注意⚠️ `memory.enabled: false, redis.enabled: true`
注意⚠️ `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
```
```yaml
warehouse:
store:
memory:
enabled: false
init-size: 1024
redis:
enabled: true
host: 127.0.0.1
port: 6379
password: 123456
```

View File

@ -15,47 +15,47 @@ sidebar_label: Docker Compose方式安装
1. 下载启动脚本包
从 [下载地址](https://github.com/apache/hertzbeat/releases/download/v1.6.0/apache-hertzbeat-1.6.0-incubating-docker-compose.tar.gz) 下载安装脚本包 `apache-hertzbeat-xxx-incubating-docker-compose.tar.gz`
从 [下载地址](https://github.com/apache/hertzbeat/releases/download/v1.6.0/apache-hertzbeat-1.6.0-incubating-docker-compose.tar.gz) 下载安装脚本包 `apache-hertzbeat-xxx-incubating-docker-compose.tar.gz`
2. 选择使用 HertzBeat + PostgreSQL + VictoriaMetrics 方案
:::tip
:::tip
- `apache-hertzbeat-xxx-incubating-docker-compose.tar.gz` 解压后包含多个部署方案,这里我们推荐选择 `hertzbeat-postgresql-victoria-metrics` 方案。
- 其它部署方式请详细阅读各个部署方案的 README.md 文件, MySQL 方案需要自行准备 MySQL 驱动包。
- `apache-hertzbeat-xxx-incubating-docker-compose.tar.gz` 解压后包含多个部署方案,这里我们推荐选择 `hertzbeat-postgresql-victoria-metrics` 方案。
- 其它部署方式请详细阅读各个部署方案的 README.md 文件, MySQL 方案需要自行准备 MySQL 驱动包。
:::
:::
- 解压脚本包
- 解压脚本包
```
tar zxvf apache-hertzbeat-1.6.0-incubating-docker-compose.tar.gz
```
```
tar zxvf apache-hertzbeat-1.6.0-incubating-docker-compose.tar.gz
```
- 进入解压目录, 选择 `HertzBeat + PostgreSQL + VictoriaMetrics` 一键部署
- 进入解压目录, 选择 `HertzBeat + PostgreSQL + VictoriaMetrics` 一键部署
```
cd apache-hertzbeat-1.6.0-incubating-docker-compose
cd hertzbeat-postgresql-victoria-metrics
```
```
cd apache-hertzbeat-1.6.0-incubating-docker-compose
cd hertzbeat-postgresql-victoria-metrics
```
- 一键启动
- 一键启动
> 在 `hertzbeat-postgresql-victoria-metrics` 目录下执行以下命令
> 在 `hertzbeat-postgresql-victoria-metrics` 目录下执行以下命令
```
docker-compose up -d
```
```
docker-compose up -d
```
- 查看服务状态
- 查看服务状态
> 查看各个容器的运行状态,up 为正常运行状态
> 查看各个容器的运行状态,up 为正常运行状态
```
docker-compose ps
```
```
docker-compose ps
```
4. 开始探索 HertzBeat
3. 开始探索 HertzBeat
浏览器访问 <http://ip:1157/> 即可开始探索使用,默认账户密码 admin/hertzbeat。
**HAVE FUN**

View File

@ -17,37 +17,37 @@ sidebar_label: Docker方式安装
1. 执行以下命令
```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
```
```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
```
> 命令参数详解
> 命令参数详解
- `docker run -d` : 通过 Docker 后台运行容器
- `-p 1157:1157 -p 1158:1158` : 映射容器端口到主机端口(前面是宿主机的端口号,后面是容器的端口号)。1157是页面端口,1158是集群端口。
- `-v $(pwd)/data:/opt/hertzbeat/data` : (可选,数据持久化) 重要,挂载数据库文件到本地主机,保证数据不会因为容器的创建删除而丢失
- `-v $(pwd)/logs:/opt/hertzbeat/logs` : (可选) 挂载日志文件到本地主机方便查看
- `-v $(pwd)/application.yml:/opt/hertzbeat/config/application.yml` : (可选) 挂载配置文件到容器中(请确保本地已有此文件)。[下载源](https://github.com/apache/hertzbeat/raw/master/script/application.yml)
- `-v $(pwd)/sureness.yml:/opt/hertzbeat/config/sureness.yml` : (可选) 挂载账户配置文件到容器中(请确保本地已有此文件)。[下载源](https://github.com/apache/hertzbeat/raw/master/script/sureness.yml)
- `-v $(pwd)/ext-lib:/opt/hertzbeat/ext-lib` : (可选) 挂载外部的第三方 JAR 包 [mysql-jdbc](https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-8.0.25.zip) [oracle-jdbc](https://download.oracle.com/otn-pub/otn_software/jdbc/234/ojdbc8.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` : (可选) 命名容器名称为 hertzbeat
- `--restart=always` : (可选) 配置容器自动重启。
- `apache/hertzbeat` : 使用[官方应用镜像](https://hub.docker.com/r/apache/hertzbeat)来启动容器, 若网络超时可用`quay.io/tancloud/hertzbeat`代替。
- `docker run -d` : 通过 Docker 后台运行容器
- `-p 1157:1157 -p 1158:1158` : 映射容器端口到主机端口(前面是宿主机的端口号,后面是容器的端口号)。1157是页面端口,1158是集群端口。
- `-v $(pwd)/data:/opt/hertzbeat/data` : (可选,数据持久化) 重要,挂载数据库文件到本地主机,保证数据不会因为容器的创建删除而丢失
- `-v $(pwd)/logs:/opt/hertzbeat/logs` : (可选) 挂载日志文件到本地主机方便查看
- `-v $(pwd)/application.yml:/opt/hertzbeat/config/application.yml` : (可选) 挂载配置文件到容器中(请确保本地已有此文件)。[下载源](https://github.com/apache/hertzbeat/raw/master/script/application.yml)
- `-v $(pwd)/sureness.yml:/opt/hertzbeat/config/sureness.yml` : (可选) 挂载账户配置文件到容器中(请确保本地已有此文件)。[下载源](https://github.com/apache/hertzbeat/raw/master/script/sureness.yml)
- `-v $(pwd)/ext-lib:/opt/hertzbeat/ext-lib` : (可选) 挂载外部的第三方 JAR 包 [mysql-jdbc](https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-8.0.25.zip) [oracle-jdbc](https://download.oracle.com/otn-pub/otn_software/jdbc/234/ojdbc8.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` : (可选) 命名容器名称为 hertzbeat
- `--restart=always` : (可选) 配置容器自动重启。
- `apache/hertzbeat` : 使用[官方应用镜像](https://hub.docker.com/r/apache/hertzbeat)来启动容器, 若网络超时可用`quay.io/tancloud/hertzbeat`代替。
:::tip
:::tip
- 标记为可选的参数,非必填项,若不需要则删除。
- 此将容器的 1157,1158 端口映射到宿主机的 1157,1158 端口上。若宿主机该端口已被占用,则需修改主机映射端口。
- 挂载文件时,前面参数为你自定义本地文件地址,后面参数为容器内文件地址。挂载时请确保你本地已有此文件。
- 可执行```docker update --restart=always hertzbeat```配置容器自动重启。
- 标记为可选的参数,非必填项,若不需要则删除。
- 此将容器的 1157,1158 端口映射到宿主机的 1157,1158 端口上。若宿主机该端口已被占用,则需修改主机映射端口。
- 挂载文件时,前面参数为你自定义本地文件地址,后面参数为容器内文件地址。挂载时请确保你本地已有此文件。
- 可执行```docker update --restart=always hertzbeat```配置容器自动重启。
:::
:::
2. 开始探索 HertzBeat
浏览器访问 <http://ip:1157/> 即可开始探索使用HertzBeat,默认账户密码 admin/hertzbeat。
@ -63,34 +63,34 @@ HertzBeat Collector 是一个轻量级的数据采集器,用于采集并将数
1. 执行以下命令
```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
```
```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
```
> 命令参数详解
> 命令参数详解
- `docker run -d` : 通过 Docker 后台运行容器
- `-e IDENTITY=custom-collector-name` : (可选) 设置采集器的唯一标识名称。注意多采集器时名称需保证唯一性。
- `-e MODE=public` : 配置运行模式(public or private), 公共集群模式或私有云边模式。
- `-e MANAGER_HOST=127.0.0.1` : 重要, 配置连接的 HertzBeat Server 地址,127.0.0.1 需替换为 HertzBeat Server 对外 IP 地址。
- `-e MANAGER_PORT=1158` : (可选) 配置连接的 HertzBeat Server 端口,默认 1158.
- `-v $(pwd)/logs:/opt/hertzbeat-collector/logs` : (可选)挂载日志文件到本地主机方便查看
- `--name hertzbeat-collector` : 命名容器名称为 hertzbeat-collector
- `apache/hertzbeat-collector` : 使用[官方应用镜像](https://hub.docker.com/r/apache/hertzbeat-collector)来启动容器, 若网络超时可用`quay.io/tancloud/hertzbeat-collector`代替。
- `docker run -d` : 通过 Docker 后台运行容器
- `-e IDENTITY=custom-collector-name` : (可选) 设置采集器的唯一标识名称。注意多采集器时名称需保证唯一性。
- `-e MODE=public` : 配置运行模式(public or private), 公共集群模式或私有云边模式。
- `-e MANAGER_HOST=127.0.0.1` : 重要, 配置连接的 HertzBeat Server 地址,127.0.0.1 需替换为 HertzBeat Server 对外 IP 地址。
- `-e MANAGER_PORT=1158` : (可选) 配置连接的 HertzBeat Server 端口,默认 1158.
- `-v $(pwd)/logs:/opt/hertzbeat-collector/logs` : (可选)挂载日志文件到本地主机方便查看
- `--name hertzbeat-collector` : 命名容器名称为 hertzbeat-collector
- `apache/hertzbeat-collector` : 使用[官方应用镜像](https://hub.docker.com/r/apache/hertzbeat-collector)来启动容器, 若网络超时可用`quay.io/tancloud/hertzbeat-collector`代替。
:::tip
:::tip
- `MANAGER_HOST=127.0.0.1` 中的 `127.0.0.1` 需被替换为 HertzBeat Server 对外 IP 地址。
- 标记为可选的参数,非必填项,若不需要则删除。
- 挂载文件时,前面参数为你自定义本地文件地址,后面参数为容器内文件地址。挂载时请确保你本地已有此文件。
- 可执行```docker update --restart=always hertzbeat-collector```配置容器自动重启。
- `MANAGER_HOST=127.0.0.1` 中的 `127.0.0.1` 需被替换为 HertzBeat Server 对外 IP 地址。
- 标记为可选的参数,非必填项,若不需要则删除。
- 挂载文件时,前面参数为你自定义本地文件地址,后面参数为容器内文件地址。挂载时请确保你本地已有此文件。
- 可执行```docker update --restart=always hertzbeat-collector```配置容器自动重启。
:::
:::
2. 开始探索 HertzBeat Collector
浏览器访问 <http://ip:1157/> 即可开始探索使用,默认账户密码 admin/hertzbeat。
@ -106,45 +106,45 @@ $ docker run -d \
1. MYSQL,TDENGINE或IotDB和HertzBeat都Docker部署在同一主机上,HertzBeat使用localhost或127.0.0.1连接数据库失败
此问题本质为Docker容器访问宿主机端口连接失败,由于docker默认网络模式为Bridge模式,其通过localhost访问不到宿主机。
> 解决办法一:配置application.yml将数据库的连接地址由localhost修改为宿主机的对外IP
> 解决办法二:使用Host网络模式启动Docker,即使Docker容器和宿主机共享网络 `docker run -d --network host .....`
> 解决办法一:配置application.yml将数据库的连接地址由localhost修改为宿主机的对外IP
> 解决办法二:使用Host网络模式启动Docker,即使Docker容器和宿主机共享网络 `docker run -d --network host .....`
2. 按照流程部署,访问 <http://ip:1157/> 无界面
请参考下面几点排查问题:
> 一:若切换了依赖服务MYSQL数据库,排查数据库是否成功创建,是否启动成功
> 二:HertzBeat的配置文件 `application.yml` 里面的依赖服务IP账户密码等配置是否正确
> 三:若都无问题可以 `docker logs hertzbeat` 查看容器日志是否有明显错误,提issue或交流群或社区反馈
> 一:若切换了依赖服务MYSQL数据库,排查数据库是否成功创建,是否启动成功
> 二:HertzBeat的配置文件 `application.yml` 里面的依赖服务IP账户密码等配置是否正确
> 三:若都无问题可以 `docker logs hertzbeat` 查看容器日志是否有明显错误,提issue或交流群或社区反馈
3. 监控页面历史图表不显示,弹出 [无法提供历史图表数据,请配置依赖时序数据库]
> 如弹窗所示,历史图表展示的前提是需要安装配置hertzbeat的依赖服务 -
> 安装初始化此时序数据库
> 如弹窗所示,历史图表展示的前提是需要安装配置hertzbeat的依赖服务 -
> 安装初始化此时序数据库
4. 安装配置了时序数据库,但页面依旧显示弹出 [无法提供历史图表数据,请配置依赖时序数据库]
> 请检查配置的时许数据库参数是否正确
> 时序数据库对应的 enable 是否设置为true
> 注意⚠️若hertzbeat和外置数据库都为docker容器在同一主机下启动,容器之间默认不能用127.0.0.1通讯,改为主机IP
> 可根据logs目录下启动日志排查
> 请检查配置的时许数据库参数是否正确
> 时序数据库对应的 enable 是否设置为true
> 注意⚠️若hertzbeat和外置数据库都为docker容器在同一主机下启动,容器之间默认不能用127.0.0.1通讯,改为主机IP
> 可根据logs目录下启动日志排查
5. application.yml 是干什么用的
> 此文件是HertzBeat的配置文件,用于配置HertzBeat的各种参数,如数据库连接信息,时序数据库配置等。
> 此文件是HertzBeat的配置文件,用于配置HertzBeat的各种参数,如数据库连接信息,时序数据库配置等。
下载 `application.yml` 文件到主机目录下,例如: $(pwd)/application.yml
下载源 [github/script/application.yml](https://github.com/apache/hertzbeat/raw/master/script/application.yml)
下载 `application.yml` 文件到主机目录下,例如: $(pwd)/application.yml
下载源 [github/script/application.yml](https://github.com/apache/hertzbeat/raw/master/script/application.yml)
- 若需使用邮件发送告警,需替换 `application.yml` 里面的邮件服务器参数
- 若需使用外置Mysql数据库替换内置H2数据库,需替换`application.yml`里面的`spring.datasource`参数 具体步骤参见 [H2数据库切换为MYSQL](mysql-change))
- 若需使用时序数据库TDengine来存储指标数据,需替换`application.yml`里面的`warehouse.store.victoria-metrics`参数 具体步骤参见 [使用victoria-metrics存储指标数据](victoria-metrics-init)
- 若需使用邮件发送告警,需替换 `application.yml` 里面的邮件服务器参数
- 若需使用外置Mysql数据库替换内置H2数据库,需替换`application.yml`里面的`spring.datasource`参数 具体步骤参见 [H2数据库切换为MYSQL](mysql-change))
- 若需使用时序数据库TDengine来存储指标数据,需替换`application.yml`里面的`warehouse.store.victoria-metrics`参数 具体步骤参见 [使用victoria-metrics存储指标数据](victoria-metrics-init)
6. sureness.yml 是干什么用的
> 此文件是HertzBeat的用户配置文件,用于配置HertzBeat的用户信息,如账户密码等。
> 此文件是HertzBeat的用户配置文件,用于配置HertzBeat的用户信息,如账户密码等。
HertzBeat默认内置三个用户账户,分别为 admin/hertzbeat tom/hertzbeat guest/hertzbeat
若需要新增删除修改账户或密码,可以通过配置 `sureness.yml` 实现,若无此需求可忽略此步骤
下载 `sureness.yml` 文件到主机目录下,例如: $(pwd)/sureness.yml
下载源 [github/script/sureness.yml](https://github.com/apache/hertzbeat/raw/master/script/sureness.yml)
具体修改步骤参考 [配置修改账户密码](account-modify)
HertzBeat默认内置三个用户账户,分别为 admin/hertzbeat tom/hertzbeat guest/hertzbeat
若需要新增删除修改账户或密码,可以通过配置 `sureness.yml` 实现,若无此需求可忽略此步骤
下载 `sureness.yml` 文件到主机目录下,例如: $(pwd)/sureness.yml
下载源 [github/script/sureness.yml](https://github.com/apache/hertzbeat/raw/master/script/sureness.yml)
具体修改步骤参考 [配置修改账户密码](account-modify)

View File

@ -16,32 +16,32 @@ It's designed to work on infrastructure of the cloud era, and users benefit from
### 通过Docker方式安装GreptimeDB
> 可参考官方网站[安装教程](https://docs.greptime.com/getting-started/overview)
>
> 1. 下载安装Docker环境
> Docker 工具自身的下载请参考 [Docker官网文档](https://docs.docker.com/get-docker/)。
> 安装完毕后终端查看Docker版本是否正常输出。
>
> ```
> $ docker -v
> Docker version 20.10.12, build e91ed57
> ```
>
> 2. Docker安装GreptimeDB
```shell
$ docker run -p 127.0.0.1:4000-4003:4000-4003 \
-v "$(pwd)/greptimedb:/tmp/greptimedb" \
--name greptime --rm \
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
```
1. 下载安装Docker环境
Docker 工具自身的下载请参考 [Docker官网文档](https://docs.docker.com/get-docker/)。
安装完毕后终端查看Docker版本是否正常输出。
`-v "$(pwd)/greptimedb:/tmp/greptimedb` 为 greptimedb 数据目录本地持久化挂载,需将 `$(pwd)/greptimedb` 替换为实际本地存在的目录,默认使用执行命令的当前目录下的 `greptimedb` 目录作为数据目录。
```shell
$ docker -v
Docker version 20.10.12, build e91ed57
```
使用```$ docker ps```查看数据库是否启动成功
2. Docker安装GreptimeDB
```shell
$ docker run -p 127.0.0.1:4000-4003:4000-4003 \
-v "$(pwd)/greptimedb:/tmp/greptimedb" \
--name greptime --rm \
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` 为 greptimedb 数据目录本地持久化挂载,需将 `$(pwd)/greptimedb` 替换为实际本地存在的目录,默认使用执行命令的当前目录下的 `greptimedb` 目录作为数据目录。
使用```$ docker ps```查看数据库是否启动成功
### 在hertzbeat的`application.yml`配置文件配置此数据库连接
@ -49,25 +49,25 @@ $ docker run -p 127.0.0.1:4000-4003:4000-4003 \
修改位于 `hertzbeat/config/application.yml` 的配置文件 [/script/application.yml](https://github.com/apache/hertzbeat/raw/master/script/application.yml)
注意⚠️docker容器方式需要将application.yml文件挂载到主机本地,安装包方式解压修改位于 `hertzbeat/config/application.yml` 即可
**修改里面的`warehouse.store.jpa.enabled`参数为`false`, 配置里面的`warehouse.store.greptime`数据源参数,URL账户密码,并启用`enabled`为`true`**
**修改里面的`warehouse.store.jpa.enabled`参数为`false`, 配置里面的`warehouse.store.greptime`数据源参数,URL账户密码,并启用`enabled`为`true`**
```yaml
warehouse:
store:
# 关闭默认JPA
jpa:
enabled: false
greptime:
enabled: true
grpc-endpoints: localhost:4001
url: jdbc:mysql://localhost:4002/hertzbeat?connectionTimeZone=Asia/Shanghai&forceConnectionTimeZoneToSession=true
driver-class-name: com.mysql.cj.jdbc.Driver
username: greptime
password: greptime
expire-time: 30d
```
```yaml
warehouse:
store:
# 关闭默认JPA
jpa:
enabled: false
greptime:
enabled: true
grpc-endpoints: localhost:4001
url: jdbc:mysql://localhost:4002/hertzbeat?connectionTimeZone=Asia/Shanghai&forceConnectionTimeZoneToSession=true
driver-class-name: com.mysql.cj.jdbc.Driver
username: greptime
password: greptime
expire-time: 30d
```
默认数据库是 URL 中配置的 `hertzbeat` ,将自动创建。 `expire-time` 是自动创建的数据库的 TTL (数据过期)时间,默认为 30 天。
默认数据库是 URL 中配置的 `hertzbeat` ,将自动创建。 `expire-time` 是自动创建的数据库的 TTL (数据过期)时间,默认为 30 天。
2. 重启 HertzBeat
@ -75,4 +75,4 @@ warehouse:
1. 时序数据库 GreptimeDB 或者 IoTDB 或者 TDengine 是否都需要配置,能不能都用
> 不需要都配置,任选其一即可,用enable参数控制其是否使用,也可都不安装配置,只影响历史图表数据。
> 不需要都配置,任选其一即可,用enable参数控制其是否使用,也可都不安装配置,只影响历史图表数据。

View File

@ -24,26 +24,26 @@ InfluxDB是一个由InfluxData开发的开源时序型数据库,专注于海
### 2. 通过Docker方式安装InfluxDB
> 可参考官方网站[安装教程](https://hub.docker.com/_/influxdb)
>
> 1. 下载安装Docker环境
> Docker 工具自身的下载请参考 [Docker官网文档](https://docs.docker.com/get-docker/)。
> 安装完毕后终端查看Docker版本是否正常输出。
>
> ```
> $ docker -v
> Docker version 20.10.12, build e91ed57
> ```
>
> 2. Docker安装InfluxDB 1.x
```shell
$ docker run -p 8086:8086 \
-v /opt/influxdb:/var/lib/influxdb \
influxdb:1.8
```
1. 下载安装Docker环境
Docker 工具自身的下载请参考 [Docker官网文档](https://docs.docker.com/get-docker/)。
安装完毕后终端查看Docker版本是否正常输出。
`-v /opt/influxdb:/var/lib/influxdb` 为influxdb数据目录本地持久化挂载,需将`/opt/influxdb`替换为实际本地存在的目录
使用```$ docker ps```查看数据库是否启动成功
```shell
$ docker -v
Docker version 20.10.12, build e91ed57
```
2. Docker安装InfluxDB 1.x
```shell
$ docker run -p 8086:8086 \
-v /opt/influxdb:/var/lib/influxdb \
influxdb:1.8
```
`-v /opt/influxdb:/var/lib/influxdb` 为influxdb数据目录本地持久化挂载,需将`/opt/influxdb`替换为实际本地存在的目录
使用```$ docker ps```查看数据库是否启动成功
### 在hertzbeat的`application.yml`配置文件配置此数据库连接
@ -51,22 +51,22 @@ $ docker run -p 8086:8086 \
修改位于 `hertzbeat/config/application.yml` 的配置文件
注意⚠️docker容器方式需要将application.yml文件挂载到主机本地,安装包方式解压修改位于 `hertzbeat/config/application.yml` 即可
**修改里面的`warehouse.store.jpa.enabled`参数为`false`, 配置里面的`warehouse.store.influxdb`数据源参数,URL账户密码,并启用`enabled`为`true`**
**修改里面的`warehouse.store.jpa.enabled`参数为`false`, 配置里面的`warehouse.store.influxdb`数据源参数,URL账户密码,并启用`enabled`为`true`**
```yaml
warehouse:
store:
# 关闭默认JPA
jpa:
enabled: false
influxdb:
enabled: true
server-url: http://localhost:8086
username: root
password: root
expire-time: '30d'
replication: 1
```
```yaml
warehouse:
store:
# 关闭默认JPA
jpa:
enabled: false
influxdb:
enabled: true
server-url: http://localhost:8086
username: root
password: root
expire-time: '30d'
replication: 1
```
2. 重启 HertzBeat
@ -74,4 +74,4 @@ warehouse:
1. 时序数据库InfluxDb, IoTDB和TDengine是否都需要配置,能不能都用
> 不需要都配置,任选其一即可,用enable参数控制其是否使用,也可都不安装配置,只影响历史图表数据。
> 不需要都配置,任选其一即可,用enable参数控制其是否使用,也可都不安装配置,只影响历史图表数据。

View File

@ -31,15 +31,15 @@ Apache IoTDB是一体化收集、存储、管理与分析物联网时序数据
2. Docker安装IoTDB
```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
```
```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` 为IoTDB数据目录本地持久化挂载,需将`/iotdb/data`替换为实际本地存在的目录
使用```$ docker ps```查看数据库是否启动成功
`-v /opt/iotdb/data:/iotdb/data` 为IoTDB数据目录本地持久化挂载,需将`/iotdb/data`替换为实际本地存在的目录
使用```$ docker ps```查看数据库是否启动成功
3. 在hertzbeat的`application.yml`配置文件配置IoTDB数据库连接
@ -47,63 +47,63 @@ $ docker run -d -p 6667:6667 -p 31999:31999 -p 8181:8181 \
修改位于 `hertzbeat/config/application.yml` 的配置文件
注意⚠️docker容器方式需要将application.yml文件挂载到主机本地,安装包方式解压修改位于 `hertzbeat/config/application.yml` 即可
**修改里面的`warehouse.store.jpa.enabled`参数为`false`, 配置`warehouse.store.iot-db`数据源参数,HOST账户密码等,并启用`enabled`为`true`**
**修改里面的`warehouse.store.jpa.enabled`参数为`false`, 配置`warehouse.store.iot-db`数据源参数,HOST账户密码等,并启用`enabled`为`true`**
```yaml
warehouse:
store:
# 关闭默认JPA
jpa:
enabled: false
# 启用IotDB
iot-db:
enabled: true
host: 127.0.0.1
rpc-port: 6667
username: root
password: root
# use default queryTimeoutInMs = -1
query-timeout-in-ms: -1
# 数据存储时间:默认'7776000000'(90天,单位为毫秒,-1代表永不过期)
expire-time: '7776000000'
```
```yaml
warehouse:
store:
# 关闭默认JPA
jpa:
enabled: false
# 启用IotDB
iot-db:
enabled: true
host: 127.0.0.1
rpc-port: 6667
username: root
password: root
# use default queryTimeoutInMs = -1
query-timeout-in-ms: -1
# 数据存储时间:默认'7776000000'(90天,单位为毫秒,-1代表永不过期)
expire-time: '7776000000'
```
**IoTDB集群版配置**
如果您使用IoTDB为集群请参考下面配置
**IoTDB集群版配置**
如果您使用IoTDB为集群请参考下面配置
```yaml
warehouse:
store:
# 关闭默认JPA
jpa:
enabled: false
# 启用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
# 数据存储时间:默认'7776000000'(90天,单位为毫秒,-1代表永不过期)
expire-time: '7776000000'
```
```yaml
warehouse:
store:
# 关闭默认JPA
jpa:
enabled: false
# 启用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
# 数据存储时间:默认'7776000000'(90天,单位为毫秒,-1代表永不过期)
expire-time: '7776000000'
```
参数说明:
参数说明:
| 参数名称 | 参数说明 |
|---------------------|-------------------------------------------|
| enabled | 是否启用 |
| host | IoTDB数据库地址 |
| rpc-port | IoTDB数据库端口 |
| node-urls | IoTDB集群地址 |
| username | IoTDB数据库账户 |
| password | IoTDB数据库密码 |
| version | IoTDB数据库版本,已废弃,仅支持V1.* |
| query-timeout-in-ms | 查询超时时间 |
| expire-time | 数据存储时间,默认'7776000000'(90天,单位为毫秒,-1代表永不过期) |
| 参数名称 | 参数说明 |
|---------------------|-------------------------------------------|
| enabled | 是否启用 |
| host | IoTDB数据库地址 |
| rpc-port | IoTDB数据库端口 |
| node-urls | IoTDB集群地址 |
| username | IoTDB数据库账户 |
| password | IoTDB数据库密码 |
| version | IoTDB数据库版本,已废弃,仅支持V1.* |
| query-timeout-in-ms | 查询超时时间 |
| expire-time | 数据存储时间,默认'7776000000'(90天,单位为毫秒,-1代表永不过期) |
> 如果集群配置`node-urls`和单机配置同时设置,以集群`node-urls`配置稳准
> 如果集群配置`node-urls`和单机配置同时设置,以集群`node-urls`配置稳准
4. 重启 HertzBeat
@ -111,15 +111,15 @@ warehouse:
1. 时序数据库IoTDB和TDengine是否都需要配置,能不能都用
> 不需要都配置,任选其一即可,用enable参数控制其是否使用,也可都不安装配置,只影响历史图表数据。
> 不需要都配置,任选其一即可,用enable参数控制其是否使用,也可都不安装配置,只影响历史图表数据。
2. 监控页面历史图表不显示,弹出 [无法提供历史图表数据,请配置依赖时序数据库]
> 如弹窗所示,历史图表展示的前提是需要安装配置hertzbeat的依赖服务 - IotDB数据库或TDengine数据库
> 如弹窗所示,历史图表展示的前提是需要安装配置hertzbeat的依赖服务 - IotDB数据库或TDengine数据库
3. 安装配置了IotDB数据库,但页面依旧显示弹出 [无法提供历史图表数据,请配置依赖时序数据库]
> 请检查配置参数是否正确
> iot-db enable是否设置为true
> 注意⚠️若hertzbeat和IotDB都为docker容器在同一主机下启动,容器之间默认不能用127.0.0.1通讯,改为主机IP
> 可根据logs目录下启动日志排查
> 请检查配置参数是否正确
> iot-db enable是否设置为true
> 注意⚠️若hertzbeat和IotDB都为docker容器在同一主机下启动,容器之间默认不能用127.0.0.1通讯,改为主机IP
> 可根据logs目录下启动日志排查

View File

@ -13,40 +13,40 @@ Apache HertzBeat (incubating) 支持在Linux Windows Mac系统安装运行,CPU
1. 下载安装包
从 [下载页面](/docs/download) 下载您系统环境对应的安装包版本 `apache-hertzbeat-xxx-incubating-bin.tar.gz`
从 [下载页面](/docs/download) 下载您系统环境对应的安装包版本 `apache-hertzbeat-xxx-incubating-bin.tar.gz`
2. 设置配置文件(可选)
解压安装包到主机 eg: /opt/hertzbeat
解压安装包到主机 eg: /opt/hertzbeat
```
tar zxvf apache-hertzbeat-xxx-incubating-bin.tar.gz
```
```shell
tar zxvf apache-hertzbeat-xxx-incubating-bin.tar.gz
```
:::tip
位于 `config/application.yml` 的配置文件,您可以根据需求修改配置文件来配置外部依赖的服务,如数据库,时序数据库等参数。
HertzBeat 启动时默认全使用内部服务,但生产环境建议切换为外部数据库服务。
:::
:::tip
位于 `config/application.yml` 的配置文件,您可以根据需求修改配置文件来配置外部依赖的服务,如数据库,时序数据库等参数。
HertzBeat 启动时默认全使用内部服务,但生产环境建议切换为外部数据库服务。
:::
建议元数据存储使用 [PostgreSQL](postgresql-change), 指标数据存储使用 [VictoriaMetrics](victoria-metrics-init), 具体步骤参见
建议元数据存储使用 [PostgreSQL](postgresql-change), 指标数据存储使用 [VictoriaMetrics](victoria-metrics-init), 具体步骤参见
- [内置 H2 数据库切换为 PostgreSQL](postgresql-change)
- [使用 VictoriaMetrics 存储指标数据](victoria-metrics-init)
- [内置 H2 数据库切换为 PostgreSQL](postgresql-change)
- [使用 VictoriaMetrics 存储指标数据](victoria-metrics-init)
3. 配置账户文件(可选)
HertzBeat 默认内置三个用户账户,分别为 admin/hertzbeat tom/hertzbeat guest/hertzbeat
若需要新增删除修改账户或密码,可以通过修改位于 `config/sureness.yml` 的配置文件实现,具体参考
HertzBeat 默认内置三个用户账户,分别为 admin/hertzbeat tom/hertzbeat guest/hertzbeat
若需要新增删除修改账户或密码,可以通过修改位于 `config/sureness.yml` 的配置文件实现,具体参考
- [配置修改账户密码](account-modify)
- [配置修改账户密码](account-modify)
4. 启动
执行位于安装目录 bin 下的启动脚本 startup.sh, windows 环境下为 startup.bat
执行位于安装目录 bin 下的启动脚本 startup.sh, windows 环境下为 startup.bat
```
./startup.sh
```
```shell
./startup.sh
```
5. 开始探索HertzBeat
浏览器访问 <http://ip:1157/> 即刻开始探索使用HertzBeat,默认账户密码 admin/hertzbeat。
@ -62,44 +62,44 @@ HertzBeat Collector 是一个轻量级的数据采集器,用于采集并将数
1. 下载安装包
从 [下载页面](/docs/download) 下载您系统环境对应的安装包版本 `apache-hertzbeat-collector-xxx-incubating-bin.tar.gz`
从 [下载页面](/docs/download) 下载您系统环境对应的安装包版本 `apache-hertzbeat-collector-xxx-incubating-bin.tar.gz`
2. 设置配置文件
解压安装包到主机 eg: /opt/hertzbeat-collector
解压安装包到主机 eg: /opt/hertzbeat-collector
```
tar zxvf apache-hertzbeat-collector-xxx-incubating-bin.tar.gz
```
```shell
tar zxvf apache-hertzbeat-collector-xxx-incubating-bin.tar.gz
```
配置采集器的配置文件 `config/application.yml` 里面的 HertzBeat Server 连接 IP, 端口, 采集器名称(需保证唯一性)等参数。
配置采集器的配置文件 `config/application.yml` 里面的 HertzBeat Server 连接 IP, 端口, 采集器名称(需保证唯一性)等参数。
```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}
```
```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}
```
> 参数详解
> 参数详解
- `identity` : (可选) 设置采集器的唯一标识名称。注意多采集器时名称需保证唯一性。
- `mode` : 配置运行模式(public or private), 公共集群模式或私有云边模式。
- `manager-host` : 重要, 配置连接的 HertzBeat Server 地址,
- `manager-port` : (可选) 配置连接的 HertzBeat Server 端口,默认 1158.
- `identity` : (可选) 设置采集器的唯一标识名称。注意多采集器时名称需保证唯一性。
- `mode` : 配置运行模式(public or private), 公共集群模式或私有云边模式。
- `manager-host` : 重要, 配置连接的 HertzBeat Server 地址,
- `manager-port` : (可选) 配置连接的 HertzBeat Server 端口,默认 1158.
3. 启动
执行位于安装目录 hertzbeat-collector/bin/ 下的启动脚本 startup.sh, windows 环境下为 startup.bat
执行位于安装目录 hertzbeat-collector/bin/ 下的启动脚本 startup.sh, windows 环境下为 startup.bat
```
./startup.sh
```
```shell
./startup.sh
```
4. 开始探索 HertzBeat Collector
浏览器访问 <http://ip:1157/> 即可开始探索使用,默认账户密码 admin/hertzbeat。
@ -114,22 +114,22 @@ collector:
1. 启动失败,需您提前准备JAVA运行环境
安装JAVA运行环境-可参考[官方网站](http://www.oracle.com/technetwork/java/javase/downloads/index.html)
要求:JAVA17环境
下载JAVA安装包: [镜像站](https://repo.huaweicloud.com/java/jdk/)
安装后命令行检查是否成功安装
安装JAVA运行环境-可参考[官方网站](http://www.oracle.com/technetwork/java/javase/downloads/index.html)
要求:JAVA17环境
下载JAVA安装包: [镜像站](https://repo.huaweicloud.com/java/jdk/)
安装后命令行检查是否成功安装
```
$ 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)
```
```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. 按照流程部署,访问 <http://ip:1157/> 无界面
请参考下面几点排查问题:
> 一:若切换了依赖服务MYSQL数据库,排查数据库是否成功创建,是否启动成功
> 二:HertzBeat的配置文件 `hertzbeat/config/application.yml` 里面的依赖服务IP账户密码等配置是否正确
> 三:若都无问题可以查看 `hertzbeat/logs/` 目录下面的运行日志是否有明显错误,提issue或交流群或社区反馈
> 一:若切换了依赖服务MYSQL数据库,排查数据库是否成功创建,是否启动成功
> 二:HertzBeat的配置文件 `hertzbeat/config/application.yml` 里面的依赖服务IP账户密码等配置是否正确
> 三:若都无问题可以查看 `hertzbeat/logs/` 目录下面的运行日志是否有明显错误,提issue或交流群或社区反馈

View File

@ -16,24 +16,24 @@ sidebar_label: 快速开始
1. `docker` 环境仅需一条命令即可开始
```docker run -d -p 1157:1157 -p 1158:1158 --name hertzbeat apache/hertzbeat```
```docker run -d -p 1157:1157 -p 1158:1158 --name hertzbeat apache/hertzbeat```
```或者使用 quay.io (若 dockerhub 网络链接超时)```
```或者使用 quay.io (若 dockerhub 网络链接超时)```
```docker run -d -p 1157:1157 -p 1158:1158 --name hertzbeat quay.io/tancloud/hertzbeat```
```docker run -d -p 1157:1157 -p 1158:1158 --name hertzbeat quay.io/tancloud/hertzbeat```
2. 浏览器访问 `http://localhost:1157` 即可开始,默认账号密码 `admin/hertzbeat`
3. 部署采集器集群(可选)
```
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
```
```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` : 配置此采集器的唯一性标识符名称,多个采集器名称不能相同,建议自定义英文名称。
- `-e MODE=public` : 配置运行模式(public or private), 公共集群模式或私有云边模式。
- `-e MANAGER_HOST=127.0.0.1` : 配置连接主HertzBeat服务的对外IP。
- `-e MANAGER_PORT=1158` : 配置连接主HertzBeat服务的对外端口,默认1158。
- `-e IDENTITY=custom-collector-name` : 配置此采集器的唯一性标识符名称,多个采集器名称不能相同,建议自定义英文名称。
- `-e MODE=public` : 配置运行模式(public or private), 公共集群模式或私有云边模式。
- `-e MANAGER_HOST=127.0.0.1` : 配置连接主HertzBeat服务的对外IP。
- `-e MANAGER_PORT=1158` : 配置连接主HertzBeat服务的对外端口,默认1158。
更多配置详细步骤参考 [通过Docker方式安装HertzBeat](docker-deploy)

View File

@ -18,7 +18,7 @@ github: <https://github.com/apache/hertzbeat>
1. `docker` 环境仅需一条命令即可安装
`docker run -d -p 1157:1157 --name hertzbeat apache/hertzbeat`
`docker run -d -p 1157:1157 --name hertzbeat apache/hertzbeat`
2. 安装成功浏览器访问 `localhost:1157` 即可开始,默认账号密码 `admin/hertzbeat`
@ -26,63 +26,64 @@ github: <https://github.com/apache/hertzbeat>
1. 点击新增SSL证书监控
> 系统页面 -> 监控菜单 -> SSL证书 -> 新增SSL证书
> 系统页面 -> 监控菜单 -> SSL证书 -> 新增SSL证书
![](/img/docs/start/ssl_1.png)
![](/img/docs/start/ssl_1.png)
2. 配置监控网站
> 我们这里举例监控百度网站, 配置监控host域名,名称,采集间隔等。
> 点击确定 注意⚠️新增前默认会先去测试网站连接性,连接成功才会新增,当然也可以把**是否测试**按钮置灰。
> 我们这里举例监控百度网站, 配置监控host域名,名称,采集间隔等。
>
> 点击确定 注意⚠️新增前默认会先去测试网站连接性,连接成功才会新增,当然也可以把**是否测试**按钮置灰。
![](/img/docs/start/ssl_2.png)
![](/img/docs/start/ssl_2.png)
3. 查看检测指标数据
> 在监控列表可以查看任务状态,进监控详情可以查看指标数据图表等。
> 在监控列表可以查看任务状态,进监控详情可以查看指标数据图表等。
![](/img/docs/start/ssl_3.png)
![](/img/docs/start/ssl_3.png)
![](/img/docs/start/ssl_11.png)
![](/img/docs/start/ssl_11.png)
4. 设置阈值(证书过期时触发)
> 系统页面 -> 告警 -> 告警阈值 -> 新增阈值
> 系统页面 -> 告警 -> 告警阈值 -> 新增阈值
![](/img/docs/start/ssl_4.png)
![](/img/docs/start/ssl_4.png)
> 配置阈值,选择SSL证书指标对象,配置告警表达式-当指标`expired`为`true`触发,即`equals(expired,"true")` , 设置告警级别通知模版信息等。
> 配置阈值,选择SSL证书指标对象,配置告警表达式-当指标`expired`为`true`触发,即`equals(expired,"true")` , 设置告警级别通知模版信息等。
![](/img/docs/start/ssl_5.png)
![](/img/docs/start/ssl_5.png)
> 关联阈值与监控, 在阈值列表设置此阈值应用于哪些监控。
> 关联阈值与监控, 在阈值列表设置此阈值应用于哪些监控。
![](/img/docs/start/ssl_6.png)
![](/img/docs/start/ssl_6.png)
5. 设置阈值(证书过期前一周触发)
> 同理如上,新增配置阈值,配置告警表达式-当指标有效期时间戳 `end_timestamp`,`now()`函数为当前时间戳,若配置提前一周触发告警即:`end_timestamp <= (now() + 604800000)` , 其中 `604800000` 为7天总时间差毫秒值。
> 同理如上,新增配置阈值,配置告警表达式-当指标有效期时间戳 `end_timestamp`,`now()`函数为当前时间戳,若配置提前一周触发告警即:`end_timestamp <= (now() + 604800000)` , 其中 `604800000` 为7天总时间差毫秒值。
![](/img/docs/start/ssl_7.png)
![](/img/docs/start/ssl_7.png)
> 最终可以在告警中心看到已触发的告警。
> 最终可以在告警中心看到已触发的告警。
![](/img/docs/start/ssl_8.png)
![](/img/docs/start/ssl_8.png)
6. 告警通知(通过钉钉微信飞书等及时通知)
> 监控系统 -> 告警通知 -> 新增接收人
> 监控系统 -> 告警通知 -> 新增接收人
![](/img/docs/start/ssl_9.png)
![](/img/docs/start/ssl_9.png)
钉钉微信飞书等token配置可以参考帮助文档
钉钉微信飞书等token配置可以参考帮助文档
<https://hertzbeat.apache.org/docs/help/alert_dingtalk>
<https://tancloud.cn/docs/help/alert_dingtalk>
<https://hertzbeat.apache.org/docs/help/alert_dingtalk>
<https://tancloud.cn/docs/help/alert_dingtalk>
> 告警通知 -> 新增告警通知策略 -> 将刚才配置的接收人启用通知
> 告警通知 -> 新增告警通知策略 -> 将刚才配置的接收人启用通知
![](/img/docs/start/ssl_10.png)
![](/img/docs/start/ssl_10.png)
7. OK 当阈值触发后我们就可以收到对应告警消息啦,如果没有配通知,也可以在告警中心查看告警信息。

View File

@ -18,28 +18,28 @@ TDengine是一款开源物联网时序型数据库,我们用其存储采集到
### 通过Docker方式安装TDengine
> 可参考官方网站[安装教程](https://docs.taosdata.com/get-started/docker/)
>
> 1. 下载安装Docker环境
> Docker 工具自身的下载请参考 [Docker官网文档](https://docs.docker.com/get-docker/)。
> 安装完毕后终端查看Docker版本是否正常输出。
>
> ```
> $ docker -v
> Docker version 20.10.12, build e91ed57
> ```
>
> 2. Docker安装TDengine
```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
```
1. 下载安装Docker环境
Docker 工具自身的下载请参考 [Docker官网文档](https://docs.docker.com/get-docker/)。
安装完毕后终端查看Docker版本是否正常输出。
`-v /opt/taosdata:/var/lib/taos` 为tdengine数据目录本地持久化挂载,需将`/opt/taosdata`替换为实际本地存在的目录
`-e TZ="Asia/Shanghai"` 为tdengine设置时区,这里可选设置对应的时区
使用```$ docker ps```查看数据库是否启动成功
```shell
$ docker -v
Docker version 20.10.12, build e91ed57
```
2. Docker安装TDengine
```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` 为tdengine数据目录本地持久化挂载,需将`/opt/taosdata`替换为实际本地存在的目录
`-e TZ="Asia/Shanghai"` 为tdengine设置时区,这里可选设置对应的时区
使用```$ docker ps```查看数据库是否启动成功
### 创建数据库实例
@ -47,7 +47,7 @@ $ docker run -d -p 6030-6049:6030-6049 -p 6030-6049:6030-6049/udp \
1. 进入数据库Docker容器
```
```shell
docker exec -it tdengine /bin/bash
```
@ -69,7 +69,7 @@ $ docker run -d -p 6030-6049:6030-6049 -p 6030-6049:6030-6049/udp \
执行创建数据库命令
```
```shell
taos> show databases;
taos> CREATE DATABASE hertzbeat KEEP 90 DURATION 10 BUFFER 16;
```
@ -78,7 +78,7 @@ $ docker run -d -p 6030-6049:6030-6049 -p 6030-6049:6030-6049/udp \
4. 查看hertzbeat数据库是否成功创建
```
```shell
taos> show databases;
taos> use hertzbeat;
```
@ -99,21 +99,21 @@ $ docker run -d -p 6030-6049:6030-6049 -p 6030-6049:6030-6049/udp \
修改位于 `hertzbeat/config/application.yml` 的配置文件
注意⚠️docker容器方式需要将application.yml文件挂载到主机本地,安装包方式解压修改位于 `hertzbeat/config/application.yml` 即可
**修改里面的`warehouse.store.jpa.enabled`参数为`false`, 配置里面的`warehouse.store.td-engine`数据源参数,URL账户密码,并启用`enabled`为`true`**
**修改里面的`warehouse.store.jpa.enabled`参数为`false`, 配置里面的`warehouse.store.td-engine`数据源参数,URL账户密码,并启用`enabled`为`true`**
```yaml
warehouse:
store:
# 关闭默认JPA
jpa:
enabled: false
td-engine:
enabled: true
driver-class-name: com.taosdata.jdbc.rs.RestfulDriver
url: jdbc:TAOS-RS://localhost:6041/hertzbeat
username: root
password: taosdata
```
```yaml
warehouse:
store:
# 关闭默认JPA
jpa:
enabled: false
td-engine:
enabled: true
driver-class-name: com.taosdata.jdbc.rs.RestfulDriver
url: jdbc:TAOS-RS://localhost:6041/hertzbeat
username: root
password: taosdata
```
2. 重启 HertzBeat
@ -121,19 +121,19 @@ warehouse:
1. 时序数据库IoTDB和TDengine是否都需要配置,能不能都用
> 不需要都配置,任选其一即可,用enable参数控制其是否使用,也可都不安装配置,只影响历史图表数据。
> 不需要都配置,任选其一即可,用enable参数控制其是否使用,也可都不安装配置,只影响历史图表数据。
2. 监控页面历史图表不显示,弹出 [无法提供历史图表数据,请配置依赖时序数据库]
> 如弹窗所示,历史图表展示的前提是需要安装配置hertzbeat的依赖服务 - IotDB数据库或TDengine数据库
> 如弹窗所示,历史图表展示的前提是需要安装配置hertzbeat的依赖服务 - IotDB数据库或TDengine数据库
3. 监控详情历史图片不展示或无数据,已经配置了TDengine
> 请确认是否安装的TDengine版本为3.0以上,版本2.x不支持兼容
> 请确认是否安装的TDengine版本为3.0以上,版本2.x不支持兼容
4. 安装配置了TDengine数据库,但页面依旧显示弹出 [无法提供历史图表数据,请配置依赖时序数据库]
> 请检查配置参数是否正确
> td-engine enable是否设置为true
> 注意⚠️若hertzbeat和TDengine都为docker容器在同一主机下启动,容器之间默认不能用127.0.0.1通讯,改为主机IP
> 可根据logs目录下启动日志排查
> 请检查配置参数是否正确
> td-engine enable是否设置为true
> 注意⚠️若hertzbeat和TDengine都为docker容器在同一主机下启动,容器之间默认不能用127.0.0.1通讯,改为主机IP
> 可根据logs目录下启动日志排查

View File

@ -14,184 +14,184 @@ sidebar_label: 1.6.0升级指南
1. 升级Java环境
由于1.6.0版本使用Java17,且安装包不再提供内置jdk的版本,参考以下情况使用新版Hertzbeat。
由于1.6.0版本使用Java17,且安装包不再提供内置jdk的版本,参考以下情况使用新版Hertzbeat。
- 当你的服务器中默认环境变量为Java17时,这一步你无需任何操作。
- 当你的服务器中默认环境变量不为Java17时,如Java8、Java11,若你服务器中**没有**其他应用需要低版本Java,根据你的系统,到 [https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html](https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html) 选择相应的发行版下载,并在搜索引擎搜索如何设置新的环境变量指向新的Java17。
- 当你的服务器中默认环境变量不为Java17时,如Java8、Java11,若你服务器中**有**其他应用需要低版本Java,根据你的系统,到 [https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html](https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html) 选择相应的发行版下载,并将解压后的文件夹重命名为java,复制到Hertzbeat的解压目录下。
- 当你的服务器中默认环境变量为Java17时,这一步你无需任何操作。
- 当你的服务器中默认环境变量不为Java17时,如Java8、Java11,若你服务器中**没有**其他应用需要低版本Java,根据你的系统,到 [https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html](https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html) 选择相应的发行版下载,并在搜索引擎搜索如何设置新的环境变量指向新的Java17。
- 当你的服务器中默认环境变量不为Java17时,如Java8、Java11,若你服务器中**有**其他应用需要低版本Java,根据你的系统,到 [https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html](https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html) 选择相应的发行版下载,并将解压后的文件夹重命名为java,复制到Hertzbeat的解压目录下。
2. 升级数据库
打开[https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/db/migration](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/db/migration),
选择你使用的数据库的目录下相应的 `V160__update_column.sql`文件执行升级sql。
打开[https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/db/migration](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/db/migration),
选择你使用的数据库的目录下相应的 `V160__update_column.sql`文件执行升级sql。
3. 升级配置文件
由于 `application.yml``sureness.yml`更新变动较大,建议直接使用新的yml配置文件,然后在自己的需求基础上进行修改。
由于 `application.yml``sureness.yml`更新变动较大,建议直接使用新的yml配置文件,然后在自己的需求基础上进行修改。
- `application.yml`一般需要修改以下部分
- `application.yml`一般需要修改以下部分
默认为:
默认为:
```yaml
datasource:
driver-class-name: org.h2.Driver
username: sa
password: 123456
url: jdbc:h2:./data/hertzbeat;MODE=MYSQL
hikari:
max-lifetime: 120000
```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
```
jpa:
show-sql: false
database-platform: org.eclipse.persistence.platform.database.MySQLPlatform
database: h2
properties:
eclipselink:
logging:
level: SEVERE
```
如若修改为mysql数据库,给出一个示例:
如若修改为mysql数据库,给出一个示例:
```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
```
```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
- `sureness.yml`修改是可选的,一般在你需要修改账号密码时
jpa:
show-sql: false
database-platform: org.eclipse.persistence.platform.database.MySQLPlatform
database: mysql
properties:
eclipselink:
logging:
level: SEVERE
```
- `sureness.yml`修改是可选的,一般在你需要修改账号密码时
```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]
```
```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]
```
4. 添加相应的数据库驱动
由于apache基金会对于license合规的要求,HertzBeat的安装包不能包含mysql,oracle等gpl许可的依赖,需要用户自行添加,用户可通过以下链接自行下载驱动,复制到安装目录下`ext-lib`中。
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.18.zip)
oracle(如果你要监控oracle,这两个驱动是必须的)
[https://download.oracle.com/otn-pub/otn_software/jdbc/234/ojdbc8.jar](https://download.oracle.com/otn-pub/otn_software/jdbc/234/ojdbc8.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?utm_source=mavenlibs.com)
接下来,像之前那样运行启动脚本,即可体验最新的HertzBeat1.6.0!
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.18.zip)
oracle(如果你要监控oracle,这两个驱动是必须的):
[https://download.oracle.com/otn-pub/otn_software/jdbc/234/ojdbc8.jar](https://download.oracle.com/otn-pub/otn_software/jdbc/234/ojdbc8.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?utm_source=mavenlibs.com)
接下来,像之前那样运行启动脚本,即可体验最新的HertzBeat1.6.0!
### Docker 方式升级 - Mysql数据库
1. 关闭 HertzBeat 容器
```
docker stop hertzbeat
```
```shell
docker stop hertzbeat
```
2. 升级数据库脚本
打开[https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/db/migration](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/db/migration),
选择你使用的数据库的目录下相应的 `V160__update_column.sql`文件在 Mysql 执行升级sql。
打开[https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/db/migration](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/db/migration),
选择你使用的数据库的目录下相应的 `V160__update_column.sql`文件在 Mysql 执行升级sql。
3. 升级配置文件
由于 `application.yml``sureness.yml`更新变动较大,建议直接挂载使用新的yml配置文件,然后在自己的需求基础上进行修改。
由于 `application.yml``sureness.yml`更新变动较大,建议直接挂载使用新的yml配置文件,然后在自己的需求基础上进行修改。
- `application.yml`一般需要修改以下部分
- `application.yml`一般需要修改以下部分
默认为:
默认为:
```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
```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
```
jpa:
show-sql: false
database-platform: org.eclipse.persistence.platform.database.MySQLPlatform
database: mysql
properties:
eclipselink:
logging:
level: SEVERE
```
- `sureness.yml`修改是可选的,一般在你需要修改账号密码时
- `sureness.yml`修改是可选的,一般在你需要修改账号密码时
```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]
```
```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]
```
4. 添加相应的数据库驱动
由于apache基金会对于license合规的要求,HertzBeat的安装包不能包含mysql,oracle等gpl许可的依赖,需要用户自行添加,用户可通过以下链接自行下载驱动 jar 放到本地 `ext-lib`目录下,然后启动时将`ext-lib`挂载到容器的 `/opt/hertzbeat/ext-lib`目录。
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.18.zip)
oracle(如果你要监控oracle,这两个驱动是必须的)
[https://download.oracle.com/otn-pub/otn_software/jdbc/234/ojdbc8.jar](https://download.oracle.com/otn-pub/otn_software/jdbc/234/ojdbc8.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?utm_source=mavenlibs.com)
接下来,像之前那样 Docker 运行启动 HertzBeat,即可体验最新的HertzBeat1.6.0!
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.18.zip)
oracle(如果你要监控oracle,这两个驱动是必须的)
[https://download.oracle.com/otn-pub/otn_software/jdbc/234/ojdbc8.jar](https://download.oracle.com/otn-pub/otn_software/jdbc/234/ojdbc8.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?utm_source=mavenlibs.com)
接下来,像之前那样 Docker 运行启动 HertzBeat,即可体验最新的HertzBeat1.6.0!
### Docker安装升级 - H2内置数据库(生产环境不推荐使用H2)
1. 关闭 HertzBeat 容器
```
docker stop hertzbeat
```
```shell
docker stop hertzbeat
```
2. 编辑H2数据库文件
@ -199,75 +199,75 @@ docker stop hertzbeat
下载 h2 驱动 jar [https://mvnrepository.com/artifact/com.h2database/h2/2.2.220](https://mvnrepository.com/artifact/com.h2database/h2/2.2.220)
使用 h2 驱动 jar 本地启动数据库
```
java -jar h2-2.2.220.jar -url jdbc:h2:file:./hertzbeat -user sa -password 123456
```
```shell
java -jar h2-2.2.220.jar -url jdbc:h2:file:./hertzbeat -user sa -password 123456
```
打开[https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/db/migration](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/db/migration),
选择你使用的数据库的目录下相应的 `V160__update_column.sql`文件在 H2 执行升级sql。
打开[https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/db/migration](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/db/migration),
选择你使用的数据库的目录下相应的 `V160__update_column.sql`文件在 H2 执行升级sql。
3. 升级配置文件
由于 `application.yml``sureness.yml`更新变动较大,建议直接挂载使用新的yml配置文件,然后在自己的需求基础上进行修改。
由于 `application.yml``sureness.yml`更新变动较大,建议直接挂载使用新的yml配置文件,然后在自己的需求基础上进行修改。
- `application.yml`一般需要修改以下部分
- `application.yml`一般需要修改以下部分
默认为:
默认为:
```yaml
datasource:
driver-class-name: org.h2.Driver
username: sa
password: 123456
url: jdbc:h2:./data/hertzbeat;MODE=MYSQL
hikari:
max-lifetime: 120000
```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
```
jpa:
show-sql: false
database-platform: org.eclipse.persistence.platform.database.MySQLPlatform
database: h2
properties:
eclipselink:
logging:
level: SEVERE
```
- `sureness.yml`修改是可选的,一般在你需要修改账号密码时
- `sureness.yml`修改是可选的,一般在你需要修改账号密码时
```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]
```
```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]
```
4. 添加相应的数据库驱动
由于apache基金会对于license合规的要求,HertzBeat的安装包不能包含mysql,oracle等gpl许可的依赖,需要用户自行添加,用户可通过以下链接自行下载驱动 jar 放到本地 `ext-lib`目录下,然后启动时将`ext-lib`挂载到容器的 `/opt/hertzbeat/ext-lib`目录。
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.18.zip)
oracle(如果你要监控oracle,这两个驱动是必须的)
[https://download.oracle.com/otn-pub/otn_software/jdbc/234/ojdbc8.jar](https://download.oracle.com/otn-pub/otn_software/jdbc/234/ojdbc8.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?utm_source=mavenlibs.com)
接下来,像之前那样 Docker 运行启动,即可体验最新的HertzBeat1.6.0!
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.18.zip)
oracle(如果你要监控oracle,这两个驱动是必须的)
[https://download.oracle.com/otn-pub/otn_software/jdbc/234/ojdbc8.jar](https://download.oracle.com/otn-pub/otn_software/jdbc/234/ojdbc8.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?utm_source=mavenlibs.com)
接下来,像之前那样 Docker 运行启动,即可体验最新的HertzBeat1.6.0!
### 通过导出导入升级

View File

@ -18,49 +18,49 @@ VictoriaMetrics,是一个快速高效、经济并且可扩展的监控解决
### 通过Docker方式安装VictoriaMetrics
> 可参考官方网站[安装教程](https://docs.victoriametrics.com/Quick-Start.html#how-to-install)
>
> 1. 下载安装Docker环境
> Docker 工具自身的下载请参考 [Docker官网文档](https://docs.docker.com/get-docker/)。
> 安装完毕后终端查看Docker版本是否正常输出。
>
> ```
> $ docker -v
> Docker version 20.10.12, build e91ed57
> ```
>
> 2. Docker安装VictoriaMetrics
```shell
$ docker run -d -p 8428:8428 \
-v $(pwd)/victoria-metrics-data:/victoria-metrics-data \
--name victoria-metrics \
victoriametrics/victoria-metrics:v1.95.1
```
1. 下载安装Docker环境
Docker 工具自身的下载请参考 [Docker官网文档](https://docs.docker.com/get-docker/)。
安装完毕后终端查看Docker版本是否正常输出。
`-v $(pwd)/victoria-metrics-data:/victoria-metrics-data` 为VictoriaMetrics数据目录本地持久化挂载
使用```$ docker ps```查看数据库是否启动成功
```shell
$ docker -v
Docker version 20.10.12, build e91ed57
```
2. Docker安装VictoriaMetrics
```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` 为VictoriaMetrics数据目录本地持久化挂载
使用```$ docker ps```查看数据库是否启动成功
3. 在hertzbeat的`application.yml`配置文件配置VictoriaMetrics数据库连接
配置HertzBeat的配置文件
修改位于 `hertzbeat/config/application.yml` 的配置文件
配置HertzBeat的配置文件
修改位于 `hertzbeat/config/application.yml` 的配置文件
注意⚠️docker容器方式需要将application.yml文件挂载到主机本地,安装包方式解压修改位于 `hertzbeat/config/application.yml` 即可
**修改里面的`warehouse.store.jpa.enabled`参数为`false`, 配置`warehouse.store.victoria-metrics`数据源参数,HOST账户密码等,并启用`enabled`为`true`**
**修改里面的`warehouse.store.jpa.enabled`参数为`false`, 配置`warehouse.store.victoria-metrics`数据源参数,HOST账户密码等,并启用`enabled`为`true`**
```yaml
warehouse:
store:
# 关闭默认JPA
jpa:
enabled: false
# 启用 victoria-metrics
victoria-metrics:
enabled: true
url: http://localhost:8428
username: root
password: root
```
```yaml
warehouse:
store:
# 关闭默认JPA
jpa:
enabled: false
# 启用 victoria-metrics
victoria-metrics:
enabled: true
url: http://localhost:8428
username: root
password: root
```
4. 重启 HertzBeat
@ -68,4 +68,4 @@ warehouse:
1. 时序数据库是否都需要配置,能不能都用
> 不需要都配置,任选其一即可,用enable参数控制其是否使用,也可都不安装配置,但会影响历史图表数据和存储时长等。
> 不需要都配置,任选其一即可,用enable参数控制其是否使用,也可都不安装配置,但会影响历史图表数据和存储时长等。

Some files were not shown because too many files have changed in this diff Show More