Merge pull request #128 from ascrutae/zhangxin/collector-packaging
support package of project
This commit is contained in:
commit
83833f0495
|
|
@ -0,0 +1,20 @@
|
|||
@echo off
|
||||
|
||||
setlocal
|
||||
set COLLECOTR_PROCESS_TITLE=Skywalking-Collector
|
||||
set COLLECTOR_BASE_PATH=%~dp0%..
|
||||
set COLLECTOR_RUNTIME_OPTIONS="-Xms256M -Xmx512M"
|
||||
|
||||
set CLASSPATH=%COLLECTOR_BASE_PATH%\config;
|
||||
SET CLASSPATH=%COLLECTOR_BASE_PATH%\libs\*;%CLASSPATH%
|
||||
|
||||
if ""%JAVA_HOME%"" == """" (
|
||||
set _EXECJAVA=java
|
||||
) else (
|
||||
set _EXECJAVA="%JAVA_HOME%"/bin/java
|
||||
)
|
||||
|
||||
start /MIN "%COLLECOTR_PROCESS_TITLE%" %_EXECJAVA% "%COLLECTOR_RUNTIME_OPTIONS%" -cp "%CLASSPATH%" com.a.eye.skywalking.collector.worker.CollectorBootStartUp &
|
||||
echo Collector started successfully!
|
||||
|
||||
endlocal
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
PRG="$0"
|
||||
PRGDIR=`dirname "$PRG"`
|
||||
[ -z "$COLLECTOR_HOME" ] && COLLECTOR_HOME=`cd "$PRGDIR/.." >/dev/null; pwd`
|
||||
|
||||
COLLECTOR_LOGS_DIR="${COLLECTOR_HOME}/logs"
|
||||
JAVA_OPTS=" -Xms256M -Xmx512M"
|
||||
|
||||
if [ ! -d "${COLLECTOR_HOME}/logs" ]; then
|
||||
mkdir -p "${COLLECTOR_LOGS_DIR}"
|
||||
fi
|
||||
|
||||
_RUNJAVA=${JAVA_HOME}/bin/java
|
||||
[ -z "$JAVA_HOME" ] && _RUNJAVA=`java`
|
||||
|
||||
CLASSPATH="$COLLECTOR_HOME/config:$CLASSPATH"
|
||||
for i in "$COLLECTOR_HOME"/libs/*.jar
|
||||
do
|
||||
CLASSPATH="$i:$CLASSPATH"
|
||||
done
|
||||
|
||||
echo "Starting collector...."
|
||||
eval exec "\"$_RUNJAVA\" ${JAVA_OPTS} -classpath $CLASSPATH com.a.eye.skywalking.collector.worker.CollectorBootStartUp \
|
||||
2>${COLLECTOR_LOGS_DIR}/collector.log 1> /dev/null &"
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
sleep 1
|
||||
echo "Collector started successfully!"
|
||||
else
|
||||
echo "Collector started failure!"
|
||||
exit 1
|
||||
fi
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
@echo off
|
||||
|
||||
setlocal
|
||||
call "%~dp0"\collector-service.bat start
|
||||
endlocal
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
PRG="$0"
|
||||
PRGDIR=`dirname "$PRG"`
|
||||
EXECUTABLE=collector-service.sh
|
||||
|
||||
exec "$PRGDIR"/"$EXECUTABLE" start
|
||||
|
|
@ -14,6 +14,7 @@
|
|||
|
||||
<properties>
|
||||
<jetty.version>9.4.2.v20170220</jetty.version>
|
||||
<main.class>com.a.eye.skywalking.collector.worker.CollectorBootStartUp</main.class>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
|
@ -54,4 +55,44 @@
|
|||
<version>RELEASE</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>skywalking-collector</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>2.3.2</version>
|
||||
<configuration>
|
||||
<excludes>
|
||||
<exclude>*.xml</exclude>
|
||||
<exclude>*.config</exclude>
|
||||
</excludes>
|
||||
<archive>
|
||||
<manifest>
|
||||
<mainClass>${main.class}</mainClass>
|
||||
</manifest>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>assembly</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>single</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<descriptors>
|
||||
<descriptor>src/main/assembly/assembly.xml</descriptor>
|
||||
</descriptors>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,42 @@
|
|||
<assembly
|
||||
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
|
||||
<id></id>
|
||||
<formats>
|
||||
<format>tar.gz</format>
|
||||
<format>zip</format>
|
||||
</formats>
|
||||
<dependencySets>
|
||||
<dependencySet>
|
||||
<outputDirectory>/libs</outputDirectory>
|
||||
<scope>runtime</scope>
|
||||
</dependencySet>
|
||||
</dependencySets>
|
||||
<fileSets>
|
||||
<fileSet>
|
||||
<directory>${project.basedir}/bin</directory>
|
||||
<outputDirectory>/bin</outputDirectory>
|
||||
<includes>
|
||||
<include>*.sh</include>
|
||||
<include>*.bat</include>
|
||||
</includes>
|
||||
<fileMode>0755</fileMode>
|
||||
</fileSet>
|
||||
<fileSet>
|
||||
<directory>src/main/resources</directory>
|
||||
<includes>
|
||||
<include>collector.config</include>
|
||||
<include>log4j2.xml</include>
|
||||
</includes>
|
||||
<outputDirectory>/config</outputDirectory>
|
||||
</fileSet>
|
||||
<fileSet>
|
||||
<directory>${project.build.directory}</directory>
|
||||
<outputDirectory>/libs</outputDirectory>
|
||||
<includes>
|
||||
<include>${build.finalName}.jar</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
</fileSets>
|
||||
</assembly>
|
||||
|
|
@ -1,19 +1,26 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Configuration status="info">
|
||||
<Configuration status="DEBUG">
|
||||
<Properties>
|
||||
<Property name="log-path">../logs</Property>
|
||||
</Properties>
|
||||
<Appenders>
|
||||
<Console name="Console" target="SYSTEM_OUT">
|
||||
<PatternLayout charset="UTF-8" pattern="[%d{yyyy-MM-dd HH:mm:ss:SSS}] [%p] - %c{1} - %m%n"/>
|
||||
</Console>
|
||||
<RollingFile name="RollingFile" fileName="${log-path}/skywalking-server-log4j2.log"
|
||||
filePattern="${log-path}/skywalking-server-log4j2-%d{yyyy-MM-dd}-%i.log" >
|
||||
<PatternLayout>
|
||||
<pattern>%d - %c -%-4r [%t] %-5p %x - %m%n</pattern>
|
||||
</PatternLayout>
|
||||
<Policies>
|
||||
<SizeBasedTriggeringPolicy size="102400KB" />
|
||||
</Policies>
|
||||
<DefaultRolloverStrategy max="30"/>
|
||||
</RollingFile>
|
||||
</Appenders>
|
||||
<Loggers>
|
||||
<logger name="org.elasticsearch" level="info" additivity="false">
|
||||
<AppenderRef ref="Console"/>
|
||||
</logger>
|
||||
<logger name="com.a.eye.skywalking.collector.worker" level="debug" additivity="false">
|
||||
<AppenderRef ref="Console"/>
|
||||
</logger>
|
||||
<Root level="info">
|
||||
<AppenderRef ref="Console"/>
|
||||
<Logger name="root" level="INFO" additivity="false">
|
||||
<appender-ref ref="RollingFile" level="INFO"/>
|
||||
</Logger>
|
||||
<Root level="INFO" additivity="false">
|
||||
<AppenderRef ref="RollingFile"/>
|
||||
</Root>
|
||||
</Loggers>
|
||||
</Configuration>
|
||||
</Configuration>
|
||||
Loading…
Reference in New Issue