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
@@ -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"