chore: import upstream snapshot with attribution
MCP Bash Server CI / Test MCP Bash Server (dev) (push) Waiting to run
MCP Bash Server CI / Test MCP Bash Server (release) (push) Waiting to run

This commit is contained in:
wehub-resource-sync
2026-07-13 13:11:39 +08:00
commit c8cebdfeee
4654 changed files with 626756 additions and 0 deletions
+375
View File
@@ -0,0 +1,375 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
server:
port: 1157
spring:
application:
name: ${HOSTNAME:@hertzbeat@}${PID}
profiles:
active: prod
ai:
mcp:
server:
enabled: true
stdio: false
protocol: streamable
streamable-http:
mcp-endpoint: /api/mcp
name: hertzbeat-mcp-server
version: 1.0.0
type: SYNC
mvc:
static-path-pattern: /**
jackson:
default-property-inclusion: ALWAYS
web:
resources:
static-locations:
- classpath:/dist/
- classpath:../dist/
servlet:
multipart:
max-file-size: 100MB
max-request-size: 100MB
management:
health:
mail:
enabled: off
endpoints:
web:
exposure:
include:
- 'metrics'
- 'health'
- 'prometheus'
access:
default: read_only
endpoint:
prometheus:
access: read_only
metrics:
tags:
application: ${spring.application.name}
environment: ${spring.profiles.active}
prometheus:
metrics:
export:
enabled: true
sureness:
container: jakarta_servlet
auths:
- digest
- basic
- jwt
jwt:
secret: 'CyaFv0bwq2Eik0jdrKUtsA6bx3sDJeFV643R
LnfKefTjsIfJLBa2YkhEqEGtcHDTNe4CU6+9
8tVt4bisXQ13rbN0oxhUZR73M6EByXIO+SV5
dKhaX0csgOCTlCxq20yhmUea6H6JIpSE2Rwp'
---
spring:
config:
activate:
on-profile: prod
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: h2
hibernate:
ddl-auto: update
properties:
hibernate:
dialect: org.hibernate.dialect.H2Dialect
format_sql: true
flyway:
enabled: true
clean-disabled: true
baseline-on-migrate: true
baseline-version: 1
locations:
- classpath:db/migration/{vendor}
mail:
# Mail server address, eg: qq-mailbox is smtp.qq.com, qq-exmail is smtp.exmail.qq.com
host: smtp.qq.com
username: tancloud@qq.com
# Attention this is not email account password, this requires an email authorization code
password: your-password
# Mailbox smtp server port, eg: qq-mailbox is 465, qq-exmail is 587
port: 465
properties:
mail:
smtp:
socketFactoryClass: javax.net.ssl.SSLSocketFactory
ssl:
enable: true
starttls:
enable: false
common:
queue:
# memory, kafka, redis
type: memory
# properties when queue type is kafka
kafka:
servers: 127.0.0.1:9092
metrics-data-topic: async-metrics-data
metrics-data-to-storage-topic: metrics-data-to-storage-topic
service-discovery-data-topic: service-discovery-data
alerts-data-topic: async-alerts-data
log-entry-data-topic: async-log-entry-data
log-entry-data-to-storage-topic: log-entry-data-to-storage-topic
redis:
redis-host: 127.0.0.1
redis-port: 6379
metrics-data-queue-name-for-service-discovery: service_discovery
metrics-data-queue-name-to-persistent-storage: metrics:to_persistent_storage
metrics-data-queue-name-to-alerter: metrics:to_alerter
metrics-data-queue-name-to-real-time-storage: metrics:to_realtime_storage
alerts-data-queue-name: alerts
log-entry-queue-name: log:to_alerter
log-entry-to-storage-queue-name: log:to_storage
warehouse:
store:
# store history metrics data, enable only one below
duckdb:
enabled: true
# The maximum retention time for history records, after which records will be deleted
expire-time: 90d
store-path: data/history.duckdb
victoria-metrics:
# Standalone mode toggle — must be set to false when using cluster mode
enabled: false
url: http://localhost:8428
username: root
password: root
insert:
buffer-size: 100
flush-interval: 3
compression:
enabled: false
cluster:
enabled: false
select:
url: http://localhost:8481
username: root
password: root
insert:
url: http://localhost:8480
username: root
password: root
buffer-size: 1000
flush-interval: 3
td-engine:
enabled: false
driver-class-name: com.taosdata.jdbc.rs.RestfulDriver
url: jdbc:TAOS-RS://localhost:6041/hertzbeat
username: root
password: taosdata
greptime:
enabled: false
grpc-endpoints: localhost:4001
http-endpoint: http://localhost:4000
# if you config other database name, you should create them first
database: public
username: greptime
password: greptime
questdb:
enabled: false
url: localhost:9000
username: admin
password: quest
iot-db:
enabled: false
host: 127.0.0.1
rpc-port: 6667
username: root
password: root
query-timeout-in-ms: -1
# data expire time, unit:ms, default '7776000000'(90 days, -1:never expire)
expire-time: '7776000000'
influxdb:
enabled: false
server-url: http://127.0.0.1:8086
username: root
password: root
expire-time: '30d'
replication: 1
doris:
enabled: false
url: jdbc:mysql://127.0.0.1:9030
username: root
password:
table-config:
enable-partition: false
partition-time-unit: DAY
partition-retention-days: 30
partition-future-days: 3
buckets: 8
replication-num: 1
pool-config:
minimum-idle: 5
maximum-pool-size: 20
connection-timeout: 30000
write-config:
# Write mode: jdbc (default, suitable for small/medium scale) or stream (high throughput)
write-mode: jdbc
# JDBC mode: batch size and flush interval
batch-size: 1000
flush-interval: 5
# Stream Load mode configuration (only used when write-mode: stream)
stream-load-config:
# Doris FE HTTP port for Stream Load API
http-port: :8030
# Stream load timeout in seconds
timeout: 60
# Max batch size in bytes for stream load (10MB default)
max-bytes-per-batch: 10485760
# Redirect policy in complex networks: direct/public/private, empty means Doris default
redirect-policy: ""
# store real-time metrics data, enable only one below
real-time:
memory:
enabled: true
init-size: 16
redis:
enabled: false
# redis mode: single, sentinel, cluster. Default is single
mode: single
# separate each address with comma when using cluster mode, eg: 127.0.0.1:6379,127.0.0.1:6380
address: 127.0.0.1:6379
# enter master name when using sentinel mode
masterName: mymaster
password: 123456
# redis db index, default: DB0
db: 0
alerter:
# custom console url
console-url: https://console.tancloud.io
# we work
we-work-webhook-url: https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=
# ding ding talk
ding-talk-webhook-url: https://oapi.dingtalk.com/robot/send?access_token=
# fei shu fly book
fly-book-webhook-url: https://open.feishu.cn/open-apis/bot/v2/hook/
# telegram
telegram-webhook-url: https://api.telegram.org/bot%s/sendMessage
# discord
discord-webhook-url: https://discord.com/api/v9/channels/%s/messages
# serverChan
server-chan-webhook-url: https://sctapi.ftqq.com/%s.send
# gotify
gotify-webhook-url: http://127.0.0.1/message?token=%s
# alert inhibit ttl unit ms, default 14400000(4 hours)
inhibit:
ttl: 14400000
sms:
enable: false
type: tencent
tencent:
secret-id:
secret-key:
app-id:
sign-name:
template-id:
alibaba:
access-key-id:
access-key-secret:
sign-name:
template-code:
unisms:
# auth-mode: simple or hmac
auth-mode: simple
access-key-id: YOUR_ACCESS_KEY_ID
# hmac mode need to fill in access-key-secret
access-key-secret: YOUR_ACCESS_KEY_SECRET
signature: YOUR_SMS_SIGNATURE
template-id: YOUR_TEMPLATE_ID
smslocal:
api-key: YOUR_API_KEY_HERE
aws:
access-key-id: YOUR_ACCESS_KEY_ID
access-key-secret: YOUR_ACCESS_KEY_SECRET
region: AWS_REGION_FOR_END_USER_MESSAGING
twilio:
account-sid: YOUR_ACCOUNT_SID
auth-token: YOUR_AUTH_TOKEN
twilio-phone-number: YOUR_TWILIO_PHONE_NUMBER
scheduler:
server:
enabled: true
port: 1158
grafana:
enabled: false
url: http://127.0.0.1:3000
expose-url: http://127.0.0.1:3000
username: admin
password: admin
hertzbeat:
collector:
mysql:
# MySQL-compatible query engine routing for MySQL, MariaDB, OceanBase, and TiDB SQL metrics.
# auto : prefer JDBC only when mysql-connector-j is available from ext-lib, otherwise use the built-in query engine
# jdbc : always use JDBC
# r2dbc : always use the built-in query engine
query-engine: ${HERTZBEAT_COLLECTOR_MYSQL_QUERY_ENGINE:auto}
# Optional virtual-thread overrides. Remove this whole block to use built-in defaults.
vthreads:
enabled: true
common:
mode: UNBOUNDED_VT
collector:
mode: LIMIT_AND_REJECT
manager:
mode: LIMIT_AND_REJECT
max-concurrent-jobs: 10
alerter:
notify:
mode: LIMIT_AND_REJECT
max-concurrent-jobs: 64
periodic-max-concurrent-jobs: 10
log-worker:
max-concurrent-jobs: 10
queue-capacity: 1000
reduce:
max-concurrent-jobs: 2
window-evaluator:
max-concurrent-jobs: 2
notify-max-concurrent-per-channel: 4
warehouse:
mode: UNBOUNDED_VT
async:
enabled: true
concurrency-limit: 256
reject-when-limit-reached: true
task-termination-timeout: 5000
@@ -0,0 +1,114 @@
<!--
~ Licensed to the Apache Software Foundation (ASF) under one
~ or more contributor license agreements. See the NOTICE file
~ distributed with this work for additional information
~ regarding copyright ownership. The ASF licenses this file
~ to you under the Apache License, Version 2.0 (the
~ "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd
http://maven.apache.org/ASSEMBLY/2.0.0 ">
<!--Required, will be appended to the end of the packaged file name-->
<id>bin-linux_amd64</id>
<includeBaseDirectory>true</includeBaseDirectory>
<baseDirectory>apache-hertzbeat-collector-${hzb.version}</baseDirectory>
<!--Packaging type, multiple types can be set, different types will be packaged when packaging-->
<formats>
<format>tar.gz</format>
</formats>
<!--Third-party dependency settings-->
<dependencySets>
<dependencySet>
<!--Use artifacts in the project, third-party packages packaged into the lib directory of the tar.gz file-->
<useProjectArtifact>true</useProjectArtifact>
<outputDirectory>lib</outputDirectory>
</dependencySet>
</dependencySets>
<!--File-related settings-->
<fileSets>
<!--All script files under the bin directory are output to the bin directory after packaging-->
<fileSet>
<directory>../script/assembly/collector/bin</directory>
<!-- Whether to perform property replacement, that is, use ${project.artifactId} -->
<filtered>true</filtered>
<outputDirectory>bin</outputDirectory>
<fileMode>0755</fileMode>
</fileSet>
<!-- Configuration files under the src/main/resources directory are packaged to the config directory-->
<fileSet>
<directory>src/main/resources</directory>
<includes>
<include>application.yml</include>
<include>logback-spring.xml</include>
<include>banner.txt</include>
<include>META-INF/**</include>
</includes>
<!-- Whether to perform property replacement, that is, use ${project.artifactId} -->
<filtered>true</filtered>
<outputDirectory>${file.separator}config</outputDirectory>
</fileSet>
<!-- Pack the startup jar in the target directory to the directory-->
<fileSet>
<directory>target</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>*.jar</include>
</includes>
</fileSet>
<!-- copy jdk -->
<fileSet>
<directory>../jdk/linux-amd64</directory>
<outputDirectory>java</outputDirectory>
</fileSet>
<!-- external lib -->
<fileSet>
<directory>../script/ext-lib</directory>
<includes>
<include>**/*</include>
</includes>
<outputDirectory>ext-lib</outputDirectory>
</fileSet>
<!-- license -->
<fileSet>
<directory>../</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>README.md</include>
</includes>
</fileSet>
<fileSet>
<directory>../material/licenses/collector</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>LICENSE</include>
<include>NOTICE</include>
</includes>
</fileSet>
<fileSet>
<directory>../material/licenses/collector</directory>
<outputDirectory>licenses</outputDirectory>
<includes>
<include>LICENSE-*</include>
</includes>
</fileSet>
</fileSets>
</assembly>
@@ -0,0 +1,114 @@
<!--
~ Licensed to the Apache Software Foundation (ASF) under one
~ or more contributor license agreements. See the NOTICE file
~ distributed with this work for additional information
~ regarding copyright ownership. The ASF licenses this file
~ to you under the Apache License, Version 2.0 (the
~ "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd
http://maven.apache.org/ASSEMBLY/2.0.0 ">
<!--Required, will be appended to the end of the packaged file name-->
<id>bin-linux_arm64</id>
<includeBaseDirectory>true</includeBaseDirectory>
<baseDirectory>apache-hertzbeat-collector-${hzb.version}</baseDirectory>
<!--Packaging type, multiple types can be set, different types will be packaged when packaging-->
<formats>
<format>tar.gz</format>
</formats>
<!--Third-party dependency settings-->
<dependencySets>
<dependencySet>
<!--Use artifacts in the project, third-party packages packaged into the lib directory of the tar.gz file-->
<useProjectArtifact>true</useProjectArtifact>
<outputDirectory>lib</outputDirectory>
</dependencySet>
</dependencySets>
<!--File-related settings-->
<fileSets>
<!--All script files under the bin directory are output to the bin directory after packaging-->
<fileSet>
<directory>../script/assembly/collector/bin</directory>
<!-- Whether to perform property replacement, that is, use ${project.artifactId} -->
<filtered>true</filtered>
<outputDirectory>bin</outputDirectory>
<fileMode>0755</fileMode>
</fileSet>
<!-- Configuration files under the src/main/resources directory are packaged to the config directory-->
<fileSet>
<directory>src/main/resources</directory>
<includes>
<include>application.yml</include>
<include>logback-spring.xml</include>
<include>banner.txt</include>
<include>META-INF/**</include>
</includes>
<!-- Whether to perform property replacement, that is, use ${project.artifactId} -->
<filtered>true</filtered>
<outputDirectory>${file.separator}config</outputDirectory>
</fileSet>
<!-- Pack the startup jar in the target directory to the directory-->
<fileSet>
<directory>target</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>*.jar</include>
</includes>
</fileSet>
<!-- copy jdk -->
<fileSet>
<directory>../jdk/linux-arm64</directory>
<outputDirectory>java</outputDirectory>
</fileSet>
<!-- external lib -->
<fileSet>
<directory>../script/ext-lib</directory>
<includes>
<include>**/*</include>
</includes>
<outputDirectory>ext-lib</outputDirectory>
</fileSet>
<!-- license -->
<fileSet>
<directory>../</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>README.md</include>
</includes>
</fileSet>
<fileSet>
<directory>../material/licenses/collector</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>LICENSE</include>
<include>NOTICE</include>
</includes>
</fileSet>
<fileSet>
<directory>../material/licenses/collector</directory>
<outputDirectory>licenses</outputDirectory>
<includes>
<include>LICENSE-*</include>
</includes>
</fileSet>
</fileSets>
</assembly>
@@ -0,0 +1,114 @@
<!--
~ Licensed to the Apache Software Foundation (ASF) under one
~ or more contributor license agreements. See the NOTICE file
~ distributed with this work for additional information
~ regarding copyright ownership. The ASF licenses this file
~ to you under the Apache License, Version 2.0 (the
~ "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd
http://maven.apache.org/ASSEMBLY/2.0.0 ">
<!--Required, will be appended to the end of the packaged file name-->
<id>bin-macos_amd64</id>
<includeBaseDirectory>true</includeBaseDirectory>
<baseDirectory>apache-hertzbeat-collector-${hzb.version}</baseDirectory>
<!--Packaging type, multiple types can be set, different types will be packaged when packaging-->
<formats>
<format>tar.gz</format>
</formats>
<!--Third-party dependency settings-->
<dependencySets>
<dependencySet>
<!--Use artifacts in the project, third-party packages packaged into the lib directory of the tar.gz file-->
<useProjectArtifact>true</useProjectArtifact>
<outputDirectory>lib</outputDirectory>
</dependencySet>
</dependencySets>
<!--File-related settings-->
<fileSets>
<!--All script files under the bin directory are output to the bin directory after packaging-->
<fileSet>
<directory>../script/assembly/collector/bin</directory>
<!-- Whether to perform property replacement, that is, use ${project.artifactId} -->
<filtered>true</filtered>
<outputDirectory>bin</outputDirectory>
<fileMode>0755</fileMode>
</fileSet>
<!-- Configuration files under the src/main/resources directory are packaged to the config directory-->
<fileSet>
<directory>src/main/resources</directory>
<includes>
<include>application.yml</include>
<include>logback-spring.xml</include>
<include>banner.txt</include>
<include>META-INF/**</include>
</includes>
<!-- Whether to perform property replacement, that is, use ${project.artifactId} -->
<filtered>true</filtered>
<outputDirectory>${file.separator}config</outputDirectory>
</fileSet>
<!-- Pack the startup jar in the target directory to the directory-->
<fileSet>
<directory>target</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>*.jar</include>
</includes>
</fileSet>
<!-- copy jdk -->
<fileSet>
<directory>../jdk/macos-amd64</directory>
<outputDirectory>java</outputDirectory>
</fileSet>
<!-- external lib -->
<fileSet>
<directory>../script/ext-lib</directory>
<includes>
<include>**/*</include>
</includes>
<outputDirectory>ext-lib</outputDirectory>
</fileSet>
<!-- license -->
<fileSet>
<directory>../</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>README.md</include>
</includes>
</fileSet>
<fileSet>
<directory>../material/licenses/collector</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>LICENSE</include>
<include>NOTICE</include>
</includes>
</fileSet>
<fileSet>
<directory>../material/licenses/collector</directory>
<outputDirectory>licenses</outputDirectory>
<includes>
<include>LICENSE-*</include>
</includes>
</fileSet>
</fileSets>
</assembly>
@@ -0,0 +1,114 @@
<!--
~ Licensed to the Apache Software Foundation (ASF) under one
~ or more contributor license agreements. See the NOTICE file
~ distributed with this work for additional information
~ regarding copyright ownership. The ASF licenses this file
~ to you under the Apache License, Version 2.0 (the
~ "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd
http://maven.apache.org/ASSEMBLY/2.0.0 ">
<!--Required, will be appended to the end of the packaged file name-->
<id>bin-macos_arm64</id>
<includeBaseDirectory>true</includeBaseDirectory>
<baseDirectory>apache-hertzbeat-collector-${hzb.version}</baseDirectory>
<!--Packaging type, multiple types can be set, different types will be packaged when packaging-->
<formats>
<format>tar.gz</format>
</formats>
<!--Third-party dependency settings-->
<dependencySets>
<dependencySet>
<!--Use artifacts in the project, third-party packages packaged into the lib directory of the tar.gz file-->
<useProjectArtifact>true</useProjectArtifact>
<outputDirectory>lib</outputDirectory>
</dependencySet>
</dependencySets>
<!--File-related settings-->
<fileSets>
<!--All script files under the bin directory are output to the bin directory after packaging-->
<fileSet>
<directory>../script/assembly/collector/bin</directory>
<!-- Whether to perform property replacement, that is, use ${project.artifactId} -->
<filtered>true</filtered>
<outputDirectory>bin</outputDirectory>
<fileMode>0755</fileMode>
</fileSet>
<!-- Configuration files under the src/main/resources directory are packaged to the config directory-->
<fileSet>
<directory>src/main/resources</directory>
<includes>
<include>application.yml</include>
<include>logback-spring.xml</include>
<include>banner.txt</include>
<include>META-INF/**</include>
</includes>
<!-- Whether to perform property replacement, that is, use ${project.artifactId} -->
<filtered>true</filtered>
<outputDirectory>${file.separator}config</outputDirectory>
</fileSet>
<!-- Pack the startup jar in the target directory to the directory-->
<fileSet>
<directory>target</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>*.jar</include>
</includes>
</fileSet>
<!-- copy jdk -->
<fileSet>
<directory>../jdk/macos-arm64</directory>
<outputDirectory>java</outputDirectory>
</fileSet>
<!-- external lib -->
<fileSet>
<directory>../script/ext-lib</directory>
<includes>
<include>**/*</include>
</includes>
<outputDirectory>ext-lib</outputDirectory>
</fileSet>
<!-- license -->
<fileSet>
<directory>../</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>README.md</include>
</includes>
</fileSet>
<fileSet>
<directory>../material/licenses/collector</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>LICENSE</include>
<include>NOTICE</include>
</includes>
</fileSet>
<fileSet>
<directory>../material/licenses/collector</directory>
<outputDirectory>licenses</outputDirectory>
<includes>
<include>LICENSE-*</include>
</includes>
</fileSet>
</fileSets>
</assembly>
@@ -0,0 +1,82 @@
<!--
~ Licensed to the Apache Software Foundation (ASF) under one
~ or more contributor license agreements. See the NOTICE file
~ distributed with this work for additional information
~ regarding copyright ownership. The ASF licenses this file
~ to you under the Apache License, Version 2.0 (the
~ "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd
http://maven.apache.org/ASSEMBLY/2.0.0 ">
<id>${native.package.id}</id>
<includeBaseDirectory>true</includeBaseDirectory>
<baseDirectory>${native.package.baseDirectory}</baseDirectory>
<formats>
<format>${native.package.format}</format>
</formats>
<fileSets>
<fileSet>
<directory>${native.launcher.dir}</directory>
<filtered>true</filtered>
<outputDirectory>bin</outputDirectory>
<fileMode>0755</fileMode>
</fileSet>
<fileSet>
<directory>src/main/resources</directory>
<includes>
<include>application.yml</include>
<include>logback-spring.xml</include>
<include>banner.txt</include>
</includes>
<filtered>true</filtered>
<outputDirectory>${file.separator}config</outputDirectory>
</fileSet>
<fileSet>
<directory>../../</directory>
<outputDirectory>${file.separator}</outputDirectory>
<includes>
<include>README.md</include>
</includes>
</fileSet>
<fileSet>
<directory>../../material/licenses/collector</directory>
<outputDirectory>${file.separator}</outputDirectory>
<includes>
<include>LICENSE</include>
<include>NOTICE</include>
</includes>
</fileSet>
<fileSet>
<directory>../../material/licenses/collector</directory>
<outputDirectory>licenses</outputDirectory>
<includes>
<include>LICENSE-*</include>
</includes>
</fileSet>
</fileSets>
<files>
<file>
<source>${native.binary.source}</source>
<outputDirectory>${file.separator}</outputDirectory>
<destName>${native.executable.packageName}</destName>
<fileMode>0755</fileMode>
</file>
</files>
</assembly>
@@ -0,0 +1,114 @@
<!--
~ Licensed to the Apache Software Foundation (ASF) under one
~ or more contributor license agreements. See the NOTICE file
~ distributed with this work for additional information
~ regarding copyright ownership. The ASF licenses this file
~ to you under the Apache License, Version 2.0 (the
~ "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd
http://maven.apache.org/ASSEMBLY/2.0.0 ">
<!--Required, will be appended to the end of the packaged file name-->
<id>bin-windows64</id>
<includeBaseDirectory>true</includeBaseDirectory>
<baseDirectory>apache-hertzbeat-collector-${hzb.version}</baseDirectory>
<!--Packaging type, multiple types can be set, different types will be packaged when packaging-->
<formats>
<format>zip</format>
</formats>
<!--Third-party dependency settings-->
<dependencySets>
<dependencySet>
<!--Use artifacts in the project, third-party packages packaged into the lib directory of the tar.gz file-->
<useProjectArtifact>true</useProjectArtifact>
<outputDirectory>lib</outputDirectory>
</dependencySet>
</dependencySets>
<!--File-related settings-->
<fileSets>
<!--All script files under the bin directory are output to the bin directory after packaging-->
<fileSet>
<directory>../script/assembly/collector/bin</directory>
<!-- Whether to perform property replacement, that is, use ${project.artifactId} -->
<filtered>true</filtered>
<outputDirectory>bin</outputDirectory>
<fileMode>0755</fileMode>
</fileSet>
<!-- Configuration files under the src/main/resources directory are packaged to the config directory-->
<fileSet>
<directory>src/main/resources</directory>
<includes>
<include>application.yml</include>
<include>logback-spring.xml</include>
<include>banner.txt</include>
<include>META-INF/**</include>
</includes>
<!-- Whether to perform property replacement, that is, use ${project.artifactId} -->
<filtered>true</filtered>
<outputDirectory>${file.separator}config</outputDirectory>
</fileSet>
<!-- Pack the startup jar in the target directory to the directory-->
<fileSet>
<directory>target</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>*.jar</include>
</includes>
</fileSet>
<!-- copy jdk -->
<fileSet>
<directory>../jdk/windows-64</directory>
<outputDirectory>java</outputDirectory>
</fileSet>
<!-- external lib -->
<fileSet>
<directory>../script/ext-lib</directory>
<includes>
<include>**/*</include>
</includes>
<outputDirectory>ext-lib</outputDirectory>
</fileSet>
<!-- license -->
<fileSet>
<directory>../</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>README.md</include>
</includes>
</fileSet>
<fileSet>
<directory>../material/licenses/collector</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>LICENSE</include>
<include>NOTICE</include>
</includes>
</fileSet>
<fileSet>
<directory>../material/licenses/collector</directory>
<outputDirectory>licenses</outputDirectory>
<includes>
<include>LICENSE-*</include>
</includes>
</fileSet>
</fileSets>
</assembly>
+111
View File
@@ -0,0 +1,111 @@
<!--
~ Licensed to the Apache Software Foundation (ASF) under one
~ or more contributor license agreements. See the NOTICE file
~ distributed with this work for additional information
~ regarding copyright ownership. The ASF licenses this file
~ to you under the Apache License, Version 2.0 (the
~ "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd
http://maven.apache.org/ASSEMBLY/2.0.0 ">
<!--Required, will be appended to the end of the packaged file name-->
<id>bin</id>
<includeBaseDirectory>true</includeBaseDirectory>
<baseDirectory>apache-hertzbeat-collector-${hzb.version}-bin</baseDirectory>
<!--Packaging type, multiple types can be set, different types will be packaged when packaging-->
<formats>
<format>tar.gz</format>
</formats>
<!--Third-party dependency settings-->
<dependencySets>
<dependencySet>
<!--Use artifacts in the project, third-party packages packaged into the lib directory of the tar.gz file-->
<useProjectArtifact>true</useProjectArtifact>
<outputDirectory>lib</outputDirectory>
</dependencySet>
</dependencySets>
<!--File-related settings-->
<fileSets>
<!--All script files under the bin directory are output to the bin directory after packaging-->
<fileSet>
<directory>../../script/assembly/collector/bin</directory>
<!-- Whether to perform property replacement, that is, use ${project.artifactId} -->
<filtered>true</filtered>
<outputDirectory>bin</outputDirectory>
<fileMode>0755</fileMode>
</fileSet>
<!-- Configuration files under the src/main/resources directory are packaged to the config directory-->
<fileSet>
<directory>src/main/resources</directory>
<includes>
<include>application.yml</include>
<include>logback-spring.xml</include>
<include>banner.txt</include>
<include>META-INF/**</include>
</includes>
<excludes>
<exclude>META-INF/spring.factories</exclude>
</excludes>
<!-- Whether to perform property replacement, that is, use ${project.artifactId} -->
<filtered>true</filtered>
<outputDirectory>${file.separator}config</outputDirectory>
</fileSet>
<!-- Pack the startup jar in the target directory to the directory-->
<fileSet>
<directory>target</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>${project.build.finalName}.jar</include>
</includes>
</fileSet>
<!-- external lib -->
<fileSet>
<directory>../../script/ext-lib</directory>
<includes>
<include>**/*</include>
</includes>
<outputDirectory>ext-lib</outputDirectory>
</fileSet>
<!-- license -->
<fileSet>
<directory>../../</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>README.md</include>
</includes>
</fileSet>
<fileSet>
<directory>../../material/licenses/collector</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>LICENSE</include>
<include>NOTICE</include>
</includes>
</fileSet>
<fileSet>
<directory>../../material/licenses/collector</directory>
<outputDirectory>licenses</outputDirectory>
<includes>
<include>LICENSE-*</include>
</includes>
</fileSet>
</fileSets>
</assembly>
@@ -0,0 +1,25 @@
@rem
@rem Licensed to the Apache Software Foundation (ASF) under one or more
@rem contributor license agreements. See the NOTICE file distributed with
@rem this work for additional information regarding copyright ownership.
@rem The ASF licenses this file to You under the Apache License, Version 2.0
@rem (the "License"); you may not use this file except in compliance with
@rem the License. You may obtain a copy of the License at
@rem
@rem http://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@echo off
setlocal
echo Restarting Apache HertzBeat ${project.artifactId} ...
call "%~dp0shutdown.bat"
timeout /t 2 /nobreak >nul
call "%~dp0startup.bat"
exit /b %ERRORLEVEL%
@@ -0,0 +1,49 @@
@rem
@rem Licensed to the Apache Software Foundation (ASF) under one or more
@rem contributor license agreements. See the NOTICE file distributed with
@rem this work for additional information regarding copyright ownership.
@rem The ASF licenses this file to You under the Apache License, Version 2.0
@rem (the "License"); you may not use this file except in compliance with
@rem the License. You may obtain a copy of the License at
@rem
@rem http://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@echo off
setlocal
set SERVER_NAME=${project.artifactId}
cd /d %~dp0
cd ..
set DEPLOY_DIR=%CD%
set LOGS_DIR=%DEPLOY_DIR%\logs
set PID_FILE=%LOGS_DIR%\%SERVER_NAME%.pid
set SERVER_PORT=1159
set PID=
if exist "%PID_FILE%" (
set /p PID=<"%PID_FILE%"
)
if not defined PID (
for /f %%i in ('powershell -NoProfile -ExecutionPolicy Bypass -Command "$conn = Get-NetTCPConnection -LocalPort %SERVER_PORT% -State Listen -ErrorAction SilentlyContinue | Select-Object -First 1; if ($conn) { $conn.OwningProcess }"') do set PID=%%i
)
if not defined PID (
echo Apache HertzBeat %SERVER_NAME% is already stopped
del /q "%PID_FILE%" >nul 2>&1
exit /b 0
)
powershell -NoProfile -ExecutionPolicy Bypass -Command "if (Get-Process -Id %PID% -ErrorAction SilentlyContinue) { Stop-Process -Id %PID% -Force; exit 0 } exit 1"
del /q "%PID_FILE%" >nul 2>&1
echo Shutdown Apache HertzBeat %SERVER_NAME% Success!
exit /b 0
@@ -0,0 +1,102 @@
@rem
@rem Licensed to the Apache Software Foundation (ASF) under one or more
@rem contributor license agreements. See the NOTICE file distributed with
@rem this work for additional information regarding copyright ownership.
@rem The ASF licenses this file to You under the Apache License, Version 2.0
@rem (the "License"); you may not use this file except in compliance with
@rem the License. You may obtain a copy of the License at
@rem
@rem http://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@echo off
setlocal
set SERVER_NAME=${project.artifactId}
set BINARY_NAME=${native.executable.packageName}
cd /d %~dp0
cd ..
set DEPLOY_DIR=%CD%
set CONF_DIR=%DEPLOY_DIR%\config
set LOGS_DIR=%DEPLOY_DIR%\logs
set PID_FILE=%LOGS_DIR%\%SERVER_NAME%.pid
set APP_PATH=%DEPLOY_DIR%\%BINARY_NAME%
set SERVER_PORT=1159
set STDOUT_LOG=%LOGS_DIR%\startup.out.log
set STDERR_LOG=%LOGS_DIR%\startup.err.log
if "%1"=="status" goto status
if not exist "%APP_PATH%" (
echo ERROR: native executable not found: %APP_PATH%
exit /b 1
)
if not exist "%LOGS_DIR%" (
mkdir "%LOGS_DIR%"
)
if exist "%PID_FILE%" (
set /p RUNNING_PID=<"%PID_FILE%"
powershell -NoProfile -ExecutionPolicy Bypass -Command "if (Get-Process -Id %RUNNING_PID% -ErrorAction SilentlyContinue) { exit 0 } exit 1"
if not errorlevel 1 (
echo ERROR: The HertzBeat %SERVER_NAME% already started!
echo PID: %RUNNING_PID%
exit /b 1
)
del /q "%PID_FILE%" >nul 2>&1
)
powershell -NoProfile -ExecutionPolicy Bypass -Command "$portInUse = Get-NetTCPConnection -State Listen -LocalPort %SERVER_PORT% -ErrorAction SilentlyContinue; if ($portInUse) { exit 0 } exit 1"
if not errorlevel 1 (
echo ERROR: The HertzBeat %SERVER_NAME% port %SERVER_PORT% is already used!
exit /b 1
)
echo You can review logs at hertzbeat\logs
echo Starting the HertzBeat %SERVER_NAME% ...
for /f %%i in ('powershell -NoProfile -ExecutionPolicy Bypass -Command "$p = Start-Process -FilePath ''%APP_PATH%'' -ArgumentList ''--spring.config.location=%CONF_DIR%\'' -RedirectStandardOutput ''%STDOUT_LOG%'' -RedirectStandardError ''%STDERR_LOG%'' -PassThru; $p.Id"') do set APP_PID=%%i
if not defined APP_PID (
echo ERROR: Service start failed, check %STDOUT_LOG% and %STDERR_LOG%
exit /b 1
)
>"%PID_FILE%" echo %APP_PID%
powershell -NoProfile -ExecutionPolicy Bypass -Command "$deadline = (Get-Date).AddSeconds(30); do { Start-Sleep -Seconds 1; if (-not (Get-Process -Id %APP_PID% -ErrorAction SilentlyContinue)) { exit 1 } $listening = Get-NetTCPConnection -LocalPort %SERVER_PORT% -State Listen -ErrorAction SilentlyContinue | Where-Object { $_.OwningProcess -eq %APP_PID% }; if ($listening) { exit 0 } } while ((Get-Date) -lt $deadline); exit 0"
if errorlevel 1 (
echo ERROR: Service start failed, check %STDOUT_LOG% and %STDERR_LOG%
del /q "%PID_FILE%" >nul 2>&1
exit /b 1
)
echo Service Start Success!
echo Service PID: %APP_PID%
exit /b 0
:status
if not exist "%PID_FILE%" (
echo The HertzBeat %SERVER_NAME% is stopped
exit /b 0
)
set /p RUNNING_PID=<"%PID_FILE%"
powershell -NoProfile -ExecutionPolicy Bypass -Command "if (Get-Process -Id %RUNNING_PID% -ErrorAction SilentlyContinue) { exit 0 } exit 1"
if errorlevel 1 (
echo The HertzBeat %SERVER_NAME% is stopped
del /q "%PID_FILE%" >nul 2>&1
exit /b 0
)
echo The HertzBeat %SERVER_NAME% is running...!
echo PID: %RUNNING_PID%
exit /b 0
@@ -0,0 +1,27 @@
#!/bin/bash
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
startTime=$(date +%s)
echo -e "\033[0;31mCurrent Time is$(date "+%Y-%m-%d %H:%M:%S") Restart Now!\033[0m"
./shutdown.sh
echo
sleep 2
echo
./startup.sh
endTime=$(date +%s)
echo -e "\033[0;31mCurrent Time is$(date "+%Y-%m-%d %H:%M:%S") Restart SuccessSpend $((endTime - startTime)) seconds \033[0m"
@@ -0,0 +1,62 @@
#!/bin/bash
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
SERVER_NAME="${project.artifactId}"
BINARY_NAME="${project.build.finalName}"
cd "$(dirname "$0")"
cd ..
DEPLOY_DIR="$(pwd)"
CONF_DIR="$DEPLOY_DIR/config"
LOGS_DIR="$DEPLOY_DIR/logs"
PID_FILE="$LOGS_DIR/${project.artifactId}.pid"
APP_PATH="$DEPLOY_DIR/$BINARY_NAME"
find_running_pid() {
if [ -f "$PID_FILE" ]; then
PID="$(cat "$PID_FILE" 2>/dev/null)"
if [ -n "$PID" ] && kill -0 "$PID" 2>/dev/null; then
echo "$PID"
return 0
fi
fi
ps -ef | grep "$APP_PATH" | grep "$CONF_DIR" | grep -v grep | awk '{print $2}' | head -n 1
}
PID="$(find_running_pid)"
if [ -z "$PID" ]; then
echo "Apache HertzBeat ${SERVER_NAME} is already stopped"
rm -f "$PID_FILE"
exit 0
fi
kill "$PID"
for _ in $(seq 1 30); do
if ! kill -0 "$PID" 2>/dev/null; then
rm -f "$PID_FILE"
echo "Shutdown Apache HertzBeat ${SERVER_NAME} Success!"
exit 0
fi
sleep 1
done
kill -9 "$PID" 2>/dev/null
rm -f "$PID_FILE"
echo "Shutdown Apache HertzBeat ${SERVER_NAME} Success!"
@@ -0,0 +1,98 @@
#!/bin/bash
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
SERVER_NAME="${project.artifactId}"
BINARY_NAME="${project.build.finalName}"
cd "$(dirname "$0")"
BIN_DIR="$(pwd)"
cd ..
DEPLOY_DIR="$(pwd)"
CONF_DIR="$DEPLOY_DIR/config"
LOGS_DIR="$DEPLOY_DIR/logs"
PID_FILE="$LOGS_DIR/${project.artifactId}.pid"
APP_PATH="$DEPLOY_DIR/$BINARY_NAME"
SERVER_PORT=1159
find_running_pid() {
if [ -f "$PID_FILE" ]; then
PID="$(cat "$PID_FILE" 2>/dev/null)"
if [ -n "$PID" ] && kill -0 "$PID" 2>/dev/null; then
echo "$PID"
return 0
fi
fi
ps -ef | grep "$APP_PATH" | grep "$CONF_DIR" | grep -v grep | awk '{print $2}' | head -n 1
}
RUNNING_PID="$(find_running_pid)"
if [ "$1" = "status" ]; then
if [ -n "$RUNNING_PID" ]; then
echo "The HertzBeat $SERVER_NAME is running...!"
echo "PID: $RUNNING_PID"
else
echo "The HertzBeat $SERVER_NAME is stopped"
fi
exit 0
fi
if [ ! -x "$APP_PATH" ]; then
echo "ERROR: native executable not found: $APP_PATH"
exit 1
fi
if [ -n "$RUNNING_PID" ]; then
echo "ERROR: The HertzBeat $SERVER_NAME already started!"
echo "PID: $RUNNING_PID"
exit 1
fi
mkdir -p "$LOGS_DIR"
if command -v lsof >/dev/null 2>&1; then
SERVER_PORT_COUNT="$(lsof -nP -iTCP:$SERVER_PORT -sTCP:LISTEN | wc -l)"
if [ "$SERVER_PORT_COUNT" -gt 0 ]; then
echo "ERROR: The HertzBeat $SERVER_NAME port $SERVER_PORT is already used!"
exit 1
fi
fi
echo "You can review logs at hertzbeat/logs"
echo "Starting the HertzBeat $SERVER_NAME ..."
nohup "$APP_PATH" --spring.config.location="$CONF_DIR/" >"$LOGS_DIR/startup.log" 2>&1 &
APP_PID=$!
echo "$APP_PID" >"$PID_FILE"
COUNT=0
while [ $COUNT -lt 30 ]; do
sleep 1
if ! kill -0 "$APP_PID" 2>/dev/null; then
echo "ERROR: Service start failed, check $LOGS_DIR/startup.log"
rm -f "$PID_FILE"
exit 1
fi
if command -v lsof >/dev/null 2>&1 && lsof -nP -iTCP:$SERVER_PORT -sTCP:LISTEN | grep -q "$APP_PID"; then
break
fi
COUNT=$((COUNT + 1))
done
echo "Service Start Success!"
echo "Service PID: $APP_PID"
@@ -0,0 +1,61 @@
#!/bin/sh
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# project name
SERVER_NAME="${project.build.finalName}"
# jar name
JAR_NAME="${project.build.finalName}.jar"
# cd bin
cd `dirname $0`
# bin dir
BIN_DIR=`pwd`
# return root
cd ..
# root path dir
DEPLOY_DIR=`pwd`
# config dir
CONF_DIR=$DEPLOY_DIR/config
MAIN_CLASS="org.apache.hertzbeat.collector.Collector"
EXT_LIB_PATH="$DEPLOY_DIR/ext-lib"
CLASSPATH="$DEPLOY_DIR/$JAR_NAME:$EXT_LIB_PATH/*"
# log dir
LOGS_DIR=$DEPLOY_DIR/logs
# create logs dir when not exist
if [ ! -d $LOGS_DIR ]; then
mkdir $LOGS_DIR
fi
# JVM Configuration
JAVA_OPTS=" -Dfile.encoding=UTF-8 -Doracle.jdbc.timezoneAsRegion=false --add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED"
# JVM Configuration
JAVA_MEM_OPTS=" -server -XX:SurvivorRatio=6 -XX:+UseParallelGC -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=$LOGS_DIR"
# load logback config
LOG_IMPL_FILE=logback-spring.xml
LOGGING_CONFIG=""
if [ -f "$CONF_DIR/$LOG_IMPL_FILE" ]
then
LOGGING_CONFIG="-Dlogging.config=$CONF_DIR/$LOG_IMPL_FILE"
fi
CONFIG_FILES=" -Dlogging.path=$LOGS_DIR $LOGGING_CONFIG -Dspring.config.location=$CONF_DIR/ "
echo -e "Starting the HertzBeat $SERVER_NAME ..."
java $JAVA_OPTS $JAVA_MEM_OPTS $CONFIG_FILES -cp $CLASSPATH $MAIN_CLASS --spring.profiles.active=cluster
+29
View File
@@ -0,0 +1,29 @@
#!/bin/bash
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# restart start time
startTime=$(date +%s)
echo -e "\033[0;31mCurrent Time is$(date "+%Y-%m-%d %H:%M:%S") Restart Now!\033[0m"
./shutdown.sh
echo
sleep 2
echo
./startup.sh
# restart end time
endTime=$(date +%s)
echo -e "\033[0;31mCurrent Time is$(date "+%Y-%m-%d %H:%M:%S") Restart SuccessSpend $((endTime - startTime)) seconds \033[0m";
@@ -0,0 +1,38 @@
@rem
@rem Licensed to the Apache Software Foundation (ASF) under one or more
@rem contributor license agreements. See the NOTICE file distributed with
@rem this work for additional information regarding copyright ownership.
@rem The ASF licenses this file to You under the Apache License, Version 2.0
@rem (the "License"); you may not use this file except in compliance with
@rem the License. You may obtain a copy of the License at
@rem
@rem http://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@title HertzBeat
@echo off
setlocal enabledelayedexpansion
set SERVER_NAME="${project.artifactId}"
set SERVER_PORT=1159
echo Start shutdown HertzBeat %SERVER_NAME%
for /f "tokens=1-5" %%i in ('netstat -ano^|findstr ":%SERVER_PORT%"') do (
echo kill the process %%m who use the port
taskkill /pid %%m -t -f
echo Shutdown Apache HertzBeat %SERVER_NAME% Success!
goto q
)
echo Failed shutdown Apache HertzBeat %SERVER_NAME%
:q
pause
+33
View File
@@ -0,0 +1,33 @@
#!/bin/bash
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# project name
APPLICATION="${project.artifactId}"
# jar file name
APPLICATION_JAR="${project.build.finalName}.jar"
# find the service pid, kill -9 pid
PID=$(ps -ef | grep java | grep "${APPLICATION_JAR}" | grep -v grep | awk '{ print $2 }')
if [[ -z "$PID" ]]
then
echo Apache HertzBeat ${APPLICATION} is already stopped
else
echo kill ${PID}
kill -9 ${PID}
echo Shutdown Apache HertzBeat ${APPLICATION} Success!
fi
+84
View File
@@ -0,0 +1,84 @@
@rem
@rem Licensed to the Apache Software Foundation (ASF) under one or more
@rem contributor license agreements. See the NOTICE file distributed with
@rem this work for additional information regarding copyright ownership.
@rem The ASF licenses this file to You under the Apache License, Version 2.0
@rem (the "License"); you may not use this file except in compliance with
@rem the License. You may obtain a copy of the License at
@rem
@rem http://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@title HertzBeat
@echo off
setlocal enabledelayedexpansion
set SERVER_NAME=${project.artifactId}
set JAR_NAME=${project.build.finalName}.jar
rem enter the bin directory
cd /d %~dp0
cd ..
set DEPLOY_DIR=%~dp0..
echo %DEPLOY_DIR%
set CONF_DIR=%DEPLOY_DIR%\config
echo %CONF_DIR%
set SERVER_PORT=1159
for /f "tokens=1-5" %%i in ('netstat -ano^|findstr "0.0.0.0:%SERVER_PORT%"') do (
echo The HertzBeat %SERVER_NAME% port %SERVER_PORT% already used!
echo exit!
goto q
)
set MAIN_CLASS=org.apache.hertzbeat.collector.Collector
set LOGS_DIR=%DEPLOY_DIR%\logs
set EXT_LIB_PATH=%DEPLOY_DIR%\ext-lib
set CLASSPATH=%DEPLOY_DIR%\%JAR_NAME%;%EXT_LIB_PATH%\*
if not exist %LOGS_DIR% (
mkdir %LOGS_DIR%
)
rem JVM Configuration
set JAVA_OPTS= -Duser.timezone=Asia/Shanghai -Dfile.encoding=UTF-8 -Doracle.jdbc.timezoneAsRegion=false --add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED
set JAVA_MEM_OPTS= -server -XX:SurvivorRatio=6 -XX:+UseParallelGC -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=%LOGS_DIR%
set LOGGING_CONFIG=-Dlogging.config=%CONF_DIR%\logback-spring.xml
set CONFIG_FILES= -Dlogging.path=%LOGS_DIR% %LOGGING_CONFIG% -Dspring.config.location=%CONF_DIR%/
echo Starting the HertzBeat %SERVER_NAME% ...
set INNER_EXE=%DEPLOY_DIR%\java\bin\javaw.exe
if not exist %INNER_EXE% (
echo "Use the system environment jdk to start"
start javaw %JAVA_OPTS% %JAVA_MEM_OPTS% %CONFIG_FILES% -cp %CLASSPATH% %MAIN_CLASS%
) else (
echo "Use the inner package jdk to start"
start %INNER_EXE% %JAVA_OPTS% %JAVA_MEM_OPTS% %CONFIG_FILES% -cp %CLASSPATH% %MAIN_CLASS%
)
echo "Service Start Success!"
for /f "tokens=1-5" %%i in ('netstat -ano^|findstr ":%SERVER_PORT%"') do (
echo Service PID: %%m , Port %SERVER_PORT%
goto q
)
:q
pause
+129
View File
@@ -0,0 +1,129 @@
#!/bin/bash
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# project name
SERVER_NAME="${project.artifactId}"
# jar file name
JAR_NAME="${project.build.finalName}.jar"
# cd bin dir
cd `dirname $0`
# bin dir
BIN_DIR=`pwd`
# return root dir
cd ..
# root path dir
DEPLOY_DIR=`pwd`
# config dir
CONF_DIR=$DEPLOY_DIR/config
# server port
SERVER_PORT=1159
PIDS=`ps -ef | grep java | grep "$CONF_DIR" | awk '{print $2}'`
if [ "$1" = "status" ]; then
if [ -n "$PIDS" ]; then
echo "The HertzBeat $SERVER_NAME is running...!"
echo "PID: $PIDS"
exit 0
else
echo "The HertzBeat $SERVER_NAME is stopped"
exit 0
fi
fi
if [ -n "$PIDS" ]; then
echo "ERROR: The HertzBeat $SERVER_NAME already started!"
echo "PID: $PIDS"
exit 1
fi
if [ -n "$SERVER_PORT" ]; then
# linux - find the port whether used
SERVER_PORT_COUNT=`netstat -tln | grep :$SERVER_PORT | wc -l`
if [ $SERVER_PORT_COUNT -gt 0 ]; then
echo "ERROR: netstat the HertzBeat $SERVER_NAME port $SERVER_PORT already used!"
exit 1
fi
# mac - find the port whether used
LSOF_AVA=`command -v lsof | wc -l`
if [ $LSOF_AVA -gt 0 ]; then
SERVER_PORT_COUNT=`lsof -i:$SERVER_PORT | grep java | wc -l`
if [ $SERVER_PORT_COUNT -gt 0 ]; then
echo "ERROR: lsof the HertzBeat $SERVER_NAME port $SERVER_PORT already used!"
exit 1
fi
fi
fi
MAIN_CLASS="org.apache.hertzbeat.collector.Collector"
EXT_LIB_PATH="$DEPLOY_DIR/ext-lib"
CLASSPATH="$DEPLOY_DIR/$JAR_NAME:$EXT_LIB_PATH/*"
# log dir
LOGS_DIR=$DEPLOY_DIR/logs
# create logs dir when not exist
if [ ! -d $LOGS_DIR ]; then
mkdir $LOGS_DIR
fi
# JVM Configuration
JAVA_OPTS=" -Duser.timezone=Asia/Shanghai -Dfile.encoding=UTF-8 -Doracle.jdbc.timezoneAsRegion=false --add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED"
JAVA_MEM_OPTS=" -server -XX:SurvivorRatio=6 -XX:+UseParallelGC -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=$LOGS_DIR"
# load logback config
LOG_IMPL_FILE=logback-spring.xml
LOGGING_CONFIG=""
if [ -f "$CONF_DIR/$LOG_IMPL_FILE" ]
then
LOGGING_CONFIG="-Dlogging.config=$CONF_DIR/$LOG_IMPL_FILE"
fi
CONFIG_FILES=" -Dlogging.path=$LOGS_DIR $LOGGING_CONFIG -Dspring.config.location=$CONF_DIR/ "
echo -e "You can review logs at hertzbeat/logs"
echo -e "Starting the HertzBeat $SERVER_NAME ..."
if [ -f "./java/bin/java" ]; then
echo -e "Use the inner package jdk to start"
nohup ./java/bin/java $JAVA_OPTS $JAVA_MEM_OPTS $CONFIG_FILES -cp $CLASSPATH $MAIN_CLASS >logs/startup.log 2>&1 &
else
JAVA_EXIST=`which java | grep bin | wc -l`
if [ $JAVA_EXIST -le 0 ]; then
echo -e "ERROR: there is no java${java.version}+ environment, please config java environment."
exit 1
fi
echo -e "Use the system environment jdk to start"
nohup java $JAVA_OPTS $JAVA_MEM_OPTS $CONFIG_FILES -cp $CLASSPATH $MAIN_CLASS >logs/startup.log 2>&1 &
fi
COUNT=0
while [ $COUNT -lt 1 ]; do
echo "... "
sleep 1
if [ -n "$SERVER_PORT" ]; then
COUNT=`netstat -an | grep $SERVER_PORT | wc -l`
else
COUNT=`ps -f | grep java | grep "$DEPLOY_DIR" | awk '{print $2}' | wc -l`
fi
if [ $COUNT -gt 0 ]; then
break
fi
done
echo "Service Start Success!"
PIDS=`ps -f | grep java | grep "$DEPLOY_DIR" | awk '{print $2}'`
echo "Service PID: $PIDS"
@@ -0,0 +1,106 @@
<!--
~ Licensed to the Apache Software Foundation (ASF) under one or more
~ contributor license agreements. See the NOTICE file distributed with
~ this work for additional information regarding copyright ownership.
~ The ASF licenses this file to You under the Apache License, Version 2.0
~ (the "License"); you may not use this file except in compliance with
~ the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd
http://maven.apache.org/ASSEMBLY/2.0.0 ">
<!--Required, will be appended to the end of the packaged file name-->
<id>docker-compose</id>
<includeBaseDirectory>true</includeBaseDirectory>
<baseDirectory>apache-hertzbeat-${hzb.version}-docker-compose</baseDirectory>
<!--Packaging type, multiple types can be set, different types will be packaged when packaging-->
<formats>
<format>tar.gz</format>
</formats>
<fileSets>
<fileSet>
<directory>../script/docker-compose/hertzbeat-mysql-iotdb</directory>
<filtered>true</filtered>
<includes>
<include>conf/**</include>
<include>*.yaml</include>
<include>*.md</include>
<include>ext-lib/README</include>
</includes>
<outputDirectory>hertzbeat-mysql-iotdb</outputDirectory>
</fileSet>
<fileSet>
<directory>../script/docker-compose/hertzbeat-mysql-tdengine</directory>
<filtered>true</filtered>
<includes>
<include>conf/**</include>
<include>*.yaml</include>
<include>*.md</include>
<include>ext-lib/README</include>
</includes>
<outputDirectory>hertzbeat-mysql-tdengine</outputDirectory>
</fileSet>
<fileSet>
<directory>../script/docker-compose/hertzbeat-mysql-victoria-metrics</directory>
<filtered>true</filtered>
<includes>
<include>conf/**</include>
<include>*.yaml</include>
<include>*.md</include>
<include>ext-lib/README</include>
</includes>
<outputDirectory>hertzbeat-mysql-victoria-metrics</outputDirectory>
</fileSet>
<fileSet>
<directory>../script/docker-compose/hertzbeat-postgresql-victoria-metrics</directory>
<filtered>true</filtered>
<includes>
<include>conf/**</include>
<include>*.yaml</include>
<include>*.md</include>
<include>ext-lib/README</include>
</includes>
<outputDirectory>hertzbeat-postgresql-victoria-metrics</outputDirectory>
</fileSet>
<fileSet>
<directory>../script/docker-compose/hertzbeat-postgresql-greptimedb</directory>
<filtered>true</filtered>
<includes>
<include>conf/**</include>
<include>*.yaml</include>
<include>*.md</include>
<include>ext-lib/README</include>
</includes>
<outputDirectory>hertzbeat-postgresql-greptimedb</outputDirectory>
</fileSet>
<fileSet>
<directory>../script/docker-compose</directory>
<filtered>true</filtered>
<includes>
<include>README.md</include>
<include>LICENSE</include>
</includes>
<outputDirectory>/</outputDirectory>
</fileSet>
<!-- doc -->
<fileSet>
<directory>../</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>LICENSE</include>
<include>NOTICE</include>
</includes>
</fileSet>
</fileSets>
</assembly>
+126
View File
@@ -0,0 +1,126 @@
<!--
~ Licensed to the Apache Software Foundation (ASF) under one or more
~ contributor license agreements. See the NOTICE file distributed with
~ this work for additional information regarding copyright ownership.
~ The ASF licenses this file to You under the Apache License, Version 2.0
~ (the "License"); you may not use this file except in compliance with
~ the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd
http://maven.apache.org/ASSEMBLY/2.0.0 ">
<!--Required, will be appended to the end of the packaged file name-->
<id>docker-bin</id>
<includeBaseDirectory>true</includeBaseDirectory>
<baseDirectory>hertzbeat</baseDirectory>
<!--Packaging type, multiple types can be set, different types will be packaged when packaging-->
<formats>
<format>tar.gz</format>
</formats>
<!--Third-party dependency settings-->
<dependencySets>
<dependencySet>
<!--Use artifacts in the project, third-party packages packaged into the lib directory of the tar.gz file-->
<useProjectArtifact>true</useProjectArtifact>
<outputDirectory>lib</outputDirectory>
</dependencySet>
</dependencySets>
<!--File-related settings-->
<fileSets>
<!--All script files under the bin directory are output to the bin directory after packaging-->
<fileSet>
<directory>../script/assembly/server/bin</directory>
<!-- Whether to perform property replacement, that is, use ${project.artifactId} -->
<filtered>true</filtered>
<outputDirectory>bin</outputDirectory>
<fileMode>0755</fileMode>
</fileSet>
<!-- Configuration files under the src/main/resources directory are packaged to the config directory-->
<fileSet>
<directory>src/main/resources</directory>
<includes>
<include>application.yml</include>
<include>logback-spring.xml</include>
<include>sureness.yml</include>
</includes>
<filtered>true</filtered>
<outputDirectory>${file.separator}config</outputDirectory>
</fileSet>
<!-- Configuration files under the src/main/resources/define directory are packaged to the define directory -->
<fileSet>
<directory>../hertzbeat-manager/src/main/resources</directory>
<includes>
<include>define/**</include>
</includes>
<filtered>true</filtered>
<outputDirectory>${file.separator}</outputDirectory>
</fileSet>
<!-- Pack the startup jar in the target directory to the directory-->
<fileSet>
<directory>target</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>*.jar</include>
</includes>
</fileSet>
<!-- Pack the static resources of the web app into the dist directory-->
<fileSet>
<directory>../web-app/dist</directory>
<outputDirectory>dist</outputDirectory>
</fileSet>
<!-- external lib -->
<fileSet>
<directory>../script/ext-lib</directory>
<includes>
<include>**/*</include>
</includes>
<outputDirectory>ext-lib</outputDirectory>
</fileSet>
<!-- license -->
<fileSet>
<directory>../</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>README.md</include>
</includes>
</fileSet>
<fileSet>
<directory>../material/licenses</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>LICENSE</include>
<include>NOTICE</include>
</includes>
</fileSet>
<fileSet>
<directory>../material/licenses/backend</directory>
<outputDirectory>licenses</outputDirectory>
<includes>
<include>LICENSE-*</include>
</includes>
</fileSet>
<fileSet>
<directory>../material/licenses/frontend</directory>
<outputDirectory>licenses</outputDirectory>
<includes>
<include>LICENSE-*</include>
</includes>
</fileSet>
</fileSets>
</assembly>
@@ -0,0 +1,133 @@
<!--
~ Licensed to the Apache Software Foundation (ASF) under one or more
~ contributor license agreements. See the NOTICE file distributed with
~ this work for additional information regarding copyright ownership.
~ The ASF licenses this file to You under the Apache License, Version 2.0
~ (the "License"); you may not use this file except in compliance with
~ the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd
http://maven.apache.org/ASSEMBLY/2.0.0 ">
<!--Required, will be appended to the end of the packaged file name-->
<id>bin-linux_amd64</id>
<includeBaseDirectory>true</includeBaseDirectory>
<baseDirectory>apache-hertzbeat-${hzb.version}</baseDirectory>
<!--Packaging type, multiple types can be set, different types will be packaged when packaging-->
<formats>
<format>tar.gz</format>
</formats>
<!--Third-party dependency settings-->
<dependencySets>
<dependencySet>
<!--Use artifacts in the project, third-party packages packaged into the lib directory of the tar.gz file-->
<useProjectArtifact>true</useProjectArtifact>
<outputDirectory>lib</outputDirectory>
</dependencySet>
</dependencySets>
<!--File-related settings-->
<fileSets>
<!--All script files under the bin directory are output to the bin directory after packaging-->
<fileSet>
<directory>../script/assembly/server/bin</directory>
<!-- Whether to perform property replacement, that is, use ${project.artifactId} -->
<filtered>true</filtered>
<outputDirectory>bin</outputDirectory>
<fileMode>0755</fileMode>
</fileSet>
<!-- Configuration files under the src/main/resources directory are packaged to the config directory-->
<fileSet>
<directory>src/main/resources</directory>
<includes>
<include>application.yml</include>
<include>logback-spring.xml</include>
<include>sureness.yml</include>
</includes>
<!-- Whether to perform property replacement, that is, use ${project.artifactId} -->
<filtered>true</filtered>
<outputDirectory>${file.separator}config</outputDirectory>
</fileSet>
<!-- Configuration files under the src/main/resources/define directory are packaged to the define directory -->
<fileSet>
<directory>../hertzbeat-manager/src/main/resources</directory>
<includes>
<include>define/**</include>
</includes>
<filtered>true</filtered>
<outputDirectory>${file.separator}</outputDirectory>
</fileSet>
<!-- Pack the startup jar in the target directory to the directory-->
<fileSet>
<directory>target</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>*.jar</include>
</includes>
</fileSet>
<!-- Pack the static resources of the web app into the directory-->
<fileSet>
<directory>../web-app/dist</directory>
<outputDirectory>dist</outputDirectory>
</fileSet>
<!-- copy jdk -->
<fileSet>
<directory>../jdk/linux-amd64</directory>
<outputDirectory>java</outputDirectory>
</fileSet>
<!-- external lib -->
<fileSet>
<directory>../script/ext-lib</directory>
<includes>
<include>**/*</include>
</includes>
<outputDirectory>ext-lib</outputDirectory>
</fileSet>
<!-- license -->
<fileSet>
<directory>../</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>README.md</include>
</includes>
</fileSet>
<fileSet>
<directory>../material/licenses</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>LICENSE</include>
<include>NOTICE</include>
</includes>
</fileSet>
<fileSet>
<directory>../material/licenses/backend</directory>
<outputDirectory>licenses</outputDirectory>
<includes>
<include>LICENSE-*</include>
</includes>
</fileSet>
<fileSet>
<directory>../material/licenses/frontend</directory>
<outputDirectory>licenses</outputDirectory>
<includes>
<include>LICENSE-*</include>
</includes>
</fileSet>
</fileSets>
</assembly>
@@ -0,0 +1,133 @@
<!--
~ Licensed to the Apache Software Foundation (ASF) under one or more
~ contributor license agreements. See the NOTICE file distributed with
~ this work for additional information regarding copyright ownership.
~ The ASF licenses this file to You under the Apache License, Version 2.0
~ (the "License"); you may not use this file except in compliance with
~ the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd
http://maven.apache.org/ASSEMBLY/2.0.0 ">
<!--Required, will be appended to the end of the packaged file name-->
<id>bin-linux_arm64</id>
<includeBaseDirectory>true</includeBaseDirectory>
<baseDirectory>apache-hertzbeat-${hzb.version}</baseDirectory>
<!--Packaging type, multiple types can be set, different types will be packaged when packaging-->
<formats>
<format>tar.gz</format>
</formats>
<!--Third-party dependency settings-->
<dependencySets>
<dependencySet>
<!--Use artifacts in the project, third-party packages packaged into the lib directory of the tar.gz file-->
<useProjectArtifact>true</useProjectArtifact>
<outputDirectory>lib</outputDirectory>
</dependencySet>
</dependencySets>
<!--File-related settings-->
<fileSets>
<!--All script files under the bin directory are output to the bin directory after packaging-->
<fileSet>
<directory>../script/assembly/server/bin</directory>
<!-- Whether to perform property replacement, that is, use ${project.artifactId} -->
<filtered>true</filtered>
<outputDirectory>bin</outputDirectory>
<fileMode>0755</fileMode>
</fileSet>
<!-- Configuration files under the src/main/resources directory are packaged to the config directory-->
<fileSet>
<directory>src/main/resources</directory>
<includes>
<include>application.yml</include>
<include>logback-spring.xml</include>
<include>sureness.yml</include>
</includes>
<!-- Whether to perform property replacement, that is, use ${project.artifactId} -->
<filtered>true</filtered>
<outputDirectory>${file.separator}config</outputDirectory>
</fileSet>
<!-- Configuration files under the src/main/resources/define directory are packaged to the define directory -->
<fileSet>
<directory>../hertzbeat-manager/src/main/resources</directory>
<includes>
<include>define/**</include>
</includes>
<filtered>true</filtered>
<outputDirectory>${file.separator}</outputDirectory>
</fileSet>
<!-- Pack the startup jar in the target directory to the directory-->
<fileSet>
<directory>target</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>*.jar</include>
</includes>
</fileSet>
<!-- Pack the static resources of the web app into the directory-->
<fileSet>
<directory>../web-app/dist</directory>
<outputDirectory>dist</outputDirectory>
</fileSet>
<!-- copy jdk -->
<fileSet>
<directory>../jdk/linux-arm64</directory>
<outputDirectory>java</outputDirectory>
</fileSet>
<!-- external lib -->
<fileSet>
<directory>../script/ext-lib</directory>
<includes>
<include>**/*</include>
</includes>
<outputDirectory>ext-lib</outputDirectory>
</fileSet>
<!-- license -->
<fileSet>
<directory>../</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>README.md</include>
</includes>
</fileSet>
<fileSet>
<directory>../material/licenses</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>LICENSE</include>
<include>NOTICE</include>
</includes>
</fileSet>
<fileSet>
<directory>../material/licenses/backend</directory>
<outputDirectory>licenses</outputDirectory>
<includes>
<include>LICENSE-*</include>
</includes>
</fileSet>
<fileSet>
<directory>../material/licenses/frontend</directory>
<outputDirectory>licenses</outputDirectory>
<includes>
<include>LICENSE-*</include>
</includes>
</fileSet>
</fileSets>
</assembly>
@@ -0,0 +1,133 @@
<!--
~ Licensed to the Apache Software Foundation (ASF) under one or more
~ contributor license agreements. See the NOTICE file distributed with
~ this work for additional information regarding copyright ownership.
~ The ASF licenses this file to You under the Apache License, Version 2.0
~ (the "License"); you may not use this file except in compliance with
~ the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd
http://maven.apache.org/ASSEMBLY/2.0.0 ">
<!--Required, will be appended to the end of the packaged file name-->
<id>bin-macos_amd64</id>
<includeBaseDirectory>true</includeBaseDirectory>
<baseDirectory>apache-hertzbeat-${hzb.version}</baseDirectory>
<!--Packaging type, multiple types can be set, different types will be packaged when packaging-->
<formats>
<format>tar.gz</format>
</formats>
<!--Third-party dependency settings-->
<dependencySets>
<dependencySet>
<!--Use artifacts in the project, third-party packages packaged into the lib directory of the tar.gz file-->
<useProjectArtifact>true</useProjectArtifact>
<outputDirectory>lib</outputDirectory>
</dependencySet>
</dependencySets>
<!--File-related settings-->
<fileSets>
<!--All script files under the bin directory are output to the bin directory after packaging-->
<fileSet>
<directory>../script/assembly/server/bin</directory>
<!-- Whether to perform property replacement, that is, use ${project.artifactId} -->
<filtered>true</filtered>
<outputDirectory>bin</outputDirectory>
<fileMode>0755</fileMode>
</fileSet>
<!-- Configuration files under the src/main/resources directory are packaged to the config directory-->
<fileSet>
<directory>src/main/resources</directory>
<includes>
<include>application.yml</include>
<include>logback-spring.xml</include>
<include>sureness.yml</include>
</includes>
<!-- Whether to perform property replacement, that is, use ${project.artifactId} -->
<filtered>true</filtered>
<outputDirectory>${file.separator}config</outputDirectory>
</fileSet>
<!-- Configuration files under the src/main/resources/define directory are packaged to the define directory -->
<fileSet>
<directory>../hertzbeat-manager/src/main/resources</directory>
<includes>
<include>define/**</include>
</includes>
<filtered>true</filtered>
<outputDirectory>${file.separator}</outputDirectory>
</fileSet>
<!-- Pack the startup jar in the target directory to the directory-->
<fileSet>
<directory>target</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>*.jar</include>
</includes>
</fileSet>
<!-- Pack the static resources of the web app into the directory-->
<fileSet>
<directory>../web-app/dist</directory>
<outputDirectory>dist</outputDirectory>
</fileSet>
<!-- copy jdk -->
<fileSet>
<directory>../jdk/macos-amd64</directory>
<outputDirectory>java</outputDirectory>
</fileSet>
<!-- external lib -->
<fileSet>
<directory>../script/ext-lib</directory>
<includes>
<include>**/*</include>
</includes>
<outputDirectory>ext-lib</outputDirectory>
</fileSet>
<!-- license -->
<fileSet>
<directory>../</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>README.md</include>
</includes>
</fileSet>
<fileSet>
<directory>../material/licenses</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>LICENSE</include>
<include>NOTICE</include>
</includes>
</fileSet>
<fileSet>
<directory>../material/licenses/backend</directory>
<outputDirectory>licenses</outputDirectory>
<includes>
<include>LICENSE-*</include>
</includes>
</fileSet>
<fileSet>
<directory>../material/licenses/frontend</directory>
<outputDirectory>licenses</outputDirectory>
<includes>
<include>LICENSE-*</include>
</includes>
</fileSet>
</fileSets>
</assembly>
@@ -0,0 +1,132 @@
<!--
~ Licensed to the Apache Software Foundation (ASF) under one or more
~ contributor license agreements. See the NOTICE file distributed with
~ this work for additional information regarding copyright ownership.
~ The ASF licenses this file to You under the Apache License, Version 2.0
~ (the "License"); you may not use this file except in compliance with
~ the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd
http://maven.apache.org/ASSEMBLY/2.0.0 ">
<!--Required, will be appended to the end of the packaged file name-->
<id>bin-macos_arm64</id>
<includeBaseDirectory>true</includeBaseDirectory>
<baseDirectory>apache-hertzbeat-${hzb.version}</baseDirectory>
<!--Packaging type, multiple types can be set, different types will be packaged when packaging-->
<formats>
<format>tar.gz</format>
</formats>
<!--Third-party dependency settings-->
<dependencySets>
<dependencySet>
<!--Use artifacts in the project, third-party packages packaged into the lib directory of the tar.gz file-->
<useProjectArtifact>true</useProjectArtifact>
<outputDirectory>lib</outputDirectory>
</dependencySet>
</dependencySets>
<!--File-related settings-->
<fileSets>
<!--All script files under the bin directory are output to the bin directory after packaging-->
<fileSet>
<directory>../script/assembly/server/bin</directory>
<!-- Whether to perform property replacement, that is, use ${project.artifactId} -->
<filtered>true</filtered>
<outputDirectory>bin</outputDirectory>
<fileMode>0755</fileMode>
</fileSet>
<!-- Configuration files under the src/main/resources directory are packaged to the config directory-->
<fileSet>
<directory>src/main/resources</directory>
<includes>
<include>application.yml</include>
<include>logback-spring.xml</include>
<include>sureness.yml</include>
</includes>
<filtered>true</filtered>
<outputDirectory>${file.separator}config</outputDirectory>
</fileSet>
<!-- Configuration files under the src/main/resources/define directory are packaged to the define directory -->
<fileSet>
<directory>../hertzbeat-manager/src/main/resources</directory>
<includes>
<include>define/**</include>
</includes>
<filtered>true</filtered>
<outputDirectory>${file.separator}</outputDirectory>
</fileSet>
<!-- Pack the startup jar in the target directory to the directory-->
<fileSet>
<directory>target</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>*.jar</include>
</includes>
</fileSet>
<!-- Pack the static resources of the web app into the directory-->
<fileSet>
<directory>../web-app/dist</directory>
<outputDirectory>dist</outputDirectory>
</fileSet>
<!-- copy jdk -->
<fileSet>
<directory>../jdk/macos-arm64</directory>
<outputDirectory>java</outputDirectory>
</fileSet>
<!-- external lib -->
<fileSet>
<directory>../script/ext-lib</directory>
<includes>
<include>**/*</include>
</includes>
<outputDirectory>ext-lib</outputDirectory>
</fileSet>
<!-- license -->
<fileSet>
<directory>../</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>README.md</include>
</includes>
</fileSet>
<fileSet>
<directory>../material/licenses</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>LICENSE</include>
<include>NOTICE</include>
</includes>
</fileSet>
<fileSet>
<directory>../material/licenses/backend</directory>
<outputDirectory>licenses</outputDirectory>
<includes>
<include>LICENSE-*</include>
</includes>
</fileSet>
<fileSet>
<directory>../material/licenses/frontend</directory>
<outputDirectory>licenses</outputDirectory>
<includes>
<include>LICENSE-*</include>
</includes>
</fileSet>
</fileSets>
</assembly>
@@ -0,0 +1,133 @@
<!--
~ Licensed to the Apache Software Foundation (ASF) under one or more
~ contributor license agreements. See the NOTICE file distributed with
~ this work for additional information regarding copyright ownership.
~ The ASF licenses this file to You under the Apache License, Version 2.0
~ (the "License"); you may not use this file except in compliance with
~ the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd
http://maven.apache.org/ASSEMBLY/2.0.0 ">
<!--Required, will be appended to the end of the packaged file name-->
<id>bin-windows64</id>
<includeBaseDirectory>true</includeBaseDirectory>
<baseDirectory>apache-hertzbeat-${hzb.version}</baseDirectory>
<!--Packaging type, multiple types can be set, different types will be packaged when packaging-->
<formats>
<format>zip</format>
</formats>
<!--Third-party dependency settings-->
<dependencySets>
<dependencySet>
<!--Use artifacts in the project, third-party packages packaged into the lib directory of the tar.gz file-->
<useProjectArtifact>true</useProjectArtifact>
<outputDirectory>lib</outputDirectory>
</dependencySet>
</dependencySets>
<!--File-related settings-->
<fileSets>
<!--All script files under the bin directory are output to the bin directory after packaging-->
<fileSet>
<directory>../script/assembly/server/bin</directory>
<!-- Whether to perform property replacement, that is, use ${project.artifactId} -->
<filtered>true</filtered>
<outputDirectory>bin</outputDirectory>
<fileMode>0755</fileMode>
</fileSet>
<!-- Configuration files under the src/main/resources directory are packaged to the config directory-->
<fileSet>
<directory>src/main/resources</directory>
<includes>
<include>application.yml</include>
<include>logback-spring.xml</include>
<include>sureness.yml</include>
</includes>
<!-- Whether to perform property replacement, that is, use ${project.artifactId} -->
<filtered>true</filtered>
<outputDirectory>${file.separator}config</outputDirectory>
</fileSet>
<!-- Configuration files under the src/main/resources/define directory are packaged to the define directory -->
<fileSet>
<directory>../hertzbeat-manager/src/main/resources</directory>
<includes>
<include>define/**</include>
</includes>
<filtered>true</filtered>
<outputDirectory>${file.separator}</outputDirectory>
</fileSet>
<!-- Pack the startup jar in the target directory to the directory-->
<fileSet>
<directory>target</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>*.jar</include>
</includes>
</fileSet>
<!-- Pack the static resources of the web app into the directory-->
<fileSet>
<directory>../web-app/dist</directory>
<outputDirectory>dist</outputDirectory>
</fileSet>
<!-- copy jdk -->
<fileSet>
<directory>../jdk/windows-64</directory>
<outputDirectory>java</outputDirectory>
</fileSet>
<!-- external lib -->
<fileSet>
<directory>../script/ext-lib</directory>
<includes>
<include>**/*</include>
</includes>
<outputDirectory>ext-lib</outputDirectory>
</fileSet>
<!-- license -->
<fileSet>
<directory>../</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>README.md</include>
</includes>
</fileSet>
<fileSet>
<directory>../material/licenses</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>LICENSE</include>
<include>NOTICE</include>
</includes>
</fileSet>
<fileSet>
<directory>../material/licenses/backend</directory>
<outputDirectory>licenses</outputDirectory>
<includes>
<include>LICENSE-*</include>
</includes>
</fileSet>
<fileSet>
<directory>../material/licenses/frontend</directory>
<outputDirectory>licenses</outputDirectory>
<includes>
<include>LICENSE-*</include>
</includes>
</fileSet>
</fileSets>
</assembly>
+126
View File
@@ -0,0 +1,126 @@
<!--
~ Licensed to the Apache Software Foundation (ASF) under one or more
~ contributor license agreements. See the NOTICE file distributed with
~ this work for additional information regarding copyright ownership.
~ The ASF licenses this file to You under the Apache License, Version 2.0
~ (the "License"); you may not use this file except in compliance with
~ the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd
http://maven.apache.org/ASSEMBLY/2.0.0 ">
<!--Required, will be appended to the end of the packaged file name-->
<id>bin</id>
<includeBaseDirectory>true</includeBaseDirectory>
<baseDirectory>apache-hertzbeat-${hzb.version}-bin</baseDirectory>
<!--Packaging type, multiple types can be set, different types will be packaged when packaging-->
<formats>
<format>tar.gz</format>
</formats>
<!--Third-party dependency settings-->
<dependencySets>
<dependencySet>
<!--Use artifacts in the project, third-party packages packaged into the lib directory of the tar.gz file-->
<useProjectArtifact>true</useProjectArtifact>
<outputDirectory>lib</outputDirectory>
</dependencySet>
</dependencySets>
<!--File-related settings-->
<fileSets>
<!--All script files under the bin directory are output to the bin directory after packaging-->
<fileSet>
<directory>../script/assembly/server/bin</directory>
<!-- Whether to perform property replacement, that is, use ${project.artifactId} -->
<filtered>true</filtered>
<outputDirectory>bin</outputDirectory>
<fileMode>0755</fileMode>
</fileSet>
<!-- Configuration files under the src/main/resources directory are packaged to the config directory-->
<fileSet>
<directory>src/main/resources</directory>
<includes>
<include>application.yml</include>
<include>logback-spring.xml</include>
<include>sureness.yml</include>
</includes>
<filtered>true</filtered>
<outputDirectory>${file.separator}config</outputDirectory>
</fileSet>
<!-- Configuration files under the src/main/resources/define directory are packaged to the define directory -->
<fileSet>
<directory>../hertzbeat-manager/src/main/resources</directory>
<includes>
<include>define/**</include>
</includes>
<filtered>true</filtered>
<outputDirectory>${file.separator}</outputDirectory>
</fileSet>
<!-- Pack the startup jar in the target directory to the directory-->
<fileSet>
<directory>target</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>*.jar</include>
</includes>
</fileSet>
<!-- Pack the static resources of the web app into the dist directory-->
<fileSet>
<directory>../web-app/dist</directory>
<outputDirectory>dist</outputDirectory>
</fileSet>
<!-- external lib -->
<fileSet>
<directory>../script/ext-lib</directory>
<includes>
<include>**/*</include>
</includes>
<outputDirectory>ext-lib</outputDirectory>
</fileSet>
<!-- license -->
<fileSet>
<directory>../</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>README.md</include>
</includes>
</fileSet>
<fileSet>
<directory>../material/licenses</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>LICENSE</include>
<include>NOTICE</include>
</includes>
</fileSet>
<fileSet>
<directory>../material/licenses/backend</directory>
<outputDirectory>licenses</outputDirectory>
<includes>
<include>LICENSE-*</include>
</includes>
</fileSet>
<fileSet>
<directory>../material/licenses/frontend</directory>
<outputDirectory>licenses</outputDirectory>
<includes>
<include>LICENSE-*</include>
</includes>
</fileSet>
</fileSets>
</assembly>
+67
View File
@@ -0,0 +1,67 @@
#!/bin/sh
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# project name
SERVER_NAME="${project.build.finalName}"
# jar name
JAR_NAME="${project.build.finalName}.jar"
# cd bin
cd `dirname $0`
# bin dir
BIN_DIR=`pwd`
# return root
cd ..
# root path dir
DEPLOY_DIR=`pwd`
# config dir
# absolute directory of external configuration files, if it is a directory, it should end with '/'you can also directly specify a file.
# if a directory is specified, spring will read all configuration files in the directory
CONF_DIR=$DEPLOY_DIR/config
MAIN_CLASS="org.apache.hertzbeat.startup.HertzBeatApplication"
EXT_LIB_PATH="$DEPLOY_DIR/ext-lib"
CLASSPATH="$DEPLOY_DIR/$JAR_NAME:$EXT_LIB_PATH/*"
# log dir
LOGS_DIR=$DEPLOY_DIR/logs
# create logs dir when not exist
if [ ! -d $LOGS_DIR ]; then
mkdir $LOGS_DIR
fi
# JVM Configuration
if [ -z "$JAVA_OPTS" ]; then
JAVA_OPTS=" -Dfile.encoding=UTF-8 -Doracle.jdbc.timezoneAsRegion=false --add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED"
else
JAVA_OPTS="${JAVA_OPTS} -Dfile.encoding=UTF-8 -Doracle.jdbc.timezoneAsRegion=false"
fi
# JVM Configuration
JAVA_MEM_OPTS=" -server -XX:SurvivorRatio=6 -XX:+UseParallelGC -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=$LOGS_DIR"
# load logback config
LOG_IMPL_FILE=logback-spring.xml
LOGGING_CONFIG=""
if [ -f "$CONF_DIR/$LOG_IMPL_FILE" ]
then
LOGGING_CONFIG="-Dlogging.config=$CONF_DIR/$LOG_IMPL_FILE"
fi
CONFIG_FILES=" -Dlogging.path=$LOGS_DIR $LOGGING_CONFIG -Dspring.config.location=$CONF_DIR/ "
echo -e "Starting the HertzBeat $SERVER_NAME ..."
java $JAVA_OPTS $JAVA_MEM_OPTS $CONFIG_FILES -cp $CLASSPATH $MAIN_CLASS --spring.profiles.active=prod
+29
View File
@@ -0,0 +1,29 @@
#!/bin/bash
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# restart start time
startTime=$(date +%s)
echo -e "\033[0;31mCurrent Time is$(date "+%Y-%m-%d %H:%M:%S") Restart Now!\033[0m"
./shutdown.sh
echo
sleep 2
echo
./startup.sh
# restart end time
endTime=$(date +%s)
echo -e "\033[0;31mCurrent Time is$(date "+%Y-%m-%d %H:%M:%S") Restart SuccessSpend $((endTime - startTime)) seconds \033[0m";
+38
View File
@@ -0,0 +1,38 @@
@rem
@rem Licensed to the Apache Software Foundation (ASF) under one or more
@rem contributor license agreements. See the NOTICE file distributed with
@rem this work for additional information regarding copyright ownership.
@rem The ASF licenses this file to You under the Apache License, Version 2.0
@rem (the "License"); you may not use this file except in compliance with
@rem the License. You may obtain a copy of the License at
@rem
@rem http://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@title HertzBeat
@echo off
setlocal enabledelayedexpansion
set SERVER_NAME="${project.artifactId}"
set SERVER_PORT=1157
echo Start shutdown HertzBeat %SERVER_NAME%
for /f "tokens=1-5" %%i in ('netstat -ano^|findstr ":%SERVER_PORT%"') do (
echo kill the process %%m who use the port
taskkill /pid %%m -t -f
echo Shutdown Apache HertzBeat %SERVER_NAME% Success!
goto q
)
echo Failed shutdown Apache HertzBeat %SERVER_NAME%
:q
pause
+33
View File
@@ -0,0 +1,33 @@
#!/bin/bash
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# project name
APPLICATION="${project.artifactId}"
# jar file name
APPLICATION_JAR="${project.build.finalName}.jar"
# find the service pid, kill -9 pid
PID=$(ps -ef | grep java | grep "${APPLICATION_JAR}" | grep -v grep | awk '{ print $2 }')
if [[ -z "$PID" ]]
then
echo Apache HertzBeat ${APPLICATION} is already stopped
else
echo kill ${PID}
kill -9 ${PID}
echo Shutdown Apache HertzBeat ${APPLICATION} Success!
fi
+85
View File
@@ -0,0 +1,85 @@
@rem
@rem Licensed to the Apache Software Foundation (ASF) under one or more
@rem contributor license agreements. See the NOTICE file distributed with
@rem this work for additional information regarding copyright ownership.
@rem The ASF licenses this file to You under the Apache License, Version 2.0
@rem (the "License"); you may not use this file except in compliance with
@rem the License. You may obtain a copy of the License at
@rem
@rem http://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@title HertzBeat
@echo off
setlocal enabledelayedexpansion
set SERVER_NAME=${project.artifactId}
set JAR_NAME=${project.build.finalName}.jar
rem enter the bin directory
cd /d %~dp0
cd ..
set DEPLOY_DIR=%~dp0..
echo %DEPLOY_DIR%
set CONF_DIR=%DEPLOY_DIR%\config
echo %CONF_DIR%
set SERVER_PORT=1157
for /f "tokens=1-5" %%i in ('netstat -ano^|findstr "0.0.0.0:%SERVER_PORT%"') do (
echo The HertzBeat %SERVER_NAME% port %SERVER_PORT% already used!
echo exit!
goto q
)
set MAIN_CLASS=org.apache.hertzbeat.startup.HertzBeatApplication
set LOGS_DIR=%DEPLOY_DIR%\logs
set EXT_LIB_PATH=%DEPLOY_DIR%\ext-lib
set CLASSPATH=%DEPLOY_DIR%\%JAR_NAME%;%EXT_LIB_PATH%\*
if not exist %LOGS_DIR% (
mkdir %LOGS_DIR%
)
rem JVM Configuration
set JAVA_OPTS= -Duser.timezone=Asia/Shanghai -Dfile.encoding=UTF-8 -Doracle.jdbc.timezoneAsRegion=false --add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED
set JAVA_MEM_OPTS= -server -XX:SurvivorRatio=6 -XX:+UseParallelGC -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=%LOGS_DIR%
set LOGGING_CONFIG=-Dlogging.config=%CONF_DIR%\logback-spring.xml
set CONFIG_FILES= -Dlogging.path=%LOGS_DIR% %LOGGING_CONFIG% -Dspring.config.location=%CONF_DIR%/
echo Starting the HertzBeat %SERVER_NAME% ...
set INNER_EXE=%DEPLOY_DIR%\java\bin\javaw.exe
if not exist %INNER_EXE% (
echo "Use the system environment jdk to start"
start javaw %JAVA_OPTS% %JAVA_MEM_OPTS% %CONFIG_FILES% -cp %CLASSPATH% %MAIN_CLASS%
) else (
echo "Use the inner package jdk to start"
start %INNER_EXE% %JAVA_OPTS% %JAVA_MEM_OPTS% %CONFIG_FILES% -cp %CLASSPATH% %MAIN_CLASS%
)
echo "Service Start Success!"
for /f "tokens=1-5" %%i in ('netstat -ano^|findstr ":%SERVER_PORT%"') do (
echo Service PID: %%m , Port %SERVER_PORT%
goto q
)
:q
pause
+133
View File
@@ -0,0 +1,133 @@
#!/bin/bash
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# project name
SERVER_NAME="${project.artifactId}"
# jar file name
JAR_NAME="${project.build.finalName}.jar"
# cd bin dir
cd `dirname $0`
# bin dir
BIN_DIR=`pwd`
# return root dir
cd ..
# root path dir
DEPLOY_DIR=`pwd`
# config dir
# absolute directory of external configuration files, if it is a directory, it should end with '/'you can also directly specify a file.
# if a directory is specified, spring will read all configuration files in the directory
CONF_DIR=$DEPLOY_DIR/config
# server port
SERVER_PORT=1157
PIDS=`ps -ef | grep java | grep "$CONF_DIR" | awk '{print $2}'`
if [ "$1" = "status" ]; then
if [ -n "$PIDS" ]; then
echo "The HertzBeat $SERVER_NAME is running...!"
echo "PID: $PIDS"
exit 0
else
echo "The HertzBeat $SERVER_NAME is stopped"
exit 0
fi
fi
if [ -n "$PIDS" ]; then
echo "ERROR: The HertzBeat $SERVER_NAME already started!"
echo "PID: $PIDS"
exit 1
fi
if [ -n "$SERVER_PORT" ]; then
# linux - find the port whether used
SERVER_PORT_COUNT=`netstat -tln | grep :$SERVER_PORT | wc -l`
if [ $SERVER_PORT_COUNT -gt 0 ]; then
echo "ERROR: netstat the HertzBeat $SERVER_NAME port $SERVER_PORT already used!"
exit 1
fi
# mac - find the port whether used
LSOF_AVA=`command -v lsof | wc -l`
if [ $LSOF_AVA -gt 0 ]; then
SERVER_PORT_COUNT=`lsof -i:$SERVER_PORT | grep java | wc -l`
if [ $SERVER_PORT_COUNT -gt 0 ]; then
echo "ERROR: lsof the HertzBeat $SERVER_NAME port $SERVER_PORT already used!"
exit 1
fi
fi
fi
MAIN_CLASS="org.apache.hertzbeat.startup.HertzBeatApplication"
EXT_LIB_PATH="$DEPLOY_DIR/ext-lib"
CLASSPATH="$DEPLOY_DIR/$JAR_NAME:$EXT_LIB_PATH/*"
# log dir
LOGS_DIR=$DEPLOY_DIR/logs
# create logs dir when not exist
if [ ! -d $LOGS_DIR ]; then
mkdir $LOGS_DIR
fi
# JVM Configuration
JAVA_OPTS=" -Duser.timezone=Asia/Shanghai -Dfile.encoding=UTF-8 -Doracle.jdbc.timezoneAsRegion=false --add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED"
JAVA_MEM_OPTS=" -server -XX:SurvivorRatio=6 -XX:+UseParallelGC -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=$LOGS_DIR"
# load logback config
LOG_IMPL_FILE=logback-spring.xml
LOGGING_CONFIG=""
if [ -f "$CONF_DIR/$LOG_IMPL_FILE" ]
then
LOGGING_CONFIG="-Dlogging.config=$CONF_DIR/$LOG_IMPL_FILE"
fi
CONFIG_FILES=" -Dlogging.path=$LOGS_DIR $LOGGING_CONFIG -Dspring.config.location=$CONF_DIR/ "
echo -e "You can review logs at hertzbeat/logs"
echo -e "Starting the HertzBeat $SERVER_NAME ..."
if [ -f "./java/bin/java" ]; then
echo -e "Use the inner package jdk to start"
nohup ./java/bin/java $JAVA_OPTS $JAVA_MEM_OPTS $CONFIG_FILES -cp $CLASSPATH $MAIN_CLASS >logs/startup.log 2>&1 &
else
JAVA_EXIST=`which java | grep bin | wc -l`
if [ $JAVA_EXIST -le 0 ]; then
echo -e "ERROR: there is no java${java.version}+ environment, please config java environment."
exit 1
fi
echo -e "Use the system environment jdk to start"
nohup java $JAVA_OPTS $JAVA_MEM_OPTS $CONFIG_FILES -cp $CLASSPATH $MAIN_CLASS >logs/startup.log 2>&1 &
fi
COUNT=0
while [ $COUNT -lt 1 ]; do
echo "... "
sleep 1
if [ -n "$SERVER_PORT" ]; then
COUNT=`netstat -an | grep $SERVER_PORT | wc -l`
else
COUNT=`ps -f | grep java | grep "$DEPLOY_DIR" | awk '{print $2}' | wc -l`
fi
if [ $COUNT -gt 0 ]; then
break
fi
done
echo "Service Start Success!"
PIDS=`ps -f | grep java | grep "$DEPLOY_DIR" | awk '{print $2}'`
echo "Service PID: $PIDS"
+398
View File
@@ -0,0 +1,398 @@
<?xml version="1.0"?>
<!--
~ Licensed to the Apache Software Foundation (ASF) under one or more
~ contributor license agreements. See the NOTICE file distributed with
~ this work for additional information regarding copyright ownership.
~ The ASF licenses this file to You under the Apache License, Version 2.0
~ (the "License"); you may not use this file except in compliance with
~ the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<!DOCTYPE module PUBLIC "-//Checkstyle//DTD Checkstyle Configuration 1.3//EN" "https://checkstyle.org/dtds/configuration_1_3.dtd">
<module name="Checker">
<module name="SuppressWarningsFilter"/>
<property name="charset" value="UTF-8"/>
<property name="severity" value="error"/>
<property name="fileExtensions" value="java, properties, xml"/>
<!-- Excludes all 'module-info.java' files -->
<!-- See https://checkstyle.org/config_filefilters.html -->
<module name="BeforeExecutionExclusionFileFilter">
<property name="fileNamePattern" value="module\-info\.java$"/>
</module>
<module name="SuppressionFilter">
<property name="file" value="${org.checkstyle.google.suppressionfilter.config}"
default="checkstyle-suppressions.xml"/>
<property name="optional" value="true"/>
</module>
<module name="LineLength">
<property name="fileExtensions" value="java"/>
<property name="max" value="200"/>
<property name="ignorePattern"
value="^package.*|^import.*|a href|href|http://|https://|ftp://"/>
</module>
<module name="TreeWalker">
<module name="OuterTypeFilename"/>
<module name="IllegalTokenText">
<property name="tokens" value="STRING_LITERAL, CHAR_LITERAL"/>
<property name="format"
value="\\u00(09|0(a|A)|0(c|C)|0(d|D)|22|27|5(C|c))|\\(0(10|11|12|14|15|42|47)|134)"/>
<property name="message"
value="Consider using special escape sequence instead of octal value or Unicode escaped value."/>
</module>
<module name="OneTopLevelClass"/>
<module name="NoLineWrap">
<property name="tokens" value="PACKAGE_DEF, IMPORT, STATIC_IMPORT"/>
</module>
<module name="EmptyBlock">
<property name="option" value="TEXT"/>
<property name="tokens"
value="LITERAL_TRY, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_SWITCH"/>
</module>
<module name="SuppressionXpathSingleFilter">
<property name="id" value="RightCurlyAlone"/>
<property name="query" value="//RCURLY[parent::SLIST[count(./*)=1]
or preceding-sibling::*[last()][self::LCURLY]]"/>
</module>
<module name="WhitespaceAfter">
<property name="tokens"
value="COMMA, SEMI, TYPECAST, LITERAL_IF, LITERAL_ELSE,
LITERAL_WHILE, LITERAL_DO, LITERAL_FOR, DO_WHILE"/>
</module>
<module name="OneStatementPerLine"/>
<module name="MultipleVariableDeclarations"/>
<module name="ArrayTypeStyle"/>
<module name="MissingSwitchDefault"/>
<module name="FallThrough"/>
<module name="UpperEll"/>
<module name="UnusedImports"/>
<module name="EmptyLineSeparator">
<property name="tokens"
value="PACKAGE_DEF, IMPORT, STATIC_IMPORT, CLASS_DEF, INTERFACE_DEF, ENUM_DEF,
STATIC_INIT, INSTANCE_INIT, METHOD_DEF, CTOR_DEF, VARIABLE_DEF, RECORD_DEF,
COMPACT_CTOR_DEF"/>
<property name="allowNoEmptyLineBetweenFields" value="true"/>
</module>
<module name="SeparatorWrap">
<property name="id" value="SeparatorWrapDot"/>
<property name="tokens" value="DOT"/>
<property name="option" value="nl"/>
</module>
<module name="SeparatorWrap">
<property name="id" value="SeparatorWrapEllipsis"/>
<property name="tokens" value="ELLIPSIS"/>
<property name="option" value="EOL"/>
</module>
<module name="SeparatorWrap">
<property name="id" value="SeparatorWrapArrayDeclarator"/>
<property name="tokens" value="ARRAY_DECLARATOR"/>
<property name="option" value="EOL"/>
</module>
<module name="SeparatorWrap">
<property name="id" value="SeparatorWrapMethodRef"/>
<property name="tokens" value="METHOD_REF"/>
<property name="option" value="nl"/>
</module>
<module name="PackageName">
<property name="format" value="^[a-z]+(\.[a-z][a-z0-9]*)*$"/>
<message key="name.invalidPattern"
value="Package name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="TypeName">
<property name="tokens" value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF,
ANNOTATION_DEF, RECORD_DEF"/>
<message key="name.invalidPattern"
value="Type name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="MemberName">
<property name="format" value="^[a-z][a-z0-9]?[a-zA-Z0-9]*$"/>
<message key="name.invalidPattern"
value="Member name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="ParameterName">
<property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$"/>
<message key="name.invalidPattern"
value="Parameter name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="LambdaParameterName">
<property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$"/>
<message key="name.invalidPattern"
value="Lambda parameter name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="CatchParameterName">
<property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$"/>
<message key="name.invalidPattern"
value="Catch parameter name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="LocalVariableName">
<property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$"/>
<message key="name.invalidPattern"
value="Local variable name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="PatternVariableName">
<property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$"/>
<message key="name.invalidPattern"
value="Pattern variable name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="ClassTypeParameterName">
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
<message key="name.invalidPattern"
value="Class type name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="RecordComponentName">
<property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$" />
<message key="name.invalidPattern" value="Record component name ''{0}'' must match pattern ''{1}''." />
</module>
<module name="RecordTypeParameterName">
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
<message key="name.invalidPattern"
value="Record type name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="RecordTypeParameterName">
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
<message key="name.invalidPattern"
value="Record type name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="MethodTypeParameterName">
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
<message key="name.invalidPattern"
value="Method type name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="InterfaceTypeParameterName">
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
<message key="name.invalidPattern"
value="Interface type name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="Indentation">
<property name="basicOffset" value="4"/>
<property name="braceAdjustment" value="0"/>
<property name="caseIndent" value="4"/>
<property name="throwsIndent" value="2"/>
<property name="lineWrappingIndentation" value="4"/>
<property name="arrayInitIndent" value="8"/>
</module>
<module name="AbbreviationAsWordInName">
<property name="ignoreFinal" value="false"/>
<property name="allowedAbbreviationLength" value="0"/>
<property name="allowedAbbreviations"
value="XML, URL, ID, FTP, DTO, VO, DO, TO, PO, BO, POJO, HTTP, IP, IE"/>
<property name="tokens"
value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, ANNOTATION_DEF, ANNOTATION_FIELD_DEF,
PARAMETER_DEF, VARIABLE_DEF, METHOD_DEF, PATTERN_VARIABLE_DEF, RECORD_DEF,
RECORD_COMPONENT_DEF"/>
</module>
<module name="NoWhitespaceBefore">
<property name="tokens"
value="COMMA, SEMI, POST_INC, POST_DEC, DOT,
LABELED_STAT, METHOD_REF"/>
<property name="allowLineBreaks" value="true"/>
</module>
<module name="ParenPad">
<property name="tokens"
value="ANNOTATION, ANNOTATION_FIELD_DEF, CTOR_CALL, CTOR_DEF, DOT, ENUM_CONSTANT_DEF,
EXPR, LITERAL_CATCH, LITERAL_DO, LITERAL_FOR, LITERAL_IF, LITERAL_NEW,
LITERAL_SWITCH, LITERAL_SYNCHRONIZED, LITERAL_WHILE, METHOD_CALL,
METHOD_DEF, QUESTION, RESOURCE_SPECIFICATION, SUPER_CTOR_CALL, LAMBDA,
RECORD_DEF"/>
</module>
<module name="AnnotationLocation">
<property name="id" value="AnnotationLocationMostCases"/>
<property name="tokens"
value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF,
RECORD_DEF, COMPACT_CTOR_DEF"/>
</module>
<module name="AnnotationLocation">
<property name="id" value="AnnotationLocationVariables"/>
<property name="tokens" value="VARIABLE_DEF"/>
<property name="allowSamelineMultipleAnnotations" value="true"/>
</module>
<module name="NonEmptyAtclauseDescription"/>
<module name="InvalidJavadocPosition"/>
<module name="JavadocTagContinuationIndentation">
<property name="offset" value="0"/>
</module>
<module name="AtclauseOrder">
<property name="tagOrder" value="@param, @return, @throws, @deprecated"/>
<property name="target"
value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF, VARIABLE_DEF"/>
</module>
<module name="JavadocMethod">
<property name="accessModifiers" value="public"/>
<property name="allowMissingParamTags" value="true"/>
<property name="allowMissingReturnTag" value="true"/>
<property name="allowedAnnotations" value="Override, Test"/>
<property name="tokens" value="METHOD_DEF, CTOR_DEF, ANNOTATION_FIELD_DEF, COMPACT_CTOR_DEF"/>
</module>
<module name="MissingJavadocType">
<property name="scope" value="protected"/>
<property name="tokens"
value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF,
RECORD_DEF, ANNOTATION_DEF"/>
<property name="excludeScope" value="nothing"/>
</module>
<module name="MethodName">
<property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9_]*$"/>
<message key="name.invalidPattern"
value="Method name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="SingleLineJavadoc">
<property name="ignoreInlineTags" value="false"/>
</module>
<module name="EmptyCatchBlock">
<property name="exceptionVariableName" value="ignore"/>
</module>
<module name="CommentsIndentation">
<property name="tokens" value="SINGLE_LINE_COMMENT, BLOCK_COMMENT_BEGIN"/>
</module>
<module name="SuppressionXpathFilter">
<property name="file" value="${org.checkstyle.google.suppressionxpathfilter.config}"
default="checkstyle-xpath-suppressions.xml"/>
<property name="optional" value="true"/>
</module>
<module name="SuppressWarningsHolder"/>
<module name="SuppressionCommentFilter">
<property name="offCommentFormat" value="CHECKSTYLE.OFF\: ([\w\|]+)"/>
<property name="onCommentFormat" value="CHECKSTYLE.ON\: ([\w\|]+)"/>
<property name="checkFormat" value="$1"/>
</module>
<module name="SuppressWithNearbyCommentFilter">
<property name="commentFormat" value="CHECKSTYLE.SUPPRESS\: ([\w\|]+)"/>
<property name="checkFormat" value="$1"/>
<property name="influenceFormat" value="1"/>
</module>
<module name="RegexpSinglelineJava">
<property name="format"
value="^.*( @author| @date).*" />
<property name="message"
value="Java file header cannot contain @author or @date" />
</module>
<!--
IMPORT CHECKS
-->
<module name="RedundantImport">
<!-- Checks for redundant import statements. -->
<property name="severity" value="error"/>
<message key="import.redundancy"
value="Redundant import {0}."/>
</module>
<!--
Temporarily disabled: https://github.com/apache/hertzbeat/issues/2594
-->
<!--<module name="ImportOrder">
<property name="severity" value="error"/>
&lt;!&ndash; This ensures that static imports go first. &ndash;&gt;
<property name="option" value="top"/>
<property name="sortStaticImportsAlphabetically" value="true"/>
<property name="tokens" value="STATIC_IMPORT, IMPORT"/>
<message key="import.ordering"
value="Import {0} appears after other imports that it should precede"/>
</module>-->
<module name="AvoidStarImport">
<property name="severity" value="error"/>
</module>
<module name="RedundantModifier">
<!-- Checks for redundant modifiers on various symbol definitions.
See: http://checkstyle.sourceforge.net/config_modifier.html#RedundantModifier
-->
<property name="tokens" value="METHOD_DEF, VARIABLE_DEF, ANNOTATION_FIELD_DEF, INTERFACE_DEF, CLASS_DEF, ENUM_DEF"/>
</module>
<module name="UnusedImports">
<property name="severity" value="error"/>
<property name="processJavadoc" value="true"/>
<message key="import.unused"
value="Unused import: {0}."/>
</module>
<!--
WHITESPACE CHECKS
-->
<module name="WhitespaceAround">
<!-- Checks that various tokens are surrounded by whitespace.
This includes most binary operators and keywords followed
by regular or curly braces.
-->
<property name="tokens" value="ASSIGN, BAND, BAND_ASSIGN, BOR,
BOR_ASSIGN, BSR, BSR_ASSIGN, BXOR, BXOR_ASSIGN, COLON, DIV, DIV_ASSIGN,
EQUAL, GE, GT, LAND, LE, LITERAL_CATCH, LITERAL_DO, LITERAL_ELSE,
LITERAL_FINALLY, LITERAL_FOR, LITERAL_IF, LITERAL_RETURN,
LITERAL_SYNCHRONIZED, LITERAL_TRY, LITERAL_WHILE, LOR, LT, MINUS,
MINUS_ASSIGN, MOD, MOD_ASSIGN, NOT_EQUAL, PLUS, PLUS_ASSIGN, QUESTION,
SL, SL_ASSIGN, SR_ASSIGN, STAR, STAR_ASSIGN"/>
<property name="severity" value="error"/>
</module>
<module name="WhitespaceAfter">
<!-- Checks that commas, semicolons and typecasts are followed by
whitespace.
-->
<property name="tokens" value="COMMA, SEMI, TYPECAST"/>
</module>
<module name="NoWhitespaceAfter">
<!-- Checks that there is no whitespace after various unary operators.
Linebreaks are allowed.
-->
<property name="tokens" value="BNOT, DEC, DOT, INC, LNOT, UNARY_MINUS,
UNARY_PLUS"/>
<property name="allowLineBreaks" value="true"/>
<property name="severity" value="error"/>
</module>
<module name="NoWhitespaceBefore">
<!-- Checks that there is no whitespace before various unary operators.
Linebreaks are allowed.
-->
<property name="tokens" value="SEMI, DOT, POST_DEC, POST_INC"/>
<property name="allowLineBreaks" value="true"/>
<property name="severity" value="error"/>
</module>
<module name="OperatorWrap">
<!-- Checks that operators like + and ? appear at newlines rather than
at the end of the previous line.
-->
<property name="option" value="NL"/>
<property name="tokens" value="BAND, BOR, BSR, BXOR, DIV, EQUAL,
GE, GT, LAND, LE, LITERAL_INSTANCEOF, LOR, LT, MINUS, MOD,
NOT_EQUAL, PLUS, QUESTION, SL, SR, STAR "/>
</module>
<module name="OperatorWrap">
<!-- Checks that assignment operators are at the end of the line. -->
<property name="option" value="eol"/>
<property name="tokens" value="ASSIGN"/>
</module>
<module name="ParenPad">
<!-- Checks that there is no whitespace before close parens or after
open parens.
-->
<property name="severity" value="error"/>
</module>
<module name="ModifierOrder"/>
</module>
</module>
+39
View File
@@ -0,0 +1,39 @@
<?xml version="1.0"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<!DOCTYPE suppressions PUBLIC
"-//Puppy Crawl//DTD Suppressions 1.1//EN"
"http://www.puppycrawl.com/dtds/suppressions_1_1.dtd">
<suppressions>
<suppress checks="JavadocPackage" files=".*[\\/]src[\\/]test[\\/].*"/>
<suppress checks="JavadocPackage" files=".*[\\/]maven-archetypes[\\/].*"/>
<suppress checks="JavadocPackage" files=".*[\\/]examples[\\/].*"/>
<!-- suppress javadoc check for impl classes and package-info.java -->
<suppress checks="JavadocType" files=".*Impl\.java$" />
<suppress checks="JavadocStyle" files=".+[\\/]package-info\.java$" />
<!-- suppress all checks in the generated directories -->
<suppress checks=".*" files=".+[\\/]generated[\\/].+\.java"/>
<suppress checks=".*" files=".+[\\/]generated-sources[\\/].+\.java"/>
<suppress checks=".*" files=".+[\\/]generated-test-sources[\\/].+\.java"/>
</suppressions>
+8
View File
@@ -0,0 +1,8 @@
{
"directories": [
"./home/blog",
"./home/docs",
"./home/i18n/zh-cn/docusaurus-plugin-content-blog",
"./home/i18n/zh-cn/docusaurus-plugin-content-docs/current"
]
}
+65
View File
@@ -0,0 +1,65 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
import os
import re
import sys
import json
def read_config(file_path):
try:
with open(file_path, 'r') as file:
config = json.load(file)
return config.get("directories", [])
except Exception as e:
print(f"Error reading configuration file: {e}")
sys.exit(1)
def find_invalid_files(directories):
invalid_files = []
pattern = re.compile(r'^[_a-z0-9-]+(\.[_a-z0-9-]+)*$')
for target_dir in directories:
print(f"Checking directory: {target_dir}")
for root, _, files in os.walk(target_dir):
for filename in files:
if not pattern.match(filename):
invalid_files.append(os.path.join(root, filename))
if invalid_files:
print("\nError: The following files have invalid names (file names should only contain lowercase letters, numbers, and hyphens):")
for invalid_file in invalid_files:
print(invalid_file)
sys.exit(1)
else:
print("All file names are valid.")
if __name__ == "__main__":
# usage: python check_filenames.py config.json
if len(sys.argv) != 2:
print("Usage: python xxx_script.py config.json")
sys.exit(1)
config_file = sys.argv[1]
directories = read_config(config_file)
if not directories:
print("\nNo directories found in configuration file.")
sys.exit(1)
find_invalid_files(directories)
+34
View File
@@ -0,0 +1,34 @@
./home/versioned_docs/version-v1.5.x/community/how-to-release.md
./home/versioned_docs/version-v1.5.x/help/sqlserver.md
./home/docs/community/how-to-release.md
./home/blog/2022-06-01-hertzbeat-v1.0.md
./home/blog/2023-12-11-hertzbeat-v1.4.3.md
./home/blog/2023-11-12-hertzbeat-v1.4.2.md
./home/blog/2024-01-18-hertzbeat-v1.4.4.md
./home/docs/help/sqlserver.md
./home/docs/others/resource.md
./home/i18n/zh-cn/docusaurus-plugin-content-docs/current/help/sqlserver.md
./home/i18n/zh-cn/docusaurus-plugin-content-blog/2023-11-12-hertzbeat-v1.4.2.md
./home/i18n/zh-cn/docusaurus-plugin-content-blog/2022-06-01-hertzbeat-v1.0.md
./home/i18n/zh-cn/docusaurus-plugin-content-blog/2023-12-11-hertzbeat-v1.4.3.md
./home/i18n/zh-cn/docusaurus-plugin-content-blog/2024-01-18-hertzbeat-v1.4.4.md
./home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/community/how-to-release.md
./home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/introduce.md
./home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/sqlserver.md
./home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/start/tdengine-init.md
./home/i18n/zh-cn/docusaurus-plugin-content-docs/current/start/tdengine-init.md
./home/versioned_docs/version-v1.5.x/introduce.md
./home/versioned_docs/version-v1.5.x/community/contact.md
./home/i18n/zh-cn/docusaurus-plugin-content-docs/current/introduce.md
./home/i18n/zh-cn/docusaurus-plugin-content-docs/current/community/contact.md
./home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/community/contact.md
./home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/introduce.md
./home/docs/introduce.md
./home/docs/community/contact.md
./home/i18n/zh-cn/docusaurus-plugin-content-blog/2024-06-15-hertzbeat-v1.6.0.md
./home/blog/2024-06-15-hertzbeat-v1.6.0.md
./home/docs/community/how-to-release.md
./home/i18n/zh-cn/docusaurus-plugin-content-docs/current/community/how-to-release.md
./home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.6.x/community/how-to-release.md
./home/docs/help/dolphinscheduler.md
./home/i18n/zh-cn/docusaurus-plugin-content-docs/current/help/dolphinscheduler.md
@@ -0,0 +1,65 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
name: setup-deps
description: Install host system dependencies (with mvnd)
runs:
using: composite
steps:
- name: Set up JDK 25
uses: actions/setup-java@v4
with:
distribution: "zulu"
java-version: 25
cache: maven
- name: Validate mvnd runner support
shell: bash
run: |
if [ "${RUNNER_OS}" != "Linux" ] || [ "${RUNNER_ARCH}" != "X64" ]; then
echo "setup-deps currently supports mvnd only on Linux/X64 runners; got ${RUNNER_OS}/${RUNNER_ARCH}" >&2
exit 1
fi
- name: Cache mvnd
id: mvnd-cache
uses: actions/cache@v4
with:
path: ~/.local/mvnd
key: mvnd-2.0.0-rc-3-linux-amd64
- name: Install mvnd
if: steps.mvnd-cache.outputs.cache-hit != 'true'
shell: bash
run: |
MVND_VERSION=2.0.0-rc-3
MVND_PLATFORM=linux-amd64
curl -sL https://dlcdn.apache.org/maven/mvnd/${MVND_VERSION}/maven-mvnd-${MVND_VERSION}-${MVND_PLATFORM}.zip -o mvnd.zip
unzip -q mvnd.zip
mkdir -p $HOME/.local
mv maven-mvnd-${MVND_VERSION}-${MVND_PLATFORM} $HOME/.local/mvnd
- name: Export mvnd environment
shell: bash
run: |
echo "$HOME/.local/mvnd/bin" >> $GITHUB_PATH
echo "MVND_HOME=$HOME/.local/mvnd" >> $GITHUB_ENV
- name: Verify mvnd installation
shell: bash
run: mvnd --version
+25
View File
@@ -0,0 +1,25 @@
{
"ignorePatterns": [
{
"pattern": "^(?!http).*"
},
{
"pattern": "!\\[.*\\]\\((?!http).*\\)"
},
{
"pattern": "^https:\\/\\/github\\.com\\/apache\\/hertzbeat\\/pull\\/.*"
}
],
"timeout": "10s",
"retryOn429": true,
"retryCount": 3,
"fallbackRetryDelay": "30s",
"aliveStatusCodes": [
0,
200,
400,
401,
403,
429
]
}
+201
View File
@@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
+16
View File
@@ -0,0 +1,16 @@
## Docker-Compose Deploy
Suggest the [HertzBeat + GreptimeDB + Postgresql Solution](hertzbeat-postgresql-greptimedb) for the best performance and stability.
Notes:
- MySQL, MariaDB, OceanBase, and TiDB SQL query metrics can use the built-in MySQL-compatible query engine without `mysql-connector-j`.
- If you place `mysql-connector-j` in `ext-lib`, HertzBeat prefers JDBC after restart.
- Oracle and DB2 still require external JDBC driver jars in `ext-lib`.
- Use Postgresql + GreptimeDB as HertzBeat dependent storage -> [HertzBeat+PostgreSQL+GreptimeDB Solution](hertzbeat-postgresql-greptimedb)
- Use Postgresql + VictoriaMetrics as HertzBeat dependent storage -> [HertzBeat+PostgreSQL+VictoriaMetrics Solution](hertzbeat-postgresql-victoria-metrics)
- Use Mysql + VictoriaMetrics as HertzBeat dependent storage -> [HertzBeat+Mysql+VictoriaMetrics Solution](hertzbeat-mysql-victoria-metrics)
- Use Mysql + IoTDB as HertzBeat dependent storage -> [HertzBeat+Mysql+IoTDB Solution](hertzbeat-mysql-iotdb)
- Use Mysql + Tdengine as HertzBeat dependent storage -> [HertzBeat+Mysql+Tdengine Solution](hertzbeat-mysql-tdengine)
@@ -0,0 +1,33 @@
## docker-compose deployment HertzBeat+Mysql+IoTDB solution
> The docker-compose deployment scheme uses Mysql + IoTDB as the dependent storage service of HertzBeat.
> This solution will start three container services Mysql, IoTDB, HertzBeat
##### Install Docker & Docker-compose
1. Download and install docker environment & docker-compose environment
Please refer to [Docker official website documentation](https://docs.docker.com/get-docker/), [Compose installation](https://docs.docker.com/compose/install/)
```
$ docker -v
Docker version 20.10.12, build e91ed57
```
##### docker compose deploys hertzbeat and its dependent services
1. Download the hertzbeat-docker-compose installation deployment script file
The script file is located in `script/docker-compose/hertzbeat-mysql-iotdb` link [script/docker-compose](https://github.com/apache/hertzbeat/tree/master/script/docker-compose/ hertzbeat-mysql-iotdb)
2. Optional: add external JDBC driver jars to `ext-lib`
MySQL-compatible monitoring can use the built-in query engine directly, so `mysql-connector-j` is optional.
If you want HertzBeat to prefer JDBC after restart, place `mysql-connector-j` in `ext-lib`.
Oracle and DB2 still require external JDBC jars in `ext-lib`.
3. Enter the deployment script docker-compose directory, execute
`docker compose up -d`
##### Start exploring HertzBeat
Browser access `localhost:1157` to start, the default account password `admin/hertzbeat`
@@ -0,0 +1,38 @@
## docker-compose部署 HertzBeat+Mysql+IoTDB 方案
- 如果想自己本地快速部署的话,可以参考下面进行操作。
> docker-compose 部署方案使用了 Mysql + IoTDB 作为 HertzBeat 依赖存储服务。
> 此方案会启动三个容器服务 Mysql, IoTDB, HertzBeat
##### 安装Docker & Docker-compose
1. 下载安装 docker 环境 & docker-compose 环境
请参考 [Docker官网文档](https://docs.docker.com/get-docker/), [Compose安装](https://docs.docker.com/compose/install/)
```
$ docker -v
Docker version 20.10.12, build e91ed57
```
##### docker compose部署hertzbeat及其依赖服务
1. 下载hertzbeat-docker-compose安装部署脚本文件
脚本文件位于代码仓库下`script/docker-compose/hertzbeat-mysql-iotdb` 链接 [script/docker-compose](https://github.com/apache/hertzbeat/tree/master/script/docker-compose/hertzbeat-mysql-iotdb)
2. 可选:向 `ext-lib` 添加外部 JDBC 驱动 jar
MySQL 兼容监控现在可以直接使用内置查询引擎,所以 `mysql-connector-j` 不是必需项。
如果你希望 HertzBeat 在重启后优先走 JDBC,可以把 `mysql-connector-j` 放到 `ext-lib`。
Oracle、DB2 这类场景仍然需要把外部 JDBC 驱动放到 `ext-lib`。
3. 进入部署脚本 docker-compose 目录, 执行
`docker compose up -d`
##### 开始探索HertzBeat
浏览器访问 `localhost:1157` 即可开始,默认账号密码 `admin/hertzbeat`
---
怎么样是不是很简单,只要几分钟就可以部署完成,赶紧试试吧!
@@ -0,0 +1,275 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
server:
port: 1157
spring:
application:
name: ${HOSTNAME:@hertzbeat@}${PID}
profiles:
active: prod
ai:
mcp:
server:
enabled: true
stdio: false
protocol: streamable
streamable-http:
mcp-endpoint: /api/mcp
name: hertzbeat-mcp-server
version: 1.0.0
type: SYNC
mvc:
static-path-pattern: /**
jackson:
default-property-inclusion: ALWAYS
web:
resources:
static-locations:
- classpath:/dist/
- classpath:../dist/
# need to disable spring boot mongodb auto config, or default mongodb connection tried and failed..
autoconfigure:
exclude: org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration, org.springframework.boot.autoconfigure.data.mongo.MongoDataAutoConfiguration
freemarker:
enabled: false
servlet:
multipart:
max-file-size: 100MB
max-request-size: 100MB
management:
health:
mail:
enabled: off
endpoints:
web:
exposure:
include:
- 'metrics'
- 'health'
- 'prometheus'
enabled-by-default: on
endpoint:
prometheus:
access: read_only
metrics:
tags:
application: ${spring.application.name}
environment: ${spring.profiles.active}
prometheus:
metrics:
export:
enabled: true
sureness:
container: jakarta_servlet
auths:
- digest
- basic
- jwt
jwt:
secret: 'CyaFv0bwq2Eik0jdrKUtsA6bx3sDJeFV643R
LnfKefTjsIfJLBa2YkhEqEGtcHDTNe4CU6+9
8tVt4bisXQ13rbN0oxhUZR73M6EByXIO+SV5
dKhaX0csgOCTlCxq20yhmUea6H6JIpSE2Rwp'
---
spring:
config:
activate:
on-profile: prod
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
username: root
password: 123456
url: jdbc:mysql://mysql:3306/hertzbeat?useUnicode=true&characterEncoding=utf-8&allowPublicKeyRetrieval=true&useSSL=false
platform: mysql
hikari:
max-lifetime: 120000
jpa:
show-sql: false
database: mysql
hibernate:
ddl-auto: update
properties:
hibernate:
format_sql: true
dialect: org.hibernate.dialect.MySQLDialect
flyway:
enabled: true
clean-disabled: true
baseline-on-migrate: true
baseline-version: 1
locations:
- classpath:db/migration/mysql
# Not Require, Please config if you need email notify
mail:
# Attention: this is mail server address.
host: smtp.qq.com
username: example@qq.com
# Attention: this is not email account password, this requires an email authorization code
password: xxqzvuqbnqvbbdac
port: 465
default-encoding: UTF-8
properties:
mail:
smtp:
socketFactoryClass: javax.net.ssl.SSLSocketFactory
ssl:
enable: true
common:
queue:
# memory or kafka
type: memory
warehouse:
store:
# store history metrics data, enable only one below
jpa:
enabled: false
expire-time: 1h
iot-db:
enabled: true
host: iotdb
rpc-port: 6667
username: root
password: root
query-timeout-in-ms: -1
# data expire time, unit:ms, default '7776000000'(90 days, -1:never expire)
expire-time: '7776000000'
# store real-time metrics data, enable only one below
real-time:
memory:
enabled: true
init-size: 16
redis:
enabled: false
# redis mode: single, sentinel, cluster. Default is single
mode: single
# separate each address with comma when using cluster mode, eg: 127.0.0.1:6379,127.0.0.1:6380
address: 127.0.0.1:6379
# enter master name when using sentinel mode
masterName: mymaster
password: 123456
# redis db index, default: DB0
db: 0
alerter:
# custom console url
console-url: https://console.tancloud.io
# we work
we-work-webhook-url: https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=
# ding ding talk
ding-talk-webhook-url: https://oapi.dingtalk.com/robot/send?access_token=
# fei shu fly book
fly-book-webhook-url: https://open.feishu.cn/open-apis/bot/v2/hook/
# telegram
telegram-webhook-url: https://api.telegram.org/bot%s/sendMessage
# discord
discord-webhook-url: https://discord.com/api/v9/channels/%s/messages
# serverChan
server-chan-webhook-url: https://sctapi.ftqq.com/%s.send
# gotify
gotify-webhook-url: http://127.0.0.1/message?token=%s
# alert inhibit ttl unit ms, default 14400000(4 hours)
inhibit:
ttl: 14400000
sms:
enable: false
type: tencent
tencent:
secret-id:
secret-key:
app-id:
sign-name:
template-id:
alibaba:
access-key-id:
access-key-secret:
sign-name:
template-code:
unisms:
# auth-mode: simple or hmac
auth-mode: simple
access-key-id: YOUR_ACCESS_KEY_ID
# hmac mode need to fill in access-key-secret
access-key-secret: YOUR_ACCESS_KEY_SECRET
signature: YOUR_SMS_SIGNATURE
template-id: YOUR_TEMPLATE_ID
smslocal:
api-key: YOUR_API_KEY_HERE
aws:
access-key-id: YOUR_ACCESS_KEY_ID
access-key-secret: YOUR_ACCESS_KEY_SECRET
region: AWS_REGION_FOR_END_USER_MESSAGING
twilio:
account-sid: YOUR_ACCOUNT_SID
auth-token: YOUR_AUTH_TOKEN
twilio-phone-number: YOUR_TWILIO_PHONE_NUMBER
scheduler:
server:
enabled: true
port: 1158
grafana:
enabled: false
url: http://127.0.0.1:3000
username: admin
password: admin
hertzbeat:
collector:
mysql:
# MySQL-compatible query engine routing for MySQL, MariaDB, OceanBase, and TiDB SQL metrics.
# auto : prefer JDBC only when mysql-connector-j is available from ext-lib, otherwise use the built-in query engine
# jdbc : always use JDBC
# r2dbc : always use the built-in query engine
query-engine: ${HERTZBEAT_COLLECTOR_MYSQL_QUERY_ENGINE:auto}
# Optional virtual-thread overrides. Remove this whole block to use built-in defaults.
vthreads:
enabled: true
common:
mode: UNBOUNDED_VT
collector:
mode: LIMIT_AND_REJECT
manager:
mode: LIMIT_AND_REJECT
max-concurrent-jobs: 10
alerter:
notify:
mode: LIMIT_AND_REJECT
max-concurrent-jobs: 64
periodic-max-concurrent-jobs: 10
log-worker:
max-concurrent-jobs: 10
queue-capacity: 1000
reduce:
max-concurrent-jobs: 2
window-evaluator:
max-concurrent-jobs: 2
notify-max-concurrent-per-channel: 4
warehouse:
mode: UNBOUNDED_VT
async:
enabled: true
concurrency-limit: 256
reject-when-limit-reached: true
task-termination-timeout: 5000
@@ -0,0 +1,21 @@
-- Licensed to the Apache Software Foundation (ASF) under one
-- or more contributor license agreements. See the NOTICE file
-- distributed with this work for additional information
-- regarding copyright ownership. The ASF licenses this file
-- to you under the Apache License, Version 2.0 (the
-- "License"); you may not use this file except in compliance
-- with the License. You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-- this file works for MySQL.
set names utf8mb4;
create database if not exists hertzbeat default charset utf8mb4 collate utf8mb4_general_ci;
commit;
@@ -0,0 +1,124 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
## -- sureness.yml account source -- ##
# config the resource restful api that need auth protection, base rbac
# rule: api===method===role
# eg: /api/v1/source1===get===[admin] means /api/v2/host===post support role[admin] access.
# eg: /api/v1/source2===get===[] means /api/v1/source2===get can not access by any role.
resourceRole:
- /api/account/auth/refresh===post===[admin,user,guest]
- /api/apps/**===get===[admin,user,guest]
- /api/monitor/**===get===[admin,user,guest]
- /api/monitor/**===post===[admin,user]
- /api/monitor/**===put===[admin,user]
- /api/monitor/**===delete==[admin]
- /api/monitors/**===get===[admin,user,guest]
- /api/monitors/**===post===[admin,user]
- /api/monitors/**===put===[admin,user]
- /api/monitors/**===delete===[admin]
- /api/alert/**===get===[admin,user,guest]
- /api/alert/**===post===[admin,user]
- /api/alert/**===put===[admin,user]
- /api/alert/**===delete===[admin]
- /api/alerts/**===get===[admin,user,guest]
- /api/alerts/**===post===[admin,user]
- /api/alerts/**===put===[admin,user]
- /api/alerts/**===delete===[admin]
- /api/notice/**===get===[admin,user,guest]
- /api/notice/**===post===[admin,user]
- /api/notice/**===put===[admin,user]
- /api/notice/**===delete===[admin]
- /api/tag/**===get===[admin,user,guest]
- /api/tag/**===post===[admin,user]
- /api/tag/**===put===[admin,user]
- /api/tag/**===delete===[admin]
- /api/summary/**===get===[admin,user,guest]
- /api/summary/**===post===[admin,user]
- /api/summary/**===put===[admin,user]
- /api/summary/**===delete===[admin]
- /api/collector/**===get===[admin,user,guest]
- /api/collector/**===post===[admin,user]
- /api/collector/**===put===[admin,user]
- /api/collector/**===delete===[admin]
- /api/status/page/**===get===[admin,user,guest]
- /api/status/page/**===post===[admin,user]
- /api/status/page/**===put===[admin,user]
- /api/status/page/**===delete===[admin]
- /api/grafana/**===get===[admin,user,guest]
- /api/grafana/**===post===[admin,user]
- /api/grafana/**===put===[admin,user]
- /api/grafana/**===delete===[admin]
- /api/bulletin/**===get===[admin,user,guest]
- /api/bulletin/**===post===[admin,user]
- /api/bulletin/**===put===[admin,user]
- /api/bulletin/**===delete===[admin]
- /api/mcp/**===get===[admin]
- /api/mcp/**===post===[admin]
- /api/chat/**===get===[admin,user]
- /api/chat/**===post===[admin]
- /api/logs/ingest/**===post===[admin,user]
# config the resource restful api that need bypass auth protection
# rule: api===method
# eg: /api/v1/source3===get means /api/v1/source3===get can be access by anyone, no need auth.
excludedResource:
- /api/alert/sse/**===*
- /api/logs/sse/**===*
- /api/account/auth/**===*
- /api/i18n/**===get
- /api/apps/hierarchy===get
- /api/push/**===*
- /api/status/page/public/**===*
- /api/manager/sse/**===*
# web ui resource
- /===get
- /assets/**===get
- /dashboard/**===get
- /monitors/**===get
- /alert/**===get
- /account/**===get
- /setting/**===get
- /passport/**===get
- /status/**===get
- /log/**===get
- /**/*.html===get
- /**/*.js===get
- /**/*.css===get
- /**/*.ico===get
- /**/*.ttf===get
- /**/*.png===get
- /**/*.gif===get
- /**/*.jpg===get
- /**/*.svg===get
- /**/*.json===get
- /**/*.woff===get
- /**/*.eot===get
# swagger ui resource
- /swagger-resources/**===get
- /v2/api-docs===get
- /v3/api-docs===get
# h2 database
- /h2-console/**===*
# account info config refer the https://hertzbeat.apache.org/docs/start/account-modify
# 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]
@@ -0,0 +1,88 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
version: "3.7"
networks:
hertzbeat:
driver: bridge
services:
mysql:
image: mariadb:11.7
container_name: compose-mysql
hostname: mysql
restart: always
healthcheck:
test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
interval: 10s
retries: 5
start_period: 30s
ports:
- '13306:3306'
environment:
TZ: Asia/Shanghai
MARIADB_ROOT_PASSWORD: 123456
volumes:
- ./dbdata/mysqldata:/var/lib/mysql/
- ./conf/sql:/docker-entrypoint-initdb.d/
networks:
- hertzbeat
iotdb:
image: apache/iotdb:1.2.2-standalone
container_name: compose-iotdb
hostname: iotdb
restart: always
healthcheck:
test: ["CMD", "ls", "/iotdb/data"]
interval: 10s
retries: 5
timeout: 5s
start_period: 30s
environment:
TZ: Asia/Shanghai
ports:
- "18181:8181"
- "16667:6667"
volumes:
- ./dbdata/iotdbdata:/iotdb/data
networks:
- hertzbeat
hertzbeat:
image: apache/hertzbeat:1.8.0
container_name: compose-hertzbeat
hostname: hertzbeat
restart: always
environment:
HERTZBEAT_COLLECTOR_MYSQL_QUERY_ENGINE: auto
TZ: Asia/Shanghai
LANG: zh_CN.UTF-8
depends_on:
mysql:
condition: service_healthy
iotdb:
condition: service_healthy
volumes:
- ./conf/application.yml:/opt/hertzbeat/config/application.yml
- ./conf/sureness.yml:/opt/hertzbeat/config/sureness.yml
- ./ext-lib:/opt/hertzbeat/ext-lib
- ./logs:/opt/hertzbeat/logs
ports:
- "1157:1157"
- "1158:1158"
networks:
- hertzbeat
@@ -0,0 +1,2 @@
!.gitignore
*.jar
@@ -0,0 +1,26 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
Please move external libs to this folder only when you need external JDBC jars, for example:
ojdbc8-21.5.0.0.jar
orai18n-21.5.0.0.jar
mysql-connector-java-8.0.30.jar
Notes:
- MySQL, MariaDB, OceanBase, and TiDB SQL query metrics can use the built-in MySQL-compatible query engine without `mysql-connector-j`.
- If `mysql-connector-j` is present here, HertzBeat prefers JDBC after restart.
- Oracle and DB2 still require external JDBC jars in `ext-lib`.
@@ -0,0 +1,60 @@
## Docker-Compose deployment HertzBeat+Mysql+Tdengine Solution
> The docker-compose deployment scheme uses Mysql + Tdengine as the dependent storage service of HertzBeat.
> This solution will start three container services Mysql, Tdengine, HertzBeat
##### Install Docker & Docker-compose
1. Download and install docker environment & docker-compose environment
Please refer to [Docker official website documentation](https://docs.docker.com/get-docker/), [Compose installation](https://docs.docker.com/compose/install/)
```
$ docker -v
Docker version 20.10.12, build e91ed57
```
##### docker compose deploys hertzbeat and its dependent services
1. Download the hertzbeat-docker-compose installation deployment script file
The script file is located in `script/docker-compose/hertzbeat-mysql-tdengine` link [script/docker-compose](https://github.com/apache/hertzbeat/tree/master/script/docker-compose/hertzbeat-mysql-tdengine)
2. Optional: add external JDBC driver jars to `ext-lib`
MySQL-compatible monitoring can use the built-in query engine directly, so `mysql-connector-j` is optional.
If you want HertzBeat to prefer JDBC after restart, place `mysql-connector-j` in `ext-lib`.
Oracle and DB2 still require external JDBC jars in `ext-lib`.
3. Enter the deployment script docker-compose directory, execute
`docker compose up -d`
4. Enter tdengine to create hertzbeat database
```shell
$ docker exec -it tdengine /bin/bash
root@tdengine-server:~/TDengine-server-2.4.0.4#
```
Create a database named hertzbeat After entering the container, execute the taos shell client program.
```bash
root@tdengine-server:~/TDengine-server-2.4.0.4# taos
Welcome to the TDengine shell from Linux, Client Version: 2.4.0.4
Copyright (c) 2020 by TAOS Data, Inc. All rights reserved.
taos>
```
Execute the create database command
`taos> show databases;`
`taos> CREATE DATABASE hertzbeat KEEP 90 DURATION 10 BUFFER 16;`
##### Restart the application
`docker-compose restart hertzbeat`
##### Start exploring HertzBeat
Browser access `localhost:1157` to start, the default account password `admin/hertzbeat`
@@ -0,0 +1,63 @@
## docker-compose部署 HertzBeat+Mysql+Tdengine 方案
- 如果想自己本地快速部署的话,可以参考下面进行操作。
> docker-compose 部署方案使用了 Mysql + Tdengine 作为 HertzBeat 依赖存储服务。
> 此方案会启动三个容器服务 Mysql, Tdengine, HertzBeat
##### 安装Docker & Docker-compose
1. 下载安装 docker 环境 & docker-compose 环境
请参考 [Docker官网文档](https://docs.docker.com/get-docker/), [Compose安装](https://docs.docker.com/compose/install/)
```
$ docker -v
Docker version 20.10.12, build e91ed57
```
##### docker compose部署hertzbeat及其依赖服务
1. 下载hertzbeat-docker-compose安装部署脚本文件
脚本文件位于代码仓库下`script/docker-compose/hertzbeat-mysql-tdengine` 链接 [script/docker-compose](https://github.com/apache/hertzbeat/tree/master/script/docker-compose/hertzbeat-mysql-tdengine)
2. 可选:向 `ext-lib` 添加外部 JDBC 驱动 jar
MySQL 兼容监控现在可以直接使用内置查询引擎,所以 `mysql-connector-j` 不是必需项。
如果你希望 HertzBeat 在重启后优先走 JDBC,可以把 `mysql-connector-j` 放到 `ext-lib`。
Oracle、DB2 这类场景仍然需要把外部 JDBC 驱动放到 `ext-lib`。
3. 进入部署脚本 docker-compose 目录, 执行
`docker compose up -d`
4. 进入tdengine创建hertzbeat数据库
```bash
$ docker exec -it tdengine /bin/bash
root@tdengine-server:~/TDengine-server-2.4.0.4#
```
创建名称为hertzbeat的数据库 进入容器后,执行 taos shell 客户端程序。
```bash
root@tdengine-server:~/TDengine-server-2.4.0.4# taos
Welcome to the TDengine shell from Linux, Client Version: 2.4.0.4
Copyright (c) 2020 by TAOS Data, Inc. All rights reserved.
taos>
```
执行创建数据库命令
`taos> show databases;`
`taos> CREATE DATABASE hertzbeat KEEP 90 DURATION 10 BUFFER 16;`
##### 重启应用
`docker-compose restart hertzbeat`
##### 开始探索HertzBeat
浏览器访问 `localhost:1157` 即可开始,默认账号密码 `admin/hertzbeat`
---
怎么样是不是很简单,只要几分钟就可以部署完成,赶紧试试吧!
@@ -0,0 +1,272 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
server:
port: 1157
spring:
application:
name: ${HOSTNAME:@hertzbeat@}${PID}
profiles:
active: prod
ai:
mcp:
server:
enabled: true
stdio: false
protocol: streamable
streamable-http:
mcp-endpoint: /api/mcp
name: hertzbeat-mcp-server
version: 1.0.0
type: SYNC
mvc:
static-path-pattern: /**
jackson:
default-property-inclusion: ALWAYS
web:
resources:
static-locations:
- classpath:/dist/
- classpath:../dist/
# need to disable spring boot mongodb auto config, or default mongodb connection tried and failed..
autoconfigure:
exclude: org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration, org.springframework.boot.autoconfigure.data.mongo.MongoDataAutoConfiguration
freemarker:
enabled: false
servlet:
multipart:
max-file-size: 100MB
max-request-size: 100MB
management:
health:
mail:
enabled: off
endpoints:
web:
exposure:
include:
- 'metrics'
- 'health'
- 'prometheus'
enabled-by-default: on
endpoint:
prometheus:
access: read_only
metrics:
tags:
application: ${spring.application.name}
environment: ${spring.profiles.active}
prometheus:
metrics:
export:
enabled: true
sureness:
container: jakarta_servlet
auths:
- digest
- basic
- jwt
jwt:
secret: 'CyaFv0bwq2Eik0jdrKUtsA6bx3sDJeFV643R
LnfKefTjsIfJLBa2YkhEqEGtcHDTNe4CU6+9
8tVt4bisXQ13rbN0oxhUZR73M6EByXIO+SV5
dKhaX0csgOCTlCxq20yhmUea6H6JIpSE2Rwp'
---
spring:
config:
activate:
on-profile: prod
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
username: root
password: 123456
url: jdbc:mysql://mysql:3306/hertzbeat?useUnicode=true&characterEncoding=utf-8&allowPublicKeyRetrieval=true&useSSL=false
platform: mysql
hikari:
max-lifetime: 120000
jpa:
show-sql: false
database: mysql
hibernate:
ddl-auto: update
properties:
hibernate:
format_sql: true
dialect: org.hibernate.dialect.MySQLDialect
flyway:
enabled: true
clean-disabled: true
baseline-on-migrate: true
baseline-version: 1
locations:
- classpath:db/migration/mysql
# Not Require, Please config if you need email notify
mail:
# Attention: this is mail server address.
host: smtp.qq.com
username: example@qq.com
# Attention: this is not email account password, this requires an email authorization code
password: xxqzvuqbnqvbbdac
port: 465
default-encoding: UTF-8
properties:
mail:
smtp:
socketFactoryClass: javax.net.ssl.SSLSocketFactory
ssl:
enable: true
common:
queue:
# memory or kafka
type: memory
warehouse:
store:
# store history metrics data, enable only one below
jpa:
enabled: false
expire-time: 1h
td-engine:
enabled: true
driver-class-name: com.taosdata.jdbc.rs.RestfulDriver
url: jdbc:TAOS-RS://tdengine:6041/hertzbeat
username: root
password: taosdata
# store real-time metrics data, enable only one below
real-time:
memory:
enabled: true
init-size: 16
redis:
enabled: false
# redis mode: single, sentinel, cluster. Default is single
mode: single
# separate each address with comma when using cluster mode, eg: 127.0.0.1:6379,127.0.0.1:6380
address: 127.0.0.1:6379
# enter master name when using sentinel mode
masterName: mymaster
password: 123456
# redis db index, default: DB0
db: 0
alerter:
# custom console url
console-url: https://console.tancloud.io
# we work
we-work-webhook-url: https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=
# ding ding talk
ding-talk-webhook-url: https://oapi.dingtalk.com/robot/send?access_token=
# fei shu fly book
fly-book-webhook-url: https://open.feishu.cn/open-apis/bot/v2/hook/
# telegram
telegram-webhook-url: https://api.telegram.org/bot%s/sendMessage
# discord
discord-webhook-url: https://discord.com/api/v9/channels/%s/messages
# serverChan
server-chan-webhook-url: https://sctapi.ftqq.com/%s.send
# gotify
gotify-webhook-url: http://127.0.0.1/message?token=%s
# alert inhibit ttl unit ms, default 14400000(4 hours)
inhibit:
ttl: 14400000
sms:
enable: false
type: tencent
tencent:
secret-id:
secret-key:
app-id:
sign-name:
template-id:
alibaba:
access-key-id:
access-key-secret:
sign-name:
template-code:
unisms:
# auth-mode: simple or hmac
auth-mode: simple
access-key-id: YOUR_ACCESS_KEY_ID
# hmac mode need to fill in access-key-secret
access-key-secret: YOUR_ACCESS_KEY_SECRET
signature: YOUR_SMS_SIGNATURE
template-id: YOUR_TEMPLATE_ID
smslocal:
api-key: YOUR_API_KEY_HERE
aws:
access-key-id: YOUR_ACCESS_KEY_ID
access-key-secret: YOUR_ACCESS_KEY_SECRET
region: AWS_REGION_FOR_END_USER_MESSAGING
twilio:
account-sid: YOUR_ACCOUNT_SID
auth-token: YOUR_AUTH_TOKEN
twilio-phone-number: YOUR_TWILIO_PHONE_NUMBER
scheduler:
server:
enabled: true
port: 1158
grafana:
enabled: false
url: http://127.0.0.1:3000
username: admin
password: admin
hertzbeat:
collector:
mysql:
# MySQL-compatible query engine routing for MySQL, MariaDB, OceanBase, and TiDB SQL metrics.
# auto : prefer JDBC only when mysql-connector-j is available from ext-lib, otherwise use the built-in query engine
# jdbc : always use JDBC
# r2dbc : always use the built-in query engine
query-engine: ${HERTZBEAT_COLLECTOR_MYSQL_QUERY_ENGINE:auto}
# Optional virtual-thread overrides. Remove this whole block to use built-in defaults.
vthreads:
enabled: true
common:
mode: UNBOUNDED_VT
collector:
mode: LIMIT_AND_REJECT
manager:
mode: LIMIT_AND_REJECT
max-concurrent-jobs: 10
alerter:
notify:
mode: LIMIT_AND_REJECT
max-concurrent-jobs: 64
periodic-max-concurrent-jobs: 10
log-worker:
max-concurrent-jobs: 10
queue-capacity: 1000
reduce:
max-concurrent-jobs: 2
window-evaluator:
max-concurrent-jobs: 2
notify-max-concurrent-per-channel: 4
warehouse:
mode: UNBOUNDED_VT
async:
enabled: true
concurrency-limit: 256
reject-when-limit-reached: true
task-termination-timeout: 5000
@@ -0,0 +1,21 @@
-- Licensed to the Apache Software Foundation (ASF) under one
-- or more contributor license agreements. See the NOTICE file
-- distributed with this work for additional information
-- regarding copyright ownership. The ASF licenses this file
-- to you under the Apache License, Version 2.0 (the
-- "License"); you may not use this file except in compliance
-- with the License. You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-- this file works for MySQL.
set names utf8mb4;
create database if not exists hertzbeat default charset utf8mb4 collate utf8mb4_general_ci;
commit;
@@ -0,0 +1,124 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
## -- sureness.yml account source -- ##
# config the resource restful api that need auth protection, base rbac
# rule: api===method===role
# eg: /api/v1/source1===get===[admin] means /api/v2/host===post support role[admin] access.
# eg: /api/v1/source2===get===[] means /api/v1/source2===get can not access by any role.
resourceRole:
- /api/account/auth/refresh===post===[admin,user,guest]
- /api/apps/**===get===[admin,user,guest]
- /api/monitor/**===get===[admin,user,guest]
- /api/monitor/**===post===[admin,user]
- /api/monitor/**===put===[admin,user]
- /api/monitor/**===delete==[admin]
- /api/monitors/**===get===[admin,user,guest]
- /api/monitors/**===post===[admin,user]
- /api/monitors/**===put===[admin,user]
- /api/monitors/**===delete===[admin]
- /api/alert/**===get===[admin,user,guest]
- /api/alert/**===post===[admin,user]
- /api/alert/**===put===[admin,user]
- /api/alert/**===delete===[admin]
- /api/alerts/**===get===[admin,user,guest]
- /api/alerts/**===post===[admin,user]
- /api/alerts/**===put===[admin,user]
- /api/alerts/**===delete===[admin]
- /api/notice/**===get===[admin,user,guest]
- /api/notice/**===post===[admin,user]
- /api/notice/**===put===[admin,user]
- /api/notice/**===delete===[admin]
- /api/tag/**===get===[admin,user,guest]
- /api/tag/**===post===[admin,user]
- /api/tag/**===put===[admin,user]
- /api/tag/**===delete===[admin]
- /api/summary/**===get===[admin,user,guest]
- /api/summary/**===post===[admin,user]
- /api/summary/**===put===[admin,user]
- /api/summary/**===delete===[admin]
- /api/collector/**===get===[admin,user,guest]
- /api/collector/**===post===[admin,user]
- /api/collector/**===put===[admin,user]
- /api/collector/**===delete===[admin]
- /api/status/page/**===get===[admin,user,guest]
- /api/status/page/**===post===[admin,user]
- /api/status/page/**===put===[admin,user]
- /api/status/page/**===delete===[admin]
- /api/grafana/**===get===[admin,user,guest]
- /api/grafana/**===post===[admin,user]
- /api/grafana/**===put===[admin,user]
- /api/grafana/**===delete===[admin]
- /api/bulletin/**===get===[admin,user,guest]
- /api/bulletin/**===post===[admin,user]
- /api/bulletin/**===put===[admin,user]
- /api/bulletin/**===delete===[admin]
- /api/mcp/**===get===[admin]
- /api/mcp/**===post===[admin]
- /api/chat/**===get===[admin,user]
- /api/chat/**===post===[admin]
- /api/logs/ingest/**===post===[admin,user]
# config the resource restful api that need bypass auth protection
# rule: api===method
# eg: /api/v1/source3===get means /api/v1/source3===get can be access by anyone, no need auth.
excludedResource:
- /api/alert/sse/**===*
- /api/logs/sse/**===*
- /api/account/auth/**===*
- /api/i18n/**===get
- /api/apps/hierarchy===get
- /api/push/**===*
- /api/status/page/public/**===*
- /api/manager/sse/**===*
# web ui resource
- /===get
- /assets/**===get
- /dashboard/**===get
- /monitors/**===get
- /alert/**===get
- /account/**===get
- /setting/**===get
- /passport/**===get
- /status/**===get
- /log/**===get
- /**/*.html===get
- /**/*.js===get
- /**/*.css===get
- /**/*.ico===get
- /**/*.ttf===get
- /**/*.png===get
- /**/*.gif===get
- /**/*.jpg===get
- /**/*.svg===get
- /**/*.json===get
- /**/*.woff===get
- /**/*.eot===get
# swagger ui resource
- /swagger-resources/**===get
- /v2/api-docs===get
- /v3/api-docs===get
# h2 database
- /h2-console/**===*
# account info config refer the https://hertzbeat.apache.org/docs/start/account-modify
# 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]
@@ -0,0 +1,87 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
version: "3.7"
networks:
hertzbeat:
driver: bridge
services:
mysql:
image: mariadb:11.7
container_name: compose-mysql
hostname: mysql
restart: always
healthcheck:
test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
interval: 10s
retries: 5
start_period: 30s
ports:
- '13306:3306'
environment:
TZ: Asia/Shanghai
MARIADB_ROOT_PASSWORD: 123456
volumes:
- ./dbdata/mysqldata:/var/lib/mysql/
- ./conf/sql:/docker-entrypoint-initdb.d/
networks:
- hertzbeat
tdengine:
image: tdengine/tdengine:3.2.2.0
container_name: compose-tdengine
hostname: tdengine
restart: always
healthcheck:
test: ['CMD-SHELL', 'curl -u root:taosdata -d "show databases" tdengine:6041/rest/sql']
interval: 10s
retries: 5
timeout: 5s
start_period: 1m
environment:
TZ: Asia/Shanghai
ports:
- "16041:6041"
volumes:
- ./dbdata/taosdata:/var/lib/taos/
networks:
- hertzbeat
hertzbeat:
image: apache/hertzbeat:1.8.0
container_name: compose-hertzbeat
hostname: hertzbeat
restart: always
environment:
HERTZBEAT_COLLECTOR_MYSQL_QUERY_ENGINE: auto
TZ: Asia/Shanghai
LANG: zh_CN.UTF-8
depends_on:
mysql:
condition: service_healthy
tdengine:
condition: service_healthy
volumes:
- ./conf/application.yml:/opt/hertzbeat/config/application.yml
- ./conf/sureness.yml:/opt/hertzbeat/config/sureness.yml
- ./ext-lib:/opt/hertzbeat/ext-lib
- ./logs:/opt/hertzbeat/logs
ports:
- "1157:1157"
- "1158:1158"
networks:
- hertzbeat
@@ -0,0 +1,2 @@
!.gitignore
*.jar
@@ -0,0 +1,26 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
Please move external libs to this folder only when you need external JDBC jars, for example:
ojdbc8-21.5.0.0.jar
orai18n-21.5.0.0.jar
mysql-connector-java-8.0.30.jar
Notes:
- MySQL, MariaDB, OceanBase, and TiDB SQL query metrics can use the built-in MySQL-compatible query engine without `mysql-connector-j`.
- If `mysql-connector-j` is present here, HertzBeat prefers JDBC after restart.
- Oracle and DB2 still require external JDBC jars in `ext-lib`.
@@ -0,0 +1,33 @@
## Docker-Compose deployment HertzBeat+Mysql+VictoriaMetrics Solution
> The docker-compose deployment scheme uses Mysql + VictoriaMetrics as the dependent storage service of HertzBeat.
> This solution will start three container services Mysql, VictoriaMetrics, HertzBeat
##### Install Docker & Docker-compose
1. Download and install docker environment & docker-compose environment
Please refer to [Docker official website documentation](https://docs.docker.com/get-docker/), [Compose installation](https://docs.docker.com/compose/install/)
```
$ docker -v
Docker version 20.10.12, build e91ed57
```
##### docker compose deploys hertzbeat and its dependent services
1. Download the hertzbeat-docker-compose installation deployment script file
The script file is located in `script/docker-compose/hertzbeat-mysql-victoria-metrics` link [script/docker-compose](https://github.com/apache/hertzbeat/tree/master/script/docker-compose/hertzbeat-mysql-victoria-metrics)
2. Optional: add external JDBC driver jars to `ext-lib`
MySQL-compatible monitoring can use the built-in query engine directly, so `mysql-connector-j` is optional.
If you want HertzBeat to prefer JDBC after restart, place `mysql-connector-j` in `ext-lib`.
Oracle and DB2 still require external JDBC jars in `ext-lib`.
3. Enter the deployment script docker-compose directory, execute
`docker compose up -d`
##### Start exploring HertzBeat
Browser access `localhost:1157` to start, the default account password `admin/hertzbeat`
@@ -0,0 +1,37 @@
## docker-compose部署 HertzBeat+Mysql+VictoriaMetrics 方案
- 如果想自己本地快速部署的话,可以参考下面进行操作。
> docker-compose 部署方案使用了 Mysql + VictoriaMetrics 作为 HertzBeat 依赖存储服务。
> 此方案会启动三个容器服务 Mysql, VictoriaMetrics, HertzBeat
##### 安装Docker & Docker-compose
1. 下载安装 docker 环境 & docker-compose 环境
请参考 [Docker官网文档](https://docs.docker.com/get-docker/), [Compose安装](https://docs.docker.com/compose/install/)
```
$ docker -v
Docker version 20.10.12, build e91ed57
```
##### docker compose部署hertzbeat及其依赖服务
1. 下载hertzbeat-docker-compose安装部署脚本文件
脚本文件位于代码仓库下`script/docker-compose/hertzbeat-mysql-victoria-metrics` 链接 [script/docker-compose](https://github.com/apache/hertzbeat/tree/master/script/docker-compose/hertzbeat-mysql-victoria-metrics)
2. 可选:向 `ext-lib` 添加外部 JDBC 驱动 jar
MySQL 兼容监控现在可以直接使用内置查询引擎,所以 `mysql-connector-j` 不是必需项。
如果你希望 HertzBeat 在重启后优先走 JDBC,可以把 `mysql-connector-j` 放到 `ext-lib`。
Oracle、DB2 这类场景仍然需要把外部 JDBC 驱动放到 `ext-lib`。
3. 进入部署脚本 docker-compose 目录, 执行
`docker compose up -d`
##### 开始探索HertzBeat
浏览器访问 `localhost:1157` 即可开始,默认账号密码 `admin/hertzbeat`
---
怎么样是不是很简单,只要几分钟就可以部署完成,赶紧试试吧!
@@ -0,0 +1,275 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
server:
port: 1157
spring:
application:
name: ${HOSTNAME:@hertzbeat@}${PID}
profiles:
active: prod
ai:
mcp:
server:
enabled: true
stdio: false
protocol: streamable
streamable-http:
mcp-endpoint: /api/mcp
name: hertzbeat-mcp-server
version: 1.0.0
type: SYNC
mvc:
static-path-pattern: /**
jackson:
default-property-inclusion: ALWAYS
web:
resources:
static-locations:
- classpath:/dist/
- classpath:../dist/
# need to disable spring boot mongodb auto config, or default mongodb connection tried and failed..
autoconfigure:
exclude: org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration, org.springframework.boot.autoconfigure.data.mongo.MongoDataAutoConfiguration
freemarker:
enabled: false
servlet:
multipart:
max-file-size: 100MB
max-request-size: 100MB
management:
health:
mail:
enabled: off
endpoints:
web:
exposure:
include:
- 'metrics'
- 'health'
- 'prometheus'
enabled-by-default: on
endpoint:
prometheus:
access: read_only
metrics:
tags:
application: ${spring.application.name}
environment: ${spring.profiles.active}
prometheus:
metrics:
export:
enabled: true
sureness:
container: jakarta_servlet
auths:
- digest
- basic
- jwt
jwt:
secret: 'CyaFv0bwq2Eik0jdrKUtsA6bx3sDJeFV643R
LnfKefTjsIfJLBa2YkhEqEGtcHDTNe4CU6+9
8tVt4bisXQ13rbN0oxhUZR73M6EByXIO+SV5
dKhaX0csgOCTlCxq20yhmUea6H6JIpSE2Rwp'
---
spring:
config:
activate:
on-profile: prod
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
username: root
password: 123456
url: jdbc:mysql://mysql:3306/hertzbeat?useUnicode=true&characterEncoding=utf-8&allowPublicKeyRetrieval=true&useSSL=false
platform: mysql
hikari:
max-lifetime: 120000
jpa:
show-sql: false
database: mysql
hibernate:
ddl-auto: update
properties:
hibernate:
format_sql: true
dialect: org.hibernate.dialect.MySQLDialect
flyway:
enabled: true
clean-disabled: true
baseline-on-migrate: true
baseline-version: 1
locations:
- classpath:db/migration/mysql
# Not Require, Please config if you need email notify
mail:
# Attention: this is mail server address.
host: smtp.qq.com
username: example@qq.com
# Attention: this is not email account password, this requires an email authorization code
password: xxqzvuqbnqvbbdac
port: 465
default-encoding: UTF-8
properties:
mail:
smtp:
socketFactoryClass: javax.net.ssl.SSLSocketFactory
ssl:
enable: true
warehouse:
store:
# store history metrics data, enable only one below
jpa:
enabled: false
expire-time: 1h
victoria-metrics:
enabled: true
url: http://victoria-metrics:8428
username: root
password: root
insert:
buffer-size: 100
flush-interval: 3
compression:
enabled: false
# store real-time metrics data, enable only one below
real-time:
memory:
enabled: true
init-size: 16
redis:
enabled: false
# redis mode: single, sentinel, cluster. Default is single
mode: single
# separate each address with comma when using cluster mode, eg: 127.0.0.1:6379,127.0.0.1:6380
address: 127.0.0.1:6379
# enter master name when using sentinel mode
masterName: mymaster
password: 123456
# redis db index, default: DB0
db: 0
common:
queue:
# memory or kafka
type: memory
alerter:
# custom console url
console-url: https://console.tancloud.io
# we work
we-work-webhook-url: https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=
# ding ding talk
ding-talk-webhook-url: https://oapi.dingtalk.com/robot/send?access_token=
# fei shu fly book
fly-book-webhook-url: https://open.feishu.cn/open-apis/bot/v2/hook/
# telegram
telegram-webhook-url: https://api.telegram.org/bot%s/sendMessage
# discord
discord-webhook-url: https://discord.com/api/v9/channels/%s/messages
# serverChan
server-chan-webhook-url: https://sctapi.ftqq.com/%s.send
# gotify
gotify-webhook-url: http://127.0.0.1/message?token=%s
# alert inhibit ttl unit ms, default 14400000(4 hours)
inhibit:
ttl: 14400000
sms:
enable: false
type: tencent
tencent:
secret-id:
secret-key:
app-id:
sign-name:
template-id:
alibaba:
access-key-id:
access-key-secret:
sign-name:
template-code:
unisms:
# auth-mode: simple or hmac
auth-mode: simple
access-key-id: YOUR_ACCESS_KEY_ID
# hmac mode need to fill in access-key-secret
access-key-secret: YOUR_ACCESS_KEY_SECRET
signature: YOUR_SMS_SIGNATURE
template-id: YOUR_TEMPLATE_ID
smslocal:
api-key: YOUR_API_KEY_HERE
aws:
access-key-id: YOUR_ACCESS_KEY_ID
access-key-secret: YOUR_ACCESS_KEY_SECRET
region: AWS_REGION_FOR_END_USER_MESSAGING
twilio:
account-sid: YOUR_ACCOUNT_SID
auth-token: YOUR_AUTH_TOKEN
twilio-phone-number: YOUR_TWILIO_PHONE_NUMBER
scheduler:
server:
enabled: true
port: 1158
grafana:
enabled: false
url: http://127.0.0.1:3000
username: admin
password: admin
hertzbeat:
collector:
mysql:
# MySQL-compatible query engine routing for MySQL, MariaDB, OceanBase, and TiDB SQL metrics.
# auto : prefer JDBC only when mysql-connector-j is available from ext-lib, otherwise use the built-in query engine
# jdbc : always use JDBC
# r2dbc : always use the built-in query engine
query-engine: ${HERTZBEAT_COLLECTOR_MYSQL_QUERY_ENGINE:auto}
# Optional virtual-thread overrides. Remove this whole block to use built-in defaults.
vthreads:
enabled: true
common:
mode: UNBOUNDED_VT
collector:
mode: LIMIT_AND_REJECT
manager:
mode: LIMIT_AND_REJECT
max-concurrent-jobs: 10
alerter:
notify:
mode: LIMIT_AND_REJECT
max-concurrent-jobs: 64
periodic-max-concurrent-jobs: 10
log-worker:
max-concurrent-jobs: 10
queue-capacity: 1000
reduce:
max-concurrent-jobs: 2
window-evaluator:
max-concurrent-jobs: 2
notify-max-concurrent-per-channel: 4
warehouse:
mode: UNBOUNDED_VT
async:
enabled: true
concurrency-limit: 256
reject-when-limit-reached: true
task-termination-timeout: 5000
@@ -0,0 +1,21 @@
-- Licensed to the Apache Software Foundation (ASF) under one
-- or more contributor license agreements. See the NOTICE file
-- distributed with this work for additional information
-- regarding copyright ownership. The ASF licenses this file
-- to you under the Apache License, Version 2.0 (the
-- "License"); you may not use this file except in compliance
-- with the License. You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-- this file works for MySQL.
set names utf8mb4;
create database if not exists hertzbeat default charset utf8mb4 collate utf8mb4_general_ci;
commit;
@@ -0,0 +1,124 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
## -- sureness.yml account source -- ##
# config the resource restful api that need auth protection, base rbac
# rule: api===method===role
# eg: /api/v1/source1===get===[admin] means /api/v2/host===post support role[admin] access.
# eg: /api/v1/source2===get===[] means /api/v1/source2===get can not access by any role.
resourceRole:
- /api/account/auth/refresh===post===[admin,user,guest]
- /api/apps/**===get===[admin,user,guest]
- /api/monitor/**===get===[admin,user,guest]
- /api/monitor/**===post===[admin,user]
- /api/monitor/**===put===[admin,user]
- /api/monitor/**===delete==[admin]
- /api/monitors/**===get===[admin,user,guest]
- /api/monitors/**===post===[admin,user]
- /api/monitors/**===put===[admin,user]
- /api/monitors/**===delete===[admin]
- /api/alert/**===get===[admin,user,guest]
- /api/alert/**===post===[admin,user]
- /api/alert/**===put===[admin,user]
- /api/alert/**===delete===[admin]
- /api/alerts/**===get===[admin,user,guest]
- /api/alerts/**===post===[admin,user]
- /api/alerts/**===put===[admin,user]
- /api/alerts/**===delete===[admin]
- /api/notice/**===get===[admin,user,guest]
- /api/notice/**===post===[admin,user]
- /api/notice/**===put===[admin,user]
- /api/notice/**===delete===[admin]
- /api/tag/**===get===[admin,user,guest]
- /api/tag/**===post===[admin,user]
- /api/tag/**===put===[admin,user]
- /api/tag/**===delete===[admin]
- /api/summary/**===get===[admin,user,guest]
- /api/summary/**===post===[admin,user]
- /api/summary/**===put===[admin,user]
- /api/summary/**===delete===[admin]
- /api/collector/**===get===[admin,user,guest]
- /api/collector/**===post===[admin,user]
- /api/collector/**===put===[admin,user]
- /api/collector/**===delete===[admin]
- /api/status/page/**===get===[admin,user,guest]
- /api/status/page/**===post===[admin,user]
- /api/status/page/**===put===[admin,user]
- /api/status/page/**===delete===[admin]
- /api/grafana/**===get===[admin,user,guest]
- /api/grafana/**===post===[admin,user]
- /api/grafana/**===put===[admin,user]
- /api/grafana/**===delete===[admin]
- /api/bulletin/**===get===[admin,user,guest]
- /api/bulletin/**===post===[admin,user]
- /api/bulletin/**===put===[admin,user]
- /api/bulletin/**===delete===[admin]
- /api/mcp/**===get===[admin]
- /api/mcp/**===post===[admin]
- /api/chat/**===get===[admin,user]
- /api/chat/**===post===[admin]
- /api/logs/ingest/**===post===[admin,user]
# config the resource restful api that need bypass auth protection
# rule: api===method
# eg: /api/v1/source3===get means /api/v1/source3===get can be access by anyone, no need auth.
excludedResource:
- /api/alert/sse/**===*
- /api/logs/sse/**===*
- /api/account/auth/**===*
- /api/i18n/**===get
- /api/apps/hierarchy===get
- /api/push/**===*
- /api/status/page/public/**===*
- /api/manager/sse/**===*
# web ui resource
- /===get
- /assets/**===get
- /dashboard/**===get
- /monitors/**===get
- /alert/**===get
- /account/**===get
- /setting/**===get
- /passport/**===get
- /status/**===get
- /log/**===get
- /**/*.html===get
- /**/*.js===get
- /**/*.css===get
- /**/*.ico===get
- /**/*.ttf===get
- /**/*.png===get
- /**/*.gif===get
- /**/*.jpg===get
- /**/*.svg===get
- /**/*.json===get
- /**/*.woff===get
- /**/*.eot===get
# swagger ui resource
- /swagger-resources/**===get
- /v2/api-docs===get
- /v3/api-docs===get
# h2 database
- /h2-console/**===*
# account info config refer the https://hertzbeat.apache.org/docs/start/account-modify
# 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]
@@ -0,0 +1,87 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
version: "3.7"
networks:
hertzbeat:
driver: bridge
services:
mysql:
image: mariadb:11.7
container_name: compose-mysql
hostname: mysql
restart: always
healthcheck:
test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
interval: 10s
retries: 5
start_period: 30s
ports:
- '13306:3306'
environment:
TZ: Asia/Shanghai
MARIADB_ROOT_PASSWORD: 123456
volumes:
- ./dbdata/mysqldata:/var/lib/mysql/
- ./conf/sql:/docker-entrypoint-initdb.d/
networks:
- hertzbeat
victoria-metrics:
image: victoriametrics/victoria-metrics:v1.95.1
container_name: compose-victoria-metrics
hostname: victoria-metrics
restart: always
healthcheck:
test: ["CMD", "wget", "-q", "-O", "-", "http://victoria-metrics:8428/-/healthy"]
interval: 10s
retries: 5
timeout: 5s
start_period: 30s
environment:
TZ: Asia/Shanghai
ports:
- "18428:8428"
volumes:
- ./dbdata/tsdbdata:/victoria-metrics-data
networks:
- hertzbeat
hertzbeat:
image: apache/hertzbeat:1.8.0
container_name: compose-hertzbeat
hostname: hertzbeat
restart: always
environment:
HERTZBEAT_COLLECTOR_MYSQL_QUERY_ENGINE: auto
TZ: Asia/Shanghai
LANG: zh_CN.UTF-8
depends_on:
mysql:
condition: service_healthy
victoria-metrics:
condition: service_healthy
volumes:
- ./conf/application.yml:/opt/hertzbeat/config/application.yml
- ./conf/sureness.yml:/opt/hertzbeat/config/sureness.yml
- ./ext-lib:/opt/hertzbeat/ext-lib
- ./logs:/opt/hertzbeat/logs
ports:
- "1157:1157"
- "1158:1158"
networks:
- hertzbeat
@@ -0,0 +1,2 @@
!.gitignore
*.jar
@@ -0,0 +1,26 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
Please move external libs to this folder only when you need external JDBC jars, for example:
ojdbc8-21.5.0.0.jar
orai18n-21.5.0.0.jar
mysql-connector-java-8.0.30.jar
Notes:
- MySQL, MariaDB, OceanBase, and TiDB SQL query metrics can use the built-in MySQL-compatible query engine without `mysql-connector-j`.
- If `mysql-connector-j` is present here, HertzBeat prefers JDBC after restart.
- Oracle and DB2 still require external JDBC jars in `ext-lib`.
@@ -0,0 +1,34 @@
## docker-compose deployment HertzBeat+PostgreSQL+GreptimeDB solution
> The docker-compose deployment scheme uses PostgreSQL + GreptimeDB as the dependent storage service of HertzBeat.
> This solution will start three container services PostgreSQL, GreptimeDB, HertzBeat
##### Install Docker & Docker-compose
1. Download and install docker environment & docker-compose environment
Please refer to [Docker official website documentation](https://docs.docker.com/get-docker/), [Compose installation](https://docs.docker.com/compose/install/)
```
$ docker -v
Docker version 20.10.12, build e91ed57
```
##### docker compose deploys hertzbeat and its dependent services
1. Download the hertzbeat-docker-compose installation deployment script file
The script file is located in `script/docker-compose/hertzbeat-postgresql-greptimedb` link [script/docker-compose](https://github.com/apache/hertzbeat/tree/master/script/docker-compose/hertzbeat-postgresql-greptimedb)
2. Optional: add external JDBC driver jars to `ext-lib`
MySQL-compatible monitoring can use the built-in query engine directly, so `mysql-connector-j` is optional.
If you want HertzBeat to prefer JDBC after restart, place `mysql-connector-j` in `ext-lib`.
Oracle and DB2 still require external JDBC jars in `ext-lib`.
3. Enter the deployment script docker-compose directory, execute
`docker compose up -d`
##### Start exploring HertzBeat
Browser access `localhost:1157` to start, the default account password `admin/hertzbeat`
@@ -0,0 +1,39 @@
## docker-compose部署 HertzBeat+Postgresql+Greptime 方案
- 如果想自己本地快速部署的话,可以参考下面进行操作。
> docker-compose 部署方案使用了 PostgreSQL + GreptimeDB 作为 HertzBeat 依赖存储服务。
> 此方案会启动三个容器服务 PostgreSQL, GreptimeDB, HertzBeat
##### 安装Docker & Docker-compose
1. 下载安装 docker 环境 & docker-compose 环境
请参考 [Docker官网文档](https://docs.docker.com/get-docker/), [Compose安装](https://docs.docker.com/compose/install/)
```
$ docker -v
Docker version 20.10.12, build e91ed57
```
##### docker compose部署hertzbeat及其依赖服务
1. 下载hertzbeat-docker-compose安装部署脚本文件
脚本文件位于代码仓库下`script/docker-compose/hertzbeat-postgresql-greptimedb` 链接 [script/docker-compose](https://github.com/apache/hertzbeat/tree/master/script/docker-compose/hertzbeat-postgresql-greptimedb)
2. 可选:向 `ext-lib` 添加外部 JDBC 驱动 jar
MySQL 兼容监控现在可以直接使用内置查询引擎,所以 `mysql-connector-j` 不是必需项。
如果你希望 HertzBeat 在重启后优先走 JDBC,可以把 `mysql-connector-j` 放到 `ext-lib`。
Oracle、DB2 这类场景仍然需要把外部 JDBC 驱动放到 `ext-lib`。
3. 进入部署脚本 docker-compose 目录, 执行
`docker compose up -d`
##### 开始探索HertzBeat
浏览器访问 `localhost:1157` 即可开始,默认账号密码 `admin/hertzbeat`
---
怎么样是不是很简单,只要几分钟就可以部署完成,赶紧试试吧!
@@ -0,0 +1,272 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
server:
port: 1157
spring:
application:
name: ${HOSTNAME:@hertzbeat@}${PID}
profiles:
active: prod
ai:
mcp:
server:
enabled: true
stdio: false
protocol: streamable
streamable-http:
mcp-endpoint: /api/mcp
name: hertzbeat-mcp-server
version: 1.0.0
type: SYNC
mvc:
static-path-pattern: /**
jackson:
default-property-inclusion: ALWAYS
web:
resources:
static-locations:
- classpath:/dist/
- classpath:../dist/
# need to disable spring boot mongodb auto config, or default mongodb connection tried and failed..
autoconfigure:
exclude: org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration, org.springframework.boot.autoconfigure.data.mongo.MongoDataAutoConfiguration
freemarker:
enabled: false
servlet:
multipart:
max-file-size: 100MB
max-request-size: 100MB
management:
health:
mail:
enabled: off
endpoints:
web:
exposure:
include:
- 'metrics'
- 'health'
- 'prometheus'
enabled-by-default: on
endpoint:
prometheus:
access: read_only
metrics:
tags:
application: ${spring.application.name}
environment: ${spring.profiles.active}
prometheus:
metrics:
export:
enabled: true
sureness:
container: jakarta_servlet
auths:
- digest
- basic
- jwt
jwt:
secret: 'CyaFv0bwq2Eik0jdrKUtsA6bx3sDJeFV643R
LnfKefTjsIfJLBa2YkhEqEGtcHDTNe4CU6+9
8tVt4bisXQ13rbN0oxhUZR73M6EByXIO+SV5
dKhaX0csgOCTlCxq20yhmUea6H6JIpSE2Rwp'
---
spring:
config:
activate:
on-profile: prod
datasource:
driver-class-name: org.postgresql.Driver
username: root
password: 123456
url: jdbc:postgresql://postgresql:5432/hertzbeat
hikari:
max-lifetime: 120000
jpa:
show-sql: false
database: postgresql
hibernate:
ddl-auto: update
properties:
hibernate:
format_sql: true
dialect: org.hibernate.dialect.PostgreSQLDialect
flyway:
enabled: true
clean-disabled: true
baseline-on-migrate: true
baseline-version: 1
locations:
- classpath:db/migration/postgresql
# Not Require, Please config if you need email notify
mail:
# Attention: this is mail server address.
host: smtp.qq.com
username: example@qq.com
# Attention: this is not email account password, this requires an email authorization code
password: xxqzvuqbnqvbbdac
port: 465
default-encoding: UTF-8
properties:
mail:
smtp:
socketFactoryClass: javax.net.ssl.SSLSocketFactory
ssl:
enable: true
warehouse:
store:
# store history metrics data, enable only one below
jpa:
enabled: false
expire-time: 1h
greptime:
enabled: true
grpc-endpoints: greptime:4001
http-endpoint: http://greptime:4000
# if you config other database name, you should create them first
database: public
username: greptime
password: greptime
# store real-time metrics data, enable only one below
real-time:
memory:
enabled: true
init-size: 16
redis:
enabled: false
# redis mode: single, sentinel, cluster. Default is single
mode: single
# separate each address with comma when using cluster mode, eg: 127.0.0.1:6379,127.0.0.1:6380
address: 127.0.0.1:6379
# enter master name when using sentinel mode
masterName: mymaster
password: 123456
# redis db index, default: DB0
db: 0
common:
queue:
# memory or kafka
type: memory
alerter:
# custom console url
console-url: https://console.tancloud.io
# we work
we-work-webhook-url: https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=
# ding ding talk
ding-talk-webhook-url: https://oapi.dingtalk.com/robot/send?access_token=
# fei shu fly book
fly-book-webhook-url: https://open.feishu.cn/open-apis/bot/v2/hook/
# telegram
telegram-webhook-url: https://api.telegram.org/bot%s/sendMessage
# discord
discord-webhook-url: https://discord.com/api/v9/channels/%s/messages
# serverChan
server-chan-webhook-url: https://sctapi.ftqq.com/%s.send
# gotify
gotify-webhook-url: http://127.0.0.1/message?token=%s
# alert inhibit ttl unit ms, default 14400000(4 hours)
inhibit:
ttl: 14400000
sms:
enable: false
type: tencent
tencent:
secret-id:
secret-key:
app-id:
sign-name:
template-id:
alibaba:
access-key-id:
access-key-secret:
sign-name:
template-code:
unisms:
# auth-mode: simple or hmac
auth-mode: simple
access-key-id: YOUR_ACCESS_KEY_ID
# hmac mode need to fill in access-key-secret
access-key-secret: YOUR_ACCESS_KEY_SECRET
signature: YOUR_SMS_SIGNATURE
template-id: YOUR_TEMPLATE_ID
smslocal:
api-key: YOUR_API_KEY_HERE
aws:
access-key-id: YOUR_ACCESS_KEY_ID
access-key-secret: YOUR_ACCESS_KEY_SECRET
region: AWS_REGION_FOR_END_USER_MESSAGING
twilio:
account-sid: YOUR_ACCOUNT_SID
auth-token: YOUR_AUTH_TOKEN
twilio-phone-number: YOUR_TWILIO_PHONE_NUMBER
scheduler:
server:
enabled: true
port: 1158
grafana:
enabled: false
url: http://127.0.0.1:3000
username: admin
password: admin
hertzbeat:
collector:
mysql:
# MySQL-compatible query engine routing for MySQL, MariaDB, OceanBase, and TiDB SQL metrics.
# auto : prefer JDBC only when mysql-connector-j is available from ext-lib, otherwise use the built-in query engine
# jdbc : always use JDBC
# r2dbc : always use the built-in query engine
query-engine: ${HERTZBEAT_COLLECTOR_MYSQL_QUERY_ENGINE:auto}
# Optional virtual-thread overrides. Remove this whole block to use built-in defaults.
vthreads:
enabled: true
common:
mode: UNBOUNDED_VT
collector:
mode: LIMIT_AND_REJECT
manager:
mode: LIMIT_AND_REJECT
max-concurrent-jobs: 10
alerter:
notify:
mode: LIMIT_AND_REJECT
max-concurrent-jobs: 64
periodic-max-concurrent-jobs: 10
log-worker:
max-concurrent-jobs: 10
queue-capacity: 1000
reduce:
max-concurrent-jobs: 2
window-evaluator:
max-concurrent-jobs: 2
notify-max-concurrent-per-channel: 4
warehouse:
mode: UNBOUNDED_VT
async:
enabled: true
concurrency-limit: 256
reject-when-limit-reached: true
task-termination-timeout: 5000
@@ -0,0 +1,26 @@
-- Licensed to the Apache Software Foundation (ASF) under one
-- or more contributor license agreements. See the NOTICE file
-- distributed with this work for additional information
-- regarding copyright ownership. The ASF licenses this file
-- to you under the Apache License, Version 2.0 (the
-- "License"); you may not use this file except in compliance
-- with the License. You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-- this file works for PostgreSQL.
CREATE EXTENSION IF NOT EXISTS dblink;
DO $$
BEGIN
PERFORM dblink_exec('', 'CREATE DATABASE hertzbeat');
EXCEPTION WHEN duplicate_database THEN RAISE NOTICE '%, skipping', SQLERRM USING ERRCODE = SQLSTATE;
END
$$;
@@ -0,0 +1,124 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
## -- sureness.yml account source -- ##
# config the resource restful api that need auth protection, base rbac
# rule: api===method===role
# eg: /api/v1/source1===get===[admin] means /api/v2/host===post support role[admin] access.
# eg: /api/v1/source2===get===[] means /api/v1/source2===get can not access by any role.
resourceRole:
- /api/account/auth/refresh===post===[admin,user,guest]
- /api/apps/**===get===[admin,user,guest]
- /api/monitor/**===get===[admin,user,guest]
- /api/monitor/**===post===[admin,user]
- /api/monitor/**===put===[admin,user]
- /api/monitor/**===delete==[admin]
- /api/monitors/**===get===[admin,user,guest]
- /api/monitors/**===post===[admin,user]
- /api/monitors/**===put===[admin,user]
- /api/monitors/**===delete===[admin]
- /api/alert/**===get===[admin,user,guest]
- /api/alert/**===post===[admin,user]
- /api/alert/**===put===[admin,user]
- /api/alert/**===delete===[admin]
- /api/alerts/**===get===[admin,user,guest]
- /api/alerts/**===post===[admin,user]
- /api/alerts/**===put===[admin,user]
- /api/alerts/**===delete===[admin]
- /api/notice/**===get===[admin,user,guest]
- /api/notice/**===post===[admin,user]
- /api/notice/**===put===[admin,user]
- /api/notice/**===delete===[admin]
- /api/tag/**===get===[admin,user,guest]
- /api/tag/**===post===[admin,user]
- /api/tag/**===put===[admin,user]
- /api/tag/**===delete===[admin]
- /api/summary/**===get===[admin,user,guest]
- /api/summary/**===post===[admin,user]
- /api/summary/**===put===[admin,user]
- /api/summary/**===delete===[admin]
- /api/collector/**===get===[admin,user,guest]
- /api/collector/**===post===[admin,user]
- /api/collector/**===put===[admin,user]
- /api/collector/**===delete===[admin]
- /api/status/page/**===get===[admin,user,guest]
- /api/status/page/**===post===[admin,user]
- /api/status/page/**===put===[admin,user]
- /api/status/page/**===delete===[admin]
- /api/grafana/**===get===[admin,user,guest]
- /api/grafana/**===post===[admin,user]
- /api/grafana/**===put===[admin,user]
- /api/grafana/**===delete===[admin]
- /api/bulletin/**===get===[admin,user,guest]
- /api/bulletin/**===post===[admin,user]
- /api/bulletin/**===put===[admin,user]
- /api/bulletin/**===delete===[admin]
- /api/mcp/**===get===[admin]
- /api/mcp/**===post===[admin]
- /api/chat/**===get===[admin,user]
- /api/chat/**===post===[admin]
- /api/logs/ingest/**===post===[admin,user]
# config the resource restful api that need bypass auth protection
# rule: api===method
# eg: /api/v1/source3===get means /api/v1/source3===get can be access by anyone, no need auth.
excludedResource:
- /api/alert/sse/**===*
- /api/logs/sse/**===*
- /api/account/auth/**===*
- /api/i18n/**===get
- /api/apps/hierarchy===get
- /api/push/**===*
- /api/status/page/public/**===*
- /api/manager/sse/**===*
# web ui resource
- /===get
- /assets/**===get
- /dashboard/**===get
- /monitors/**===get
- /alert/**===get
- /account/**===get
- /setting/**===get
- /passport/**===get
- /status/**===get
- /log/**===get
- /**/*.html===get
- /**/*.js===get
- /**/*.css===get
- /**/*.ico===get
- /**/*.ttf===get
- /**/*.png===get
- /**/*.gif===get
- /**/*.jpg===get
- /**/*.svg===get
- /**/*.json===get
- /**/*.woff===get
- /**/*.eot===get
# swagger ui resource
- /swagger-resources/**===get
- /v2/api-docs===get
- /v3/api-docs===get
# h2 database
- /h2-console/**===*
# account info config refer the https://hertzbeat.apache.org/docs/start/account-modify
# 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]
@@ -0,0 +1,107 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
version: "3.7"
networks:
hertzbeat:
driver: bridge
volumes:
greptime-tsdb-data:
services:
postgres:
image: postgres:15
container_name: compose-postgresql
hostname: postgresql
restart: always
healthcheck:
test: [ "CMD", "pg_isready" ]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
ports:
- '15432:5432'
environment:
POSTGRES_USER: root
POSTGRES_PASSWORD: 123456
TZ: Asia/Shanghai
PGDATA: /var/lib/postgresql/data/pgdata
volumes:
- ./dbdata/pgdata:/var/lib/postgresql/data
- ./conf/sql:/docker-entrypoint-initdb.d/
networks:
- hertzbeat
greptime:
image: greptime/greptimedb:v0.14.3
container_name: compose-greptimedb
hostname: greptime
restart: always
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:4000/health" ]
interval: 10s
retries: 5
timeout: 5s
start_period: 30s
environment:
TZ: Asia/Shanghai
ports:
- "14000:4000"
- "14001:4001"
- "14002:4002"
- "14003:4003"
volumes:
- greptime-tsdb-data:/greptimedb_data
command:
- "standalone"
- "start"
- "--user-provider=static_user_provider:cmd:greptime=greptime"
- "--http-addr"
- "0.0.0.0:4000"
- "--rpc-bind-addr"
- "0.0.0.0:4001"
- "--mysql-addr"
- "0.0.0.0:4002"
- "--postgres-addr"
- "0.0.0.0:4003"
- "--data-home=/greptimedb_data"
networks:
- hertzbeat
hertzbeat:
image: apache/hertzbeat:1.8.0
container_name: compose-hertzbeat
hostname: hertzbeat
restart: always
environment:
HERTZBEAT_COLLECTOR_MYSQL_QUERY_ENGINE: auto
TZ: Asia/Shanghai
LANG: zh_CN.UTF-8
depends_on:
postgres:
condition: service_healthy
greptime:
condition: service_healthy
volumes:
- ./conf/application.yml:/opt/hertzbeat/config/application.yml
- ./conf/sureness.yml:/opt/hertzbeat/config/sureness.yml
- ./logs:/opt/hertzbeat/logs
- ./ext-lib:/opt/hertzbeat/ext-lib
ports:
- "1157:1157"
- "1158:1158"
networks:
- hertzbeat
@@ -0,0 +1,2 @@
!.gitignore
*.jar
@@ -0,0 +1,26 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
Please move external libs to this folder only when you need external JDBC jars, for example:
ojdbc8-21.5.0.0.jar
orai18n-21.5.0.0.jar
mysql-connector-java-8.0.30.jar
Notes:
- MySQL, MariaDB, OceanBase, and TiDB SQL query metrics can use the built-in MySQL-compatible query engine without `mysql-connector-j`.
- If `mysql-connector-j` is present here, HertzBeat prefers JDBC after restart.
- Oracle and DB2 still require external JDBC jars in `ext-lib`.
@@ -0,0 +1,34 @@
## docker-compose deployment HertzBeat+PostgreSQL+IoTDB solution
> The docker-compose deployment scheme uses PostgreSQL + VictoriaMetrics as the dependent storage service of HertzBeat.
> This solution will start three container services PostgreSQL, VictoriaMetrics, HertzBeat
##### Install Docker & Docker-compose
1. Download and install docker environment & docker-compose environment
Please refer to [Docker official website documentation](https://docs.docker.com/get-docker/), [Compose installation](https://docs.docker.com/compose/install/)
```
$ docker -v
Docker version 20.10.12, build e91ed57
```
##### docker compose deploys hertzbeat and its dependent services
1. Download the hertzbeat-docker-compose installation deployment script file
The script file is located in `script/docker-compose/hertzbeat-postgresql-victoria-metrics` link [script/docker-compose](https://github.com/apache/hertzbeat/tree/master/script/docker-compose/hertzbeat-postgresql-victoria-metrics)
2. Optional: add external JDBC driver jars to `ext-lib`
MySQL-compatible monitoring can use the built-in query engine directly, so `mysql-connector-j` is optional.
If you want HertzBeat to prefer JDBC after restart, place `mysql-connector-j` in `ext-lib`.
Oracle and DB2 still require external JDBC jars in `ext-lib`.
3. Enter the deployment script docker-compose directory, execute
`docker compose up -d`
##### Start exploring HertzBeat
Browser access `localhost:1157` to start, the default account password `admin/hertzbeat`
@@ -0,0 +1,39 @@
## docker-compose部署 HertzBeat+Postgresql+IoTDB 方案
- 如果想自己本地快速部署的话,可以参考下面进行操作。
> docker-compose 部署方案使用了 PostgreSQL + victoria-metrics 作为 HertzBeat 依赖存储服务。
> 此方案会启动三个容器服务 PostgreSQL, victoria-metrics, HertzBeat
##### 安装Docker & Docker-compose
1. 下载安装 docker 环境 & docker-compose 环境
请参考 [Docker官网文档](https://docs.docker.com/get-docker/), [Compose安装](https://docs.docker.com/compose/install/)
```
$ docker -v
Docker version 20.10.12, build e91ed57
```
##### docker compose部署hertzbeat及其依赖服务
1. 下载hertzbeat-docker-compose安装部署脚本文件
脚本文件位于代码仓库下`script/docker-compose/hertzbeat-postgre-victoria-metrics` 链接 [script/docker-compose](https://github.com/apache/hertzbeat/tree/master/script/docker-compose/hertzbeat-postgresql-victoria-metrics)
2. 可选:向 `ext-lib` 添加外部 JDBC 驱动 jar
MySQL 兼容监控现在可以直接使用内置查询引擎,所以 `mysql-connector-j` 不是必需项。
如果你希望 HertzBeat 在重启后优先走 JDBC,可以把 `mysql-connector-j` 放到 `ext-lib`。
Oracle、DB2 这类场景仍然需要把外部 JDBC 驱动放到 `ext-lib`。
3. 进入部署脚本 docker-compose 目录, 执行
`docker compose up -d`
##### 开始探索HertzBeat
浏览器访问 `localhost:1157` 即可开始,默认账号密码 `admin/hertzbeat`
---
怎么样是不是很简单,只要几分钟就可以部署完成,赶紧试试吧!
@@ -0,0 +1,274 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
server:
port: 1157
spring:
application:
name: ${HOSTNAME:@hertzbeat@}${PID}
profiles:
active: prod
ai:
mcp:
server:
enabled: true
stdio: false
protocol: streamable
streamable-http:
mcp-endpoint: /api/mcp
name: hertzbeat-mcp-server
version: 1.0.0
type: SYNC
mvc:
static-path-pattern: /**
jackson:
default-property-inclusion: ALWAYS
web:
resources:
static-locations:
- classpath:/dist/
- classpath:../dist/
# need to disable spring boot mongodb auto config, or default mongodb connection tried and failed..
autoconfigure:
exclude: org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration, org.springframework.boot.autoconfigure.data.mongo.MongoDataAutoConfiguration
freemarker:
enabled: false
servlet:
multipart:
max-file-size: 100MB
max-request-size: 100MB
management:
health:
mail:
enabled: off
endpoints:
web:
exposure:
include:
- 'metrics'
- 'health'
- 'prometheus'
enabled-by-default: on
endpoint:
prometheus:
access: read_only
metrics:
tags:
application: ${spring.application.name}
environment: ${spring.profiles.active}
prometheus:
metrics:
export:
enabled: true
sureness:
container: jakarta_servlet
auths:
- digest
- basic
- jwt
jwt:
secret: 'CyaFv0bwq2Eik0jdrKUtsA6bx3sDJeFV643R
LnfKefTjsIfJLBa2YkhEqEGtcHDTNe4CU6+9
8tVt4bisXQ13rbN0oxhUZR73M6EByXIO+SV5
dKhaX0csgOCTlCxq20yhmUea6H6JIpSE2Rwp'
---
spring:
config:
activate:
on-profile: prod
datasource:
driver-class-name: org.postgresql.Driver
username: root
password: 123456
url: jdbc:postgresql://postgresql:5432/hertzbeat
hikari:
max-lifetime: 120000
jpa:
show-sql: false
database: postgresql
hibernate:
ddl-auto: update
properties:
hibernate:
format_sql: true
dialect: org.hibernate.dialect.PostgreSQLDialect
flyway:
enabled: true
clean-disabled: true
baseline-on-migrate: true
baseline-version: 1
locations:
- classpath:db/migration/postgresql
# Not Require, Please config if you need email notify
mail:
# Attention: this is mail server address.
host: smtp.qq.com
username: example@qq.com
# Attention: this is not email account password, this requires an email authorization code
password: xxqzvuqbnqvbbdac
port: 465
default-encoding: UTF-8
properties:
mail:
smtp:
socketFactoryClass: javax.net.ssl.SSLSocketFactory
ssl:
enable: true
warehouse:
store:
# store history metrics data, enable only one below
jpa:
enabled: false
expire-time: 1h
victoria-metrics:
enabled: true
url: http://victoria-metrics:8428
username: root
password: root
insert:
buffer-size: 100
flush-interval: 3
compression:
enabled: false
# store real-time metrics data, enable only one below
real-time:
memory:
enabled: true
init-size: 16
redis:
enabled: false
# redis mode: single, sentinel, cluster. Default is single
mode: single
# separate each address with comma when using cluster mode, eg: 127.0.0.1:6379,127.0.0.1:6380
address: 127.0.0.1:6379
# enter master name when using sentinel mode
masterName: mymaster
password: 123456
# redis db index, default: DB0
db: 0
common:
queue:
# memory or kafka
type: memory
alerter:
# custom console url
console-url: https://console.tancloud.io
# we work
we-work-webhook-url: https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=
# ding ding talk
ding-talk-webhook-url: https://oapi.dingtalk.com/robot/send?access_token=
# fei shu fly book
fly-book-webhook-url: https://open.feishu.cn/open-apis/bot/v2/hook/
# telegram
telegram-webhook-url: https://api.telegram.org/bot%s/sendMessage
# discord
discord-webhook-url: https://discord.com/api/v9/channels/%s/messages
# serverChan
server-chan-webhook-url: https://sctapi.ftqq.com/%s.send
# gotify
gotify-webhook-url: http://127.0.0.1/message?token=%s
# alert inhibit ttl unit ms, default 14400000(4 hours)
inhibit:
ttl: 14400000
sms:
enable: false
type: tencent
tencent:
secret-id:
secret-key:
app-id:
sign-name:
template-id:
alibaba:
access-key-id:
access-key-secret:
sign-name:
template-code:
unisms:
# auth-mode: simple or hmac
auth-mode: simple
access-key-id: YOUR_ACCESS_KEY_ID
# hmac mode need to fill in access-key-secret
access-key-secret: YOUR_ACCESS_KEY_SECRET
signature: YOUR_SMS_SIGNATURE
template-id: YOUR_TEMPLATE_ID
smslocal:
api-key: YOUR_API_KEY_HERE
aws:
access-key-id: YOUR_ACCESS_KEY_ID
access-key-secret: YOUR_ACCESS_KEY_SECRET
region: AWS_REGION_FOR_END_USER_MESSAGING
twilio:
account-sid: YOUR_ACCOUNT_SID
auth-token: YOUR_AUTH_TOKEN
twilio-phone-number: YOUR_TWILIO_PHONE_NUMBER
scheduler:
server:
enabled: true
port: 1158
grafana:
enabled: false
url: http://127.0.0.1:3000
username: admin
password: admin
hertzbeat:
collector:
mysql:
# MySQL-compatible query engine routing for MySQL, MariaDB, OceanBase, and TiDB SQL metrics.
# auto : prefer JDBC only when mysql-connector-j is available from ext-lib, otherwise use the built-in query engine
# jdbc : always use JDBC
# r2dbc : always use the built-in query engine
query-engine: ${HERTZBEAT_COLLECTOR_MYSQL_QUERY_ENGINE:auto}
# Optional virtual-thread overrides. Remove this whole block to use built-in defaults.
vthreads:
enabled: true
common:
mode: UNBOUNDED_VT
collector:
mode: LIMIT_AND_REJECT
manager:
mode: LIMIT_AND_REJECT
max-concurrent-jobs: 10
alerter:
notify:
mode: LIMIT_AND_REJECT
max-concurrent-jobs: 64
periodic-max-concurrent-jobs: 10
log-worker:
max-concurrent-jobs: 10
queue-capacity: 1000
reduce:
max-concurrent-jobs: 2
window-evaluator:
max-concurrent-jobs: 2
notify-max-concurrent-per-channel: 4
warehouse:
mode: UNBOUNDED_VT
async:
enabled: true
concurrency-limit: 256
reject-when-limit-reached: true
task-termination-timeout: 5000
@@ -0,0 +1,26 @@
-- Licensed to the Apache Software Foundation (ASF) under one
-- or more contributor license agreements. See the NOTICE file
-- distributed with this work for additional information
-- regarding copyright ownership. The ASF licenses this file
-- to you under the Apache License, Version 2.0 (the
-- "License"); you may not use this file except in compliance
-- with the License. You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-- this file works for PostgreSQL.
CREATE EXTENSION IF NOT EXISTS dblink;
DO $$
BEGIN
PERFORM dblink_exec('', 'CREATE DATABASE hertzbeat');
EXCEPTION WHEN duplicate_database THEN RAISE NOTICE '%, skipping', SQLERRM USING ERRCODE = SQLSTATE;
END
$$;
@@ -0,0 +1,124 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
## -- sureness.yml account source -- ##
# config the resource restful api that need auth protection, base rbac
# rule: api===method===role
# eg: /api/v1/source1===get===[admin] means /api/v2/host===post support role[admin] access.
# eg: /api/v1/source2===get===[] means /api/v1/source2===get can not access by any role.
resourceRole:
- /api/account/auth/refresh===post===[admin,user,guest]
- /api/apps/**===get===[admin,user,guest]
- /api/monitor/**===get===[admin,user,guest]
- /api/monitor/**===post===[admin,user]
- /api/monitor/**===put===[admin,user]
- /api/monitor/**===delete==[admin]
- /api/monitors/**===get===[admin,user,guest]
- /api/monitors/**===post===[admin,user]
- /api/monitors/**===put===[admin,user]
- /api/monitors/**===delete===[admin]
- /api/alert/**===get===[admin,user,guest]
- /api/alert/**===post===[admin,user]
- /api/alert/**===put===[admin,user]
- /api/alert/**===delete===[admin]
- /api/alerts/**===get===[admin,user,guest]
- /api/alerts/**===post===[admin,user]
- /api/alerts/**===put===[admin,user]
- /api/alerts/**===delete===[admin]
- /api/notice/**===get===[admin,user,guest]
- /api/notice/**===post===[admin,user]
- /api/notice/**===put===[admin,user]
- /api/notice/**===delete===[admin]
- /api/tag/**===get===[admin,user,guest]
- /api/tag/**===post===[admin,user]
- /api/tag/**===put===[admin,user]
- /api/tag/**===delete===[admin]
- /api/summary/**===get===[admin,user,guest]
- /api/summary/**===post===[admin,user]
- /api/summary/**===put===[admin,user]
- /api/summary/**===delete===[admin]
- /api/collector/**===get===[admin,user,guest]
- /api/collector/**===post===[admin,user]
- /api/collector/**===put===[admin,user]
- /api/collector/**===delete===[admin]
- /api/status/page/**===get===[admin,user,guest]
- /api/status/page/**===post===[admin,user]
- /api/status/page/**===put===[admin,user]
- /api/status/page/**===delete===[admin]
- /api/grafana/**===get===[admin,user,guest]
- /api/grafana/**===post===[admin,user]
- /api/grafana/**===put===[admin,user]
- /api/grafana/**===delete===[admin]
- /api/bulletin/**===get===[admin,user,guest]
- /api/bulletin/**===post===[admin,user]
- /api/bulletin/**===put===[admin,user]
- /api/bulletin/**===delete===[admin]
- /api/mcp/**===get===[admin]
- /api/mcp/**===post===[admin]
- /api/chat/**===get===[admin,user]
- /api/chat/**===post===[admin]
- /api/logs/ingest/**===post===[admin,user]
# config the resource restful api that need bypass auth protection
# rule: api===method
# eg: /api/v1/source3===get means /api/v1/source3===get can be access by anyone, no need auth.
excludedResource:
- /api/alert/sse/**===*
- /api/logs/sse/**===*
- /api/account/auth/**===*
- /api/i18n/**===get
- /api/apps/hierarchy===get
- /api/push/**===*
- /api/status/page/public/**===*
- /api/manager/sse/**===*
# web ui resource
- /===get
- /assets/**===get
- /dashboard/**===get
- /monitors/**===get
- /alert/**===get
- /account/**===get
- /setting/**===get
- /passport/**===get
- /status/**===get
- /log/**===get
- /**/*.html===get
- /**/*.js===get
- /**/*.css===get
- /**/*.ico===get
- /**/*.ttf===get
- /**/*.png===get
- /**/*.gif===get
- /**/*.jpg===get
- /**/*.svg===get
- /**/*.json===get
- /**/*.woff===get
- /**/*.eot===get
# swagger ui resource
- /swagger-resources/**===get
- /v2/api-docs===get
- /v3/api-docs===get
# h2 database
- /h2-console/**===*
# account info config refer the https://hertzbeat.apache.org/docs/start/account-modify
# 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]
@@ -0,0 +1,90 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
version: "3.7"
networks:
hertzbeat:
driver: bridge
services:
postgres:
image: postgres:15
container_name: compose-postgresql
hostname: postgresql
restart: always
healthcheck:
test: [ "CMD", "pg_isready" ]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
ports:
- '15432:5432'
environment:
POSTGRES_USER: root
POSTGRES_PASSWORD: 123456
TZ: Asia/Shanghai
PGDATA: /var/lib/postgresql/data/pgdata
volumes:
- ./dbdata/pgdata:/var/lib/postgresql/data
- ./conf/sql:/docker-entrypoint-initdb.d/
networks:
- hertzbeat
victoria-metrics:
image: victoriametrics/victoria-metrics:v1.95.1
container_name: compose-victoria-metrics
hostname: victoria-metrics
restart: always
healthcheck:
test: ["CMD", "wget", "-q", "-O", "-", "http://victoria-metrics:8428/-/healthy"]
interval: 10s
retries: 5
timeout: 5s
start_period: 30s
environment:
TZ: Asia/Shanghai
ports:
- "18428:8428"
volumes:
- ./dbdata/tsdbdata:/victoria-metrics-data
networks:
- hertzbeat
hertzbeat:
image: apache/hertzbeat:1.8.0
container_name: compose-hertzbeat
hostname: hertzbeat
restart: always
environment:
HERTZBEAT_COLLECTOR_MYSQL_QUERY_ENGINE: auto
TZ: Asia/Shanghai
LANG: zh_CN.UTF-8
depends_on:
postgres:
condition: service_healthy
victoria-metrics:
condition: service_healthy
volumes:
- ./conf/application.yml:/opt/hertzbeat/config/application.yml
- ./conf/sureness.yml:/opt/hertzbeat/config/sureness.yml
- ./logs:/opt/hertzbeat/logs
- ./ext-lib:/opt/hertzbeat/ext-lib
ports:
- "1157:1157"
- "1158:1158"
networks:
- hertzbeat
@@ -0,0 +1,2 @@
!.gitignore
*.jar
@@ -0,0 +1,26 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
Please move external libs to this folder only when you need external JDBC jars, for example:
ojdbc8-21.5.0.0.jar
orai18n-21.5.0.0.jar
mysql-connector-java-8.0.30.jar
Notes:
- MySQL, MariaDB, OceanBase, and TiDB SQL query metrics can use the built-in MySQL-compatible query engine without `mysql-connector-j`.
- If `mysql-connector-j` is present here, HertzBeat prefers JDBC after restart.
- Oracle and DB2 still require external JDBC jars in `ext-lib`.
+37
View File
@@ -0,0 +1,37 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
FROM eclipse-temurin:25-jdk
MAINTAINER Apache HertzBeat "dev@hertzbeat.apache.org"
ARG VERSION
# Install SSH
RUN sed -i 's#http://#https://#g' /etc/apt/sources.list.d/ubuntu.sources && \
apt-get update && apt-get install -y openssh-server
RUN mkdir -p /var/run/sshd
ADD apache-hertzbeat-collector-${VERSION}-bin.tar.gz /opt/
ENV JAVA_OPTS ""
ENV TZ=Asia/Shanghai
ENV LANG=en_US.UTF-8
WORKDIR /opt/apache-hertzbeat-collector-${VERSION}-bin/
ENTRYPOINT ["./bin/entrypoint.sh"]
+29
View File
@@ -0,0 +1,29 @@
## Use the buildx to build Docker images that support multiple system architectures
> https://vuepress.mirror.docker-practice.com/buildx/multi-arch-images/
```shell
$ docker buildx create --use --name=mybuilder-cn --driver docker-container --driver-opt image=dockerpracticesig/buildkit:master
# for tencent environment
$ docker buildx create --use --name=mybuilder-cn --driver docker-container --driver-opt image=dockerpracticesig/buildkit:master-tencent
$ docker buildx create --use --name mybuilder --driver docker-container
$ docker buildx use mybuilder
```
#### Build the image
```shell
# Use the --platform flag to specify the target platforms for the build --push flag to push the image to a registry
$ docker buildx build --platform linux/arm64,linux/amd64 -t apache/hertzbeat-collector:1.0.0 . --push
$ docker buildx build --platform linux/arm64,linux/amd64 -t quay.io/tancloud/hertzbeat-collector:latest . --push
# Inspect the image info
$ docker buildx imagetools inspect apache/hertzbeat-collector:1.0.0
```
+57
View File
@@ -0,0 +1,57 @@
#!/bin/sh
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
cd `dirname $0`
# current dir
CURRENT_DIR=`pwd`
# cd dist dir
cd ../../../dist
# auto detect the JVM collector package version
PACKAGE_FILE=$(find . -maxdepth 1 -name 'apache-hertzbeat-collector-*-bin.tar.gz' \
! -name 'apache-hertzbeat-collector-native-*-bin.tar.gz' | head -n 1)
VERSION=$(basename "$PACKAGE_FILE" | sed -e 's/^apache-hertzbeat-collector-//' -e 's/-bin\.tar\.gz$//')
# use the version param
if [ -n "$1" ]; then
VERSION="$1";
fi
if [ -z "$VERSION" ]; then
echo "Can not find the JVM collector package under dist/. Build apache-hertzbeat-collector-{version}-bin.tar.gz first."
exit 1
fi
# docker compile context
CONTEXT_DIR=`pwd`
COMMAND="docker buildx build --platform linux/arm64,linux/amd64 -t apache/hertzbeat-collector:$VERSION -f $CURRENT_DIR/Dockerfile $CONTEXT_DIR --build-arg VERSION="$VERSION" --push"
#COMMAND="docker buildx build --platform linux/arm64,linux/amd64 -t apache/hertzbeat-collector:latest -f $CURRENT_DIR/Dockerfile $CONTEXT_DIR --build-arg VERSION="$VERSION" --push"
#COMMAND="docker buildx build --platform linux/arm64,linux/amd64 -t quay.io/tancloud/hertzbeat-collector:$VERSION -f $CURRENT_DIR/Dockerfile $CONTEXT_DIR --build-arg VERSION="$VERSION" --push"
#COMMAND="docker buildx build --platform linux/arm64,linux/amd64 -t quay.io/tancloud/hertzbeat-collector:latest -f $CURRENT_DIR/Dockerfile $CONTEXT_DIR --build-arg VERSION="$VERSION" --push"
# Build Local
#COMMAND="docker build -t apache/hertzbeat-collector:$VERSION -f $CURRENT_DIR/Dockerfile $CONTEXT_DIR --build-arg VERSION="$VERSION" "
echo "$COMMAND"
$COMMAND
#docker build -t apache/hertzbeat-collector:latest -f $CURRENT_DIR/Dockerfile $CONTEXT_DIR
+39
View File
@@ -0,0 +1,39 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
FROM eclipse-temurin:25-jdk
MAINTAINER Apache HertzBeat "dev@hertzbeat.apache.org"
# Install SSH And Locales
RUN sed -i 's#http://#https://#g' /etc/apt/sources.list.d/ubuntu.sources && \
apt-get update && apt-get install -y openssh-server && apt-get install -y locales
RUN mkdir -p /var/run/sshd
# Build zh_CN en_US locale resource package
RUN localedef -c -f UTF-8 -i zh_CN zh_CN.UTF-8
RUN localedef -c -f UTF-8 -i en_US en_US.UTF-8
ENV TZ=Asia/Shanghai
ENV LANG=en_US.UTF-8
ADD apache-hertzbeat-1.*-docker-bin.tar.gz /opt/
EXPOSE 1157 1158 22
WORKDIR /opt/hertzbeat/
ENTRYPOINT ["./bin/entrypoint.sh"]
+28
View File
@@ -0,0 +1,28 @@
## Use the buildx to build Docker images that support multiple system architectures
> https://vuepress.mirror.docker-practice.com/buildx/multi-arch-images/
```shell
$ docker buildx create --use --name=mybuilder-cn --driver docker-container --driver-opt image=dockerpracticesig/buildkit:master
# for tencent environment
$ docker buildx create --use --name=mybuilder-cn --driver docker-container --driver-opt image=dockerpracticesig/buildkit:master-tencent
$ docker buildx create --use --name mybuilder --driver docker-container
$ docker buildx use mybuilder
```
#### Build the image
```shell
# Use the --platform flag to specify the target platforms for the build --push flag to push the image to a registry
$ docker buildx build --platform linux/arm64,linux/amd64 -t apache/hertzbeat:1.0.0 . --push
$ docker buildx build --platform linux/arm64,linux/amd64 -t quay.io/tancloud/hertzbeat:latest . --push
# Inspect the image info
$ docker buildx imagetools inspect apache/hertzbeat:1.0.0
```
+48
View File
@@ -0,0 +1,48 @@
#!/bin/sh
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
cd `dirname $0`
# current dir
CURRENT_DIR=`pwd`
# cd dist dir
cd ../../../dist
# auto detect hertzbeat version
VERSION=`ls apache-hertzbeat-*-docker-compose.tar.gz| awk -F"-" '{print $3}'`
# compile context dir
CONTEXT_DIR=`pwd`
COMMAND="docker buildx build --platform ${IMAGE_PLATFORM:-linux/arm64,linux/amd64} -t apache/hertzbeat:$VERSION -f $CURRENT_DIR/Dockerfile $CONTEXT_DIR --push=${IMAGE_PUSH:-true} --load=${IMAGE_LOAD:-false}"
#COMMAND="docker buildx build --platform linux/arm64,linux/amd64 -t apache/hertzbeat:latest -f $CURRENT_DIR/Dockerfile $CONTEXT_DIR --push"
#COMMAND="docker buildx build --platform linux/arm64,linux/amd64 -t quay.io/tancloud/hertzbeat:$VERSION -f $CURRENT_DIR/Dockerfile $CONTEXT_DIR --push"
#COMMAND="docker buildx build --platform linux/arm64,linux/amd64 -t quay.io/tancloud/hertzbeat:latest -f $CURRENT_DIR/Dockerfile $CONTEXT_DIR --push"
# Build Local
#COMMAND="docker build -t apache/hertzbeat:$VERSION -f $CURRENT_DIR/Dockerfile $CONTEXT_DIR "
#COMMAND="docker tag apache/hertzbeat:$VERSION apache/hertzbeat:${IMAGE_VERSION:-latest}"
echo "$COMMAND"
$COMMAND
#docker build -t apache/hertzbeat:latest -f $CURRENT_DIR/Dockerfile $CONTEXT_DIR
+29
View File
@@ -0,0 +1,29 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
Please move external libs to this folder only when you need JVM runtime extension, for example:
ojdbc8-21.5.0.0.jar
orai18n-21.5.0.0.jar
mysql-connector-java-8.0.30.jar
jcc-11.5.9.0.jar
Note:
- `ext-lib` is loaded by the JVM server package and the JVM collector package.
- MySQL, MariaDB, OceanBase, and TiDB SQL query metrics can use the built-in MySQL-compatible query engine without `mysql-connector-j`.
- If `mysql-connector-j` is present here, the JVM server package or JVM collector package prefers JDBC after restart.
- The native collector package does not support loading external JDBC driver jars from `ext-lib` at runtime.
- If you need Oracle or DB2 monitoring, or you explicitly want the JDBC path for MySQL-compatible monitoring, use the JVM collector package.
+90
View File
@@ -0,0 +1,90 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
$gpgKeyId = "********"
# ********************************************************
# Set version and release candidate number
$version = "1.7.3"
$rcNumber = "rc1"
# ********************************************************
$scriptPath = Split-Path -Parent $MyInvocation.MyCommand.Path
$projectPath = (Get-Item (Split-Path -Parent $scriptPath)).Parent.FullName
$distPath = "$projectPath\dist"
# Clean up the 'dist' directory
Write-Host "Cleaning up the 'dist' directory..."
Remove-Item -Recurse -Force $distPath\* -ErrorAction SilentlyContinue
New-Item -ItemType Directory -Path $distPath -Force
# Clean up the 'web-app/dist' directory
Write-Host "Cleaning up the 'web-app/dist' directory..."
$webAppDistPath = "$projectPath\web-app\dist"
Remove-Item -Recurse -Force $webAppDistPath\* -ErrorAction SilentlyContinue
New-Item -ItemType Directory -Path $webAppDistPath -Force
Push-Location -Path $projectPath
Write-Host "Installing dependencies and packaging web-app..."
Push-Location -Path "web-app"
yarn install
yarn package
Pop-Location
Write-Host "Building project with Maven..."
mvn clean package -Prelease -DskipTests
mvn clean install -DskipTests
Write-Host "Building collector..."
Push-Location -Path "collector"
mvn clean package -Pcluster -DskipTests
Pop-Location
# package release artifacts
Write-Host "Archiving source code..."
git archive --format=tar.gz --output="dist/apache-hertzbeat-$version-incubating-src.tar.gz" --prefix=apache-hertzbeat-$version-incubating-src/ release-$version-$rcNumber
# sign release artifacts
Write-Host "Signing release artifacts..."
Push-Location -Path "dist"
Get-ChildItem *.tar.gz | ForEach-Object {
$fileName = $_.Name
Write-Host "Signing $fileName..."
gpg -u $gpgKeyId --armor --output "$fileName.asc" --detach-sig "$fileName"
Write-Host "Generating SHA512 for $fileName..."
$hash = Get-FileHash -Path "$fileName" -Algorithm SHA512
$hashString = $hash.Hash
"$hashString $fileName" | Out-File "$fileName.sha512" -Append -NoNewline
}
Pop-Location
# verify signatures
Write-Host "Verifying signatures..."
Push-Location -Path "dist"
Get-ChildItem *.tar.gz | ForEach-Object {
$fileName = $_.Name
Write-Host "Verifying $fileName..."
gpg --verify "$fileName.asc" "$fileName"
Write-Host "Checking SHA512 for $fileName..."
$hash = Get-FileHash -Path "$fileName" -Algorithm SHA512
if ($hash.Hash -eq $null) {
Write-Host "Hash mismatch for $fileName"
} else {
Write-Host "Hash verified for $fileName"
}
}
Pop-Location
+124
View File
@@ -0,0 +1,124 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
## -- sureness.yml account source -- ##
# config the resource restful api that need auth protection, base rbac
# rule: api===method===role
# eg: /api/v1/source1===get===[admin] means /api/v2/host===post support role[admin] access.
# eg: /api/v1/source2===get===[] means /api/v1/source2===get can not access by any role.
resourceRole:
- /api/account/auth/refresh===post===[admin,user,guest]
- /api/apps/**===get===[admin,user,guest]
- /api/monitor/**===get===[admin,user,guest]
- /api/monitor/**===post===[admin,user]
- /api/monitor/**===put===[admin,user]
- /api/monitor/**===delete===[admin]
- /api/monitors/**===get===[admin,user,guest]
- /api/monitors/**===post===[admin,user]
- /api/monitors/**===put===[admin,user]
- /api/monitors/**===delete===[admin]
- /api/alert/**===get===[admin,user,guest]
- /api/alert/**===post===[admin,user]
- /api/alert/**===put===[admin,user]
- /api/alert/**===delete===[admin]
- /api/alerts/**===get===[admin,user,guest]
- /api/alerts/**===post===[admin,user]
- /api/alerts/**===put===[admin,user]
- /api/alerts/**===delete===[admin]
- /api/notice/**===get===[admin,user,guest]
- /api/notice/**===post===[admin,user]
- /api/notice/**===put===[admin,user]
- /api/notice/**===delete===[admin]
- /api/tag/**===get===[admin,user,guest]
- /api/tag/**===post===[admin,user]
- /api/tag/**===put===[admin,user]
- /api/tag/**===delete===[admin]
- /api/summary/**===get===[admin,user,guest]
- /api/summary/**===post===[admin,user]
- /api/summary/**===put===[admin,user]
- /api/summary/**===delete===[admin]
- /api/collector/**===get===[admin,user,guest]
- /api/collector/**===post===[admin,user]
- /api/collector/**===put===[admin,user]
- /api/collector/**===delete===[admin]
- /api/status/page/**===get===[admin,user,guest]
- /api/status/page/**===post===[admin,user]
- /api/status/page/**===put===[admin,user]
- /api/status/page/**===delete===[admin]
- /api/grafana/**===get===[admin,user,guest]
- /api/grafana/**===post===[admin,user]
- /api/grafana/**===put===[admin,user]
- /api/grafana/**===delete===[admin]
- /api/bulletin/**===get===[admin,user,guest]
- /api/bulletin/**===post===[admin,user]
- /api/bulletin/**===put===[admin,user]
- /api/bulletin/**===delete===[admin]
- /api/mcp/**===get===[admin]
- /api/mcp/**===post===[admin]
- /api/chat/**===get===[admin,user]
- /api/chat/**===post===[admin]
- /api/logs/ingest/**===post===[admin,user]
# config the resource restful api that need bypass auth protection
# rule: api===method
# eg: /api/v1/source3===get means /api/v1/source3===get can be access by anyone, no need auth.
excludedResource:
- /api/alert/sse/**===*
- /api/logs/sse/**===*
- /api/account/auth/**===*
- /api/i18n/**===get
- /api/apps/hierarchy===get
- /api/push/**===*
- /api/status/page/public/**===*
- /api/manager/sse/**===*
# web ui resource
- /===get
- /assets/**===get
- /dashboard/**===get
- /monitors/**===get
- /alert/**===get
- /account/**===get
- /setting/**===get
- /passport/**===get
- /status/**===get
- /log/**===get
- /**/*.html===get
- /**/*.js===get
- /**/*.css===get
- /**/*.ico===get
- /**/*.ttf===get
- /**/*.png===get
- /**/*.gif===get
- /**/*.jpg===get
- /**/*.svg===get
- /**/*.json===get
- /**/*.woff===get
- /**/*.eot===get
# swagger ui resource
- /swagger-resources/**===get
- /v2/api-docs===get
- /v3/api-docs===get
# h2 database
- /h2-console/**===*
# account info config refer the https://hertzbeat.apache.org/docs/start/account-modify
# 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]