Skip to content

Commit f4858d5

Browse files
zqr10159tomsun28
andauthored
[feat]: Native collector (#4066)
Co-authored-by: Tomsun28 <tomsun28@outlook.com>
1 parent 07fd5b2 commit f4858d5

74 files changed

Lines changed: 1601 additions & 183 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
name: Collector Native Release
19+
20+
run-name: Native collector release build (${{ github.ref_name }})
21+
22+
on:
23+
workflow_dispatch:
24+
25+
jobs:
26+
build-native-collector:
27+
name: Native collector (${{ matrix.platform }})
28+
permissions:
29+
contents: read
30+
timeout-minutes: 120
31+
runs-on: ${{ matrix.runner }}
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
include:
36+
- platform: linux-amd64
37+
runner: ubuntu-24.04
38+
archive_ext: tar.gz
39+
- platform: linux-arm64
40+
runner: ubuntu-24.04-arm
41+
archive_ext: tar.gz
42+
- platform: macos-amd64
43+
runner: macos-13
44+
archive_ext: tar.gz
45+
- platform: macos-arm64
46+
runner: macos-14
47+
archive_ext: tar.gz
48+
- platform: windows-amd64
49+
runner: windows-latest
50+
archive_ext: zip
51+
52+
steps:
53+
- uses: actions/checkout@v4
54+
55+
- name: Set up GraalVM JDK 25
56+
uses: graalvm/setup-graalvm@v1
57+
with:
58+
distribution: graalvm-community
59+
java-version: '25'
60+
github-token: ${{ secrets.GITHUB_TOKEN }}
61+
cache: maven
62+
native-image-job-reports: 'true'
63+
64+
- name: Verify toolchain
65+
shell: pwsh
66+
run: |
67+
java -version
68+
native-image --version
69+
mvn -version
70+
71+
- name: Build native collector package
72+
run: mvn -B -pl hertzbeat-collector/hertzbeat-collector-collector -am -Pnative -DskipTests package
73+
74+
- name: Locate native collector package
75+
id: package
76+
shell: pwsh
77+
run: |
78+
$package = Get-ChildItem -Path "dist/apache-hertzbeat-collector-native-*-${{ matrix.platform }}-bin.${{ matrix.archive_ext }}" | Select-Object -First 1
79+
if (-not $package) {
80+
throw "Native collector package not found for ${{ matrix.platform }}"
81+
}
82+
"archive=$($package.FullName)" >> $env:GITHUB_OUTPUT
83+
84+
- name: Upload native collector package
85+
uses: actions/upload-artifact@v4
86+
with:
87+
name: apache-hertzbeat-collector-native-${{ matrix.platform }}
88+
path: ${{ steps.package.outputs.archive }}
89+
retention-days: 14

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Even small corrections to typos are very welcome :)
3232

3333
#### Backend start
3434

35-
1. Requires `maven3+`, `java21` and `lombok` environments
35+
1. Requires `maven3+`, `java25` and `lombok` environments
3636

3737
2. (Optional) Modify the configuration file: `hertzbeat-startup/src/main/resources/application.yml`
3838

@@ -172,7 +172,7 @@ Add WeChat account `ahertzbeat` to pull you into the WeChat group.
172172
173173
#### 后端启动
174174
175-
1. 需要 `maven3+`, `java21` 和 `lombok` 环境
175+
1. 需要 `maven3+`, `java25` 和 `lombok` 环境
176176
177177
2. (可选)修改配置文件配置信息-`hertzbeat-startup/src/main/resources/application.yml`
178178

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,12 @@ Detailed config refer to [Install HertzBeat via Docker](https://hertzbeat.apache
130130

131131
##### 2:Install via package
132132

133-
1. Download the release package `hertzbeat-xx.tar.gz` [Download](https://hertzbeat.apache.org/docs/download)
133+
1. Download the release package `apache-hertzbeat-xx-bin.tar.gz` [Download](https://hertzbeat.apache.org/docs/download)
134134
2. Configure the HertzBeat configuration yml file `hertzbeat/config/application.yml` (optional)
135135
3. Run command `$ ./bin/startup.sh ` or `bin/startup.bat`
136136
4. Access `http://localhost:1157` to start, default account: `admin/hertzbeat`
137137
5. Deploy collector clusters (Optional)
138-
- Download the release package `hertzbeat-collector-xx.tar.gz` to new machine [Download](https://hertzbeat.apache.org/docs/download)
138+
- Download the release package `apache-hertzbeat-collector-xx-bin.tar.gz` (JVM collector) or the native collector package for your platform, such as `apache-hertzbeat-collector-native-xx-linux-amd64-bin.tar.gz` or `apache-hertzbeat-collector-native-xx-windows-amd64-bin.zip`, to the new machine [Download](https://hertzbeat.apache.org/docs/download)
139139
- Configure the collector configuration yml file `hertzbeat-collector/config/application.yml`: unique `identity` name, running `mode` (public or private), hertzbeat `manager-host`, hertzbeat `manager-port`
140140
```yaml
141141
collector:
@@ -148,15 +148,16 @@ Detailed config refer to [Install HertzBeat via Docker](https://hertzbeat.apache
148148
manager-host: ${MANAGER_HOST:127.0.0.1}
149149
manager-port: ${MANAGER_PORT:1158}
150150
```
151-
- Run command `$ ./bin/startup.sh ` or `bin/startup.bat`
151+
- If you need MySQL, OceanBase, Oracle, or DB2 monitoring with external JDBC drivers from `ext-lib`, use the JVM collector package.
152+
- Run `$ ./bin/startup.sh ` or `bin/startup.bat` for the JVM collector package. Run `$ ./bin/startup.sh ` for Linux or macOS native collector packages, and `bin\\startup.bat` for the Windows native collector package.
152153
- Access `http://localhost:1157` and you will see the registered new collector in dashboard
153154

154155
Detailed config refer to [Install HertzBeat via Package](https://hertzbeat.apache.org/docs/start/package-deploy)
155156

156157
##### 3:Start via source code
157158

158159
1. Local source code debugging needs to start the back-end project `hertzbeat-startup` and the front-end project `web-app`.
159-
2. Backend:need `maven3+`, `java21`, `lombok`, add VM options in IDE: ` --add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED `, then start the `hertzbeat-startup` service.
160+
2. Backend:need `maven3+`, `java25`, `lombok`, add VM options in IDE: ` --add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED `, then start the `hertzbeat-startup` service.
160161
3. Web:need `nodejs npm angular-cli` environment, Run `ng serve --open` in `web-app` directory after backend startup.
161162
4. Access `http://localhost:4200` to start, default account: `admin/hertzbeat`
162163

README_CN.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,12 @@
127127

128128
##### 方式二:通过安装包安装
129129

130-
1. 下载您系统环境对应的安装包 `hertzbeat-xx.tar.gz` [Download](https://hertzbeat.apache.org/docs/download)
130+
1. 下载您系统环境对应的安装包 `apache-hertzbeat-xx-bin.tar.gz` [Download](https://hertzbeat.apache.org/docs/download)
131131
2. 配置 HertzBeat 的配置文件 `hertzbeat/config/application.yml` (可选)
132132
3. 部署启动 `$ ./bin/startup.sh ``bin/startup.bat`
133133
4. 浏览器访问 `http://localhost:1157` 即可开始,默认账号密码 `admin/hertzbeat`
134134
5. 部署采集器集群(可选)
135-
- 下载采集器安装包 `hertzbeat-collector-xx.tar.gz` 到规划的另一台部署主机上 [Download](https://hertzbeat.apache.org/docs/download)
135+
- 下载采集器安装包 `apache-hertzbeat-collector-xx-bin.tar.gz`(JVM 采集器)或与你目标平台匹配的 Native 采集器安装包,例如 `apache-hertzbeat-collector-native-xx-linux-amd64-bin.tar.gz``apache-hertzbeat-collector-native-xx-windows-amd64-bin.zip`到规划的另一台部署主机上 [Download](https://hertzbeat.apache.org/docs/download)
136136
- 配置采集器的配置文件 `hertzbeat-collector/config/application.yml` 里面的连接主 HertzBeat 服务的对外 IP,端口,当前采集器名称(需保证唯一性)等参数 `identity` `mode` (public or private) `manager-host` `manager-port`
137137
```yaml
138138
collector:
@@ -145,15 +145,16 @@
145145
manager-host: ${MANAGER_HOST:127.0.0.1}
146146
manager-port: ${MANAGER_PORT:1158}
147147
```
148-
- 启动 `$ ./bin/startup.sh ` 或 `bin/startup.bat`
148+
- 如果需要通过 `ext-lib` 加载 MySQL、OceanBase、Oracle、DB2 等外置 JDBC 驱动,请使用 JVM 采集器安装包。
149+
- JVM 采集器安装包使用 `$ ./bin/startup.sh ` 或 `bin/startup.bat` 启动。Linux 或 macOS 的 Native 采集器安装包使用 `$ ./bin/startup.sh ` 启动,Windows 的 Native 采集器安装包使用 `bin\\startup.bat` 启动
149150
- 浏览器访问主 HertzBeat 服务 `http://localhost:1157` 查看概览页面即可看到注册上来的新采集器
150151

151152
更多配置详细步骤参考 [通过安装包安装HertzBeat](https://hertzbeat.apache.org/docs/start/package-deploy)
152153

153154
##### 方式三:本地代码启动
154155

155156
1. 此为前后端分离项目,本地代码调试需要分别启动后端工程 `hertzbeat-startup` 和前端工程 `web-app`
156-
2. 后端:需要 `maven3+`, `java21` 和 `lombok` 环境,修改 `YML` 配置信息,添加JVM参数`--add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED`后启动 `hertzbeat-startup` 服务即可。
157+
2. 后端:需要 `maven3+`, `java25` 和 `lombok` 环境,修改 `YML` 配置信息,添加JVM参数`--add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED`后启动 `hertzbeat-startup` 服务即可。
157158
3. 前端:需要 `nodejs npm angular-cli`环境,待本地后端启动后,在 `web-app` 目录下启动 `ng serve --open`
158159
4. 浏览器访问 `http://localhost:4200` 即可开始,默认账号密码 `admin/hertzbeat`
159160

README_JP.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108
docker run -d -p 1157:1157 -p 1158:1158 --name hertzbeat apache/hertzbeat
109109
```
110110

111-
2. スタート:`http://localhost:4200`にアクセスします。デフォルトのアカウントとパスワード:`admin/hertzbeat`
111+
2. スタート:`http://localhost:1157`にアクセスします。デフォルトのアカウントとパスワード:`admin/hertzbeat`
112112

113113
3. コレクタークラスタのデプロイメント(オプション)
114114

@@ -126,13 +126,13 @@
126126

127127
##### 方式2:インストールパッケージ
128128

129-
1. リリースパッケージをダウンロード `hertzbeat-xx.tar.gz` [Download](https://hertzbeat.apache.org/docs/download)
130-
2. HertzBeatのymlファイルを設定 `hertzbeat/config/application.yml` (オプション
131-
3. コマンド`$ ./bin/startup.sh`または`bin/startup.bat`を実行
132-
4. スタート:`http://localhost:4200`にアクセスします。デフォルトのアカウントとパスワード:`admin/hertzbeat`
129+
1. リリースパッケージ `apache-hertzbeat-xx-bin.tar.gz` をダウンロードします [Download](https://hertzbeat.apache.org/docs/download)
130+
2. HertzBeat の設定ファイル `hertzbeat/config/application.yml` を編集します(任意
131+
3. コマンド `$ ./bin/startup.sh` または `bin/startup.bat` を実行します
132+
4. ブラウザで `http://localhost:1157` にアクセスします。デフォルトのアカウントとパスワードは `admin/hertzbeat` です
133133
5. コレクタークラスタのデプロイメント(オプション)
134-
- コレクターパッケージを別のホストにダウンロード `hertzbeat-collector-xx.tar.gz` [Download](https://hertzbeat.apache.org/docs/download)
135-
- コレクターのymlファイルを設定 `hertzbeat-collector/config/application.yml`
134+
- 別ホストにコレクターのインストールパッケージ `apache-hertzbeat-collector-xx-bin.tar.gz`(JVM コレクター)または対象プラットフォーム向けの Native コレクターパッケージ(例: `apache-hertzbeat-collector-native-xx-linux-amd64-bin.tar.gz``apache-hertzbeat-collector-native-xx-windows-amd64-bin.zip`)をダウンロードします [Download](https://hertzbeat.apache.org/docs/download)
135+
- コレクターの設定ファイル `hertzbeat-collector/config/application.yml` を編集します
136136
```yaml
137137
collector:
138138
dispatch:
@@ -148,15 +148,16 @@
148148
- `mode: ${MODE:public}`:実行モード(パブリッククラスタまたはプライベートクラウドエッジ)。
149149
- `manager-host: ${MANAGER_HOST:127.0.0.1}`:メインhertzbeatサーバーのIP。
150150
- `manager-port: ${MANAGER_PORT:1158}`:メインhertzbeatサーバポート。
151-
- コマンド`$ ./bin/startup.sh`または`bin/startup.bat`を実行。
152-
- `http://localhost:1157`にアクセスし、登録された新しいコレクターを見ることがでます。
151+
- `ext-lib` で MySQL、OceanBase、Oracle、DB2 などの外部 JDBC ドライバーを読み込む必要がある場合は、JVM コレクターのインストールパッケージを使用してください。
152+
- JVM コレクターのインストールパッケージは `$ ./bin/startup.sh` または `bin/startup.bat`、Linux/macOS の Native コレクターパッケージは `$ ./bin/startup.sh`、Windows の Native コレクターパッケージは `bin\\startup.bat` で起動します。
153+
- メインの HertzBeat サービス `http://localhost:1157` にアクセスすると、登録された新しいコレクターを確認できます。
153154

154155
詳細ステップ [通过安装包安装HertzBeat](https://hertzbeat.apache.org/docs/start/package-deploy)
155156

156157
##### 方式3:ローカルの実行
157158

158159
1. ローカルの実行には、バックエンドのプロジェクト`hertzbeat-startup`とフロントエンドのプロジェクト`web-app`を起動する必要があります。
159-
2. バックエンド:`maven3+`、`Java21`と`lombok`の環境は必要です。`YML` 設定を修正し、Java仮想マシンパラメータに`--add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED` を追加し、`hertzbeat-startup` を起動します。
160+
2. バックエンド:`maven3+`、`Java25`、`lombok` の環境が必要です。`YML` 設定を修正し、Java 仮想マシンパラメータに `--add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED` を追加して `hertzbeat-startup` を起動します。
160161
3. フロントエンド:`nodejs npm angular-cli`の環境は必要です。ローカルのバックエンドが立ち上がったら、`web-app` ディレクトリで `ng serve --open` というコマンドを実行します。
161162
4. スタート:`http://localhost:4200`にアクセスします。デフォルトのアカウントとパスワード:`admin/hertzbeat`。
162163

hertzbeat-ai/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<version>${hertzbeat.version}</version>
2828
<properties>
2929
<spring-ai.version>1.1.1</spring-ai.version>
30-
<java.version>21</java.version>
30+
<java.version>25</java.version>
3131
</properties>
3232

3333
<dependencies>

hertzbeat-collector/hertzbeat-collector-basic/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
<name>${project.artifactId}</name>
3131

3232
<properties>
33-
<maven.compiler.source>17</maven.compiler.source>
34-
<maven.compiler.target>17</maven.compiler.target>
33+
<maven.compiler.source>${java.version}</maven.compiler.source>
34+
<maven.compiler.target>${java.version}</maven.compiler.target>
3535
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
3636
<mqtt.version>1.2.5</mqtt.version>
3737
</properties>
@@ -189,4 +189,4 @@
189189
<version>${zookeeper.version}</version>
190190
</dependency>
191191
</dependencies>
192-
</project>
192+
</project>

0 commit comments

Comments
 (0)