修复部分问题
This commit is contained in:
parent
262309baef
commit
e04fbee8dc
|
|
@ -26,9 +26,13 @@ done
|
|||
# Get standard environment variables
|
||||
SW_ALARM_ALARM_SERVER_BIN_DIR=`dirname "$SW_ALARM_ALARM_SERVER_BIN"`
|
||||
SW_ALARM_ALARM_PREFIX="${SW_ALARM_ALARM_SERVER_BIN_DIR}/.."
|
||||
SW_ALARM_ALARM_LOG_DIR="${SW_ALARM_ALARM_SERVER_BIN_DIR}/../log"
|
||||
SW_ALARM_ALARM_LOG_DIR="${SW_ALARM_ALARM_SERVER_BIN_DIR}/../logs"
|
||||
SW_ALARM_ALARM_CFG_DIR="${SW_ALARM_ALARM_SERVER_BIN_DIR}/../config"
|
||||
|
||||
if [ ! -d "${SW_ALARM_ALARM_LOG_DIR}" ]; then
|
||||
mkdir -p ${SW_ALARM_ALARM_LOG_DIR}
|
||||
fi
|
||||
|
||||
#echo $SW_ALARM_ALARM_SERVER_BIN_DIR
|
||||
#set java home
|
||||
if [ "$JAVA_HOME" != "" ]; then
|
||||
|
|
|
|||
|
|
@ -10,10 +10,6 @@
|
|||
<name>skywalking-alarm</name>
|
||||
<url>http://maven.apache.org</url>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
|
|
@ -73,63 +69,26 @@
|
|||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<finalName>skywalking-alarm</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>2.6</version>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>copy-resources</id>
|
||||
<id>make-zip</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>copy-resources</goal>
|
||||
<goal>single</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${project.build.directory}/installer/config</outputDirectory>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<filtering>false</filtering>
|
||||
</resource>
|
||||
</resources>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>copy-start-script</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>copy-resources</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${project.build.directory}/installer/bin</outputDirectory>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>bin</directory>
|
||||
<filtering>false</filtering>
|
||||
</resource>
|
||||
</resources>
|
||||
<descriptors>
|
||||
<descriptor>src/main/assembly/assembly.xml</descriptor>
|
||||
</descriptors>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>copy-dependencies</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>copy-dependencies</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<outputDirectory>${project.build.directory}/installer/lib</outputDirectory>
|
||||
<excludeTransitive>false</excludeTransitive>
|
||||
<stripVersion>true</stripVersion>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<configuration>
|
||||
|
|
@ -137,76 +96,8 @@
|
|||
<exclude>*.properties</exclude>
|
||||
<exclude>*.xml</exclude>
|
||||
</excludes>
|
||||
<outputDirectory>${project.build.directory}/installer/lib</outputDirectory>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-antrun-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>clean</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>run</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<tasks>
|
||||
<mkdir dir="${project.build.directory}/installer/log" />
|
||||
<mkdir dir="${project.build.directory}/installer/bin" />
|
||||
</tasks>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<source>1.7</source>
|
||||
<target>1.7</target>
|
||||
<encoding>${project.build.sourceEncoding}</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>2.4.3</version>
|
||||
<configuration>
|
||||
<encoding>${project.build.sourceEncoding}</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<snapshots>
|
||||
<enabled>false</enabled>
|
||||
</snapshots>
|
||||
<id>bintray-wu-sheng-DataCarrier</id>
|
||||
<name>bintray</name>
|
||||
<url>http://dl.bintray.com/wu-sheng/DataCarrier</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>mvnrepository</id>
|
||||
<name>mvnrepository</name>
|
||||
<url>http://mvnrepository.com</url>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
<snapshots>
|
||||
<enabled>true</enabled>
|
||||
</snapshots>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>jbossrepository</id>
|
||||
<name>jboss repository</name>
|
||||
<url>http://repository.jboss.com</url>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
<snapshots>
|
||||
<enabled>true</enabled>
|
||||
</snapshots>
|
||||
</repository>
|
||||
</repositories>
|
||||
</project>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,36 @@
|
|||
<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>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>sw-alarm-server.sh</include>
|
||||
</includes>
|
||||
<fileMode>0755</fileMode>
|
||||
</fileSet>
|
||||
<fileSet>
|
||||
<directory>src/main/resources</directory>
|
||||
<outputDirectory>/config</outputDirectory>
|
||||
</fileSet>
|
||||
<fileSet>
|
||||
<directory>${project.build.directory}/${build.finalName}</directory>
|
||||
<outputDirectory>/libs</outputDirectory>
|
||||
<includes>
|
||||
<include>${build.finalName}.jar</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
</fileSets>
|
||||
</assembly>
|
||||
|
|
@ -147,7 +147,6 @@ public class AlarmMessageProcessThread extends Thread {
|
|||
|
||||
private class CoordinatorStatusWatcher implements CuratorWatcher {
|
||||
|
||||
@Override
|
||||
public void process(WatchedEvent watchedEvent) throws Exception {
|
||||
if (watchedEvent.getType() == Watcher.Event.EventType.NodeDataChanged) {
|
||||
String value = ZKUtil.getPathData(Config.ZKPath.REGISTER_SERVER_PATH + "/" + threadId);
|
||||
|
|
|
|||
|
|
@ -223,8 +223,6 @@ public class UserInfoCoordinator extends Thread {
|
|||
}
|
||||
|
||||
public class RegisterServerWatcher implements CuratorWatcher {
|
||||
|
||||
@Override
|
||||
public void process(WatchedEvent watchedEvent) {
|
||||
if (watchedEvent.getType() == Watcher.Event.EventType.NodeChildrenChanged) {
|
||||
redistributing = true;
|
||||
|
|
|
|||
|
|
@ -1,41 +0,0 @@
|
|||
package com.a.eye.skywalking.alarm.dao;
|
||||
|
||||
import com.a.eye.skywalking.alarm.util.DBConnectUtil;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class SystemConfigDao {
|
||||
private static Logger logger = LogManager.getLogger(AlarmMessageDao.class);
|
||||
|
||||
public static String getSystemConfig(String configId) throws SQLException {
|
||||
|
||||
String result = "";
|
||||
Connection connection = DBConnectUtil.getConnection();
|
||||
|
||||
try {
|
||||
PreparedStatement ps = connection.prepareStatement(
|
||||
"SELECT system_config.conf_value FROM system_config WHERE system_config.sts = " +
|
||||
"? AND system_config.config_id = ?");
|
||||
ps.setString(1, "A");
|
||||
ps.setString(2, configId);
|
||||
|
||||
ResultSet resultSet = ps.executeQuery();
|
||||
resultSet.next();
|
||||
|
||||
result = resultSet.getString("conf_value");
|
||||
} catch (Exception e) {
|
||||
logger.error("Failed to find systemConfig.");
|
||||
throw e;
|
||||
} finally {
|
||||
if(connection != null) {
|
||||
connection.close();
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
@ -81,7 +81,6 @@ public class AlarmRule {
|
|||
|
||||
private static long getPreviousFireTime(final String userId, final String ruleId) {
|
||||
return RedisUtil.execute(new RedisUtil.Executable<Long>() {
|
||||
@Override
|
||||
public Long exe(Jedis client) {
|
||||
String previousTime = client.get(userId + "-" + ruleId);
|
||||
if (previousTime == null || previousTime.length() <= 0) {
|
||||
|
|
|
|||
|
|
@ -156,7 +156,6 @@ public class AlarmMessageProcessor {
|
|||
|
||||
private void expiredAlarmMessage(final String key) {
|
||||
RedisUtil.execute(new RedisUtil.Executable<Long>() {
|
||||
@Override
|
||||
public Long exe(Jedis client) {
|
||||
return client.expire(key, 0);
|
||||
}
|
||||
|
|
@ -166,7 +165,6 @@ public class AlarmMessageProcessor {
|
|||
private void savePreviousFireTime(final String userId, final String ruleId,
|
||||
final long currentFireMinuteTime) {
|
||||
RedisUtil.execute(new RedisUtil.Executable<Long>() {
|
||||
@Override
|
||||
public Long exe(Jedis client) {
|
||||
return client.hset(userId, ruleId,
|
||||
String.valueOf(currentFireMinuteTime));
|
||||
|
|
@ -177,7 +175,6 @@ public class AlarmMessageProcessor {
|
|||
private void setAlarmMessages(final String key,
|
||||
final Collection<AlarmMessage> warningTracingIds) {
|
||||
RedisUtil.execute(new RedisUtil.Executable<Object>() {
|
||||
@Override
|
||||
public Collection<String> exe(Jedis client) {
|
||||
Map<String, String> result = client.hgetAll(key);
|
||||
if (result != null) {
|
||||
|
|
|
|||
|
|
@ -1,33 +1,20 @@
|
|||
package com.a.eye.skywalking.alarm.util;
|
||||
|
||||
import com.a.eye.skywalking.alarm.model.AlarmType;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class AlarmTypeUtil {
|
||||
|
||||
private static Logger logger = LogManager.getLogger(AlarmTypeUtil.class);
|
||||
private static List<AlarmType> alarmTypeList;
|
||||
|
||||
static {
|
||||
try {
|
||||
alarmTypeList = new ArrayList<AlarmType>();
|
||||
alarmTypeList.add(new AlarmType("default", "exception", "System Exception"));
|
||||
alarmTypeList.add(new AlarmType("ExecuteTime-PossibleError", "remark", "Excution Time > 5s"));
|
||||
alarmTypeList.add(new AlarmType("ExecuteTime-Warning", "remark", "Excution Time > 500ms"));
|
||||
} catch (Exception e) {
|
||||
logger.error("Failed to load alarm type info.", e);
|
||||
System.exit(-1);
|
||||
}
|
||||
}
|
||||
|
||||
public static List<AlarmType> getAlarmTypeList() {
|
||||
|
||||
if (alarmTypeList == null || alarmTypeList.isEmpty()) {
|
||||
alarmTypeList = new ArrayList<AlarmType>();
|
||||
alarmTypeList.add(new AlarmType("default", "exception", "System Exception"));
|
||||
alarmTypeList.add(new AlarmType("ExecuteTime-PossibleError", "remark", "Excution Time > 5s"));
|
||||
alarmTypeList.add(new AlarmType("ExecuteTime-Warning", "remark", "Excution Time > 500ms"));
|
||||
}
|
||||
|
||||
return alarmTypeList;
|
||||
|
|
|
|||
|
|
@ -58,6 +58,6 @@ public class RedisUtil {
|
|||
}
|
||||
|
||||
public interface Executable<R> {
|
||||
public R exe(Jedis client);
|
||||
R exe(Jedis client);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ import java.io.IOException;
|
|||
import java.sql.SQLException;
|
||||
|
||||
import com.a.eye.skywalking.alarm.conf.Config;
|
||||
import com.a.eye.skywalking.alarm.dao.SystemConfigDao;
|
||||
|
||||
import freemarker.template.Configuration;
|
||||
import freemarker.template.TemplateModelException;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,27 @@
|
|||
#!/bin/sh
|
||||
|
||||
ROUTING_HOME=`dirname "$0"`/..
|
||||
ROUTING_CFG_DIR="${ROUTING_HOME}/config"
|
||||
ROUTING_LOG_DIR="${ROUTING_HOME}/logs"
|
||||
|
||||
if [ "$JAVA_HOME" != "" ]; then
|
||||
JAVA="$JAVA_HOME/bin/java"
|
||||
else
|
||||
JAVA=java
|
||||
fi
|
||||
|
||||
if [ ! -d "${ROUTING_LOG_DIR}" ]; then
|
||||
mkdir -p ${ROUTING_LOG_DIR}
|
||||
fi
|
||||
|
||||
CLASSPATH="$ROUTING_CFG_DIR:$CLASSPATH"
|
||||
|
||||
for i in "${ROUTING_HOME}"/libs/*.jar
|
||||
do
|
||||
CLASSPATH="$i:$CLASSPATH"
|
||||
done
|
||||
|
||||
echo "CLASSPATH=$CLASSPATH"
|
||||
|
||||
|
||||
$JAVA ${JAVA_OPTS} -classpath $CLASSPATH com.a.eye.skywalking.routing.Main >> ${ROUTING_HOME}/logs/routing-server.log 2>&1&
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>skywalking-storage-center</artifactId>
|
||||
|
|
@ -18,13 +19,6 @@
|
|||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.curator</groupId>
|
||||
<artifactId>curator-test</artifactId>
|
||||
<version>3.2.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>redis.clients</groupId>
|
||||
<artifactId>jedis</artifactId>
|
||||
|
|
@ -37,4 +31,39 @@
|
|||
<version>2.0-2016</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>skywalking-routing</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>2.3.2</version>
|
||||
<configuration>
|
||||
<excludes>
|
||||
<exclude>*.properties</exclude>
|
||||
<exclude>*.xml</exclude>
|
||||
</excludes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>make-zip</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,36 @@
|
|||
<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>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>routingServer.sh</include>
|
||||
</includes>
|
||||
<fileMode>0755</fileMode>
|
||||
</fileSet>
|
||||
<fileSet>
|
||||
<directory>src/main/resources</directory>
|
||||
<outputDirectory>/config</outputDirectory>
|
||||
</fileSet>
|
||||
<fileSet>
|
||||
<directory>${project.build.directory}/${build.finalName}</directory>
|
||||
<outputDirectory>/libs</outputDirectory>
|
||||
<includes>
|
||||
<include>${build.finalName}.jar</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
</fileSets>
|
||||
</assembly>
|
||||
|
|
@ -47,7 +47,7 @@ public class Main {
|
|||
Properties properties = new Properties();
|
||||
try {
|
||||
properties.load(Main.class.getResourceAsStream("/config.properties"));
|
||||
printStorageConfig(properties);
|
||||
printRoutingConfig(properties);
|
||||
ConfigInitializer.initialize(properties, Config.class);
|
||||
} catch (IllegalAccessException e) {
|
||||
logger.error("Initialize server configuration failure.", e);
|
||||
|
|
@ -58,7 +58,7 @@ public class Main {
|
|||
}
|
||||
}
|
||||
|
||||
private static void printStorageConfig(Properties config) {
|
||||
private static void printRoutingConfig(Properties config) {
|
||||
for (Map.Entry<Object, Object> entry : config.entrySet()) {
|
||||
logger.info("{} = {}", entry.getKey(), entry.getValue());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.a.eye.skywalking.routing.alarm.sender;
|
|||
import com.a.eye.skywalking.logging.api.ILog;
|
||||
import com.a.eye.skywalking.logging.api.LogManager;
|
||||
import com.a.eye.skywalking.routing.config.Config;
|
||||
|
||||
import redis.clients.jedis.Jedis;
|
||||
|
||||
/**
|
||||
|
|
@ -16,6 +17,8 @@ public class AlarmMessageSender {
|
|||
Jedis jedis = null;
|
||||
try {
|
||||
jedis = AlarmRedisConnector.getJedis();
|
||||
if (jedis != null)
|
||||
return;
|
||||
jedis.hsetnx(alarmKey, traceId, message);
|
||||
jedis.expire(alarmKey, Config.Alarm.ALARM_EXPIRE_SECONDS);
|
||||
} catch (Exception e) {
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ public class Config {
|
|||
|
||||
public static String REDIS_SERVER = "127.0.0.1:6379";
|
||||
|
||||
public static boolean ALARM_OFF_FLAG = false;
|
||||
public static boolean ALARM_OFF_FLAG = true;
|
||||
|
||||
public static int ALARM_EXCEPTION_STACK_LENGTH = 300;
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,38 @@
|
|||
# the port which routing server listening
|
||||
server.port=23000
|
||||
#
|
||||
#search.check_cycle=100
|
||||
#
|
||||
#search.timeout=3000
|
||||
# the type of registry center (default: zookeeper)
|
||||
#registrycenter.type=zookeeper
|
||||
# the connect url that registry center
|
||||
registrycenter.connect_url=127.0.0.1:2181
|
||||
# auth schema that registry center
|
||||
#registrycenter.auth_schema=
|
||||
# the auth info that registry center
|
||||
#registrycenter.auth_info=
|
||||
#
|
||||
#registrycenter.path_prefix=/skywalking/routing_list/
|
||||
#
|
||||
#storagenode.subscribe_path=/skywalking/storage_list
|
||||
#
|
||||
#disruptor.buffer_size=524288
|
||||
#
|
||||
#disruptor.flush_size=100
|
||||
# the connect url for alarm
|
||||
alarm.redis_server=127.0.0.1:6379
|
||||
#
|
||||
#alarm.alarm_off_flag=true
|
||||
#
|
||||
#alarm.alarm_exception_stack_length=300
|
||||
#
|
||||
#alarm.alarm_redis_inspector_interval=100
|
||||
#
|
||||
#alarm.redis_max_idle=10
|
||||
#
|
||||
#alarm.redis_min_idle=1
|
||||
#
|
||||
#alarm.redis_max_total=30
|
||||
#
|
||||
#alarm.alarm_expire_seconds=3600000
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
# logger #
|
||||
log4j.rootLogger=ERROR,Rolling_File,CONSOLE
|
||||
log4j.rootLogger=INFO,Rolling_File,CONSOLE
|
||||
log4j.logger.org.apache=OFF
|
||||
log4j.logger.io.netty=OFF
|
||||
log4j.org.elasticsearch=OFF
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ STORAGE_SERVER_BIN="$0"
|
|||
# Get standard environment variables
|
||||
STORAGE_SERVER_BIN_DIR=`dirname "$STORAGE_SERVER_BIN"`
|
||||
STORAGE_PREFIX="${STORAGE_SERVER_BIN_DIR}/.."
|
||||
STORAGE_LOG_DIR="${STORAGE_SERVER_BIN_DIR}/../log"
|
||||
STORAGE_LOG_DIR="${STORAGE_SERVER_BIN_DIR}/../logs"
|
||||
STORAGE_CFG_DIR="${STORAGE_SERVER_BIN_DIR}/../config"
|
||||
|
||||
#echo $STORAGE_SERVER_BIN_DIR
|
||||
|
|
@ -15,6 +15,10 @@ else
|
|||
JAVA=java
|
||||
fi
|
||||
|
||||
if [ ! -d "${STORAGE_LOG_DIR}" ]; then
|
||||
mkdir -p "${STORAGE_LOG_DIR}"
|
||||
fi
|
||||
|
||||
CLASSPATH="$STORAGE_CFG_DIR:$CLASSPATH"
|
||||
|
||||
for i in "${STORAGE_SERVER_BIN_DIR}"/../lib/*.jar
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
|
|
@ -40,75 +41,26 @@
|
|||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>skywalking-storage</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.6.0</version>
|
||||
<configuration>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
<encoding>${project.build.sourceEncoding}</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>2.6</version>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>copy-resources</id>
|
||||
<id>make-zip</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>copy-resources</goal>
|
||||
<goal>single</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${project.build.directory}/install/config</outputDirectory>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<filtering>false</filtering>
|
||||
</resource>
|
||||
</resources>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>copy-start-script</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>copy-resources</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${project.build.directory}/install/bin</outputDirectory>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>bin</directory>
|
||||
<filtering>false</filtering>
|
||||
</resource>
|
||||
</resources>
|
||||
<descriptors>
|
||||
<descriptor>src/main/assembly/assembly.xml</descriptor>
|
||||
</descriptors>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>copy-dependencies</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>copy-dependencies</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<outputDirectory>${project.build.directory}/install/lib</outputDirectory>
|
||||
<excludeTransitive>false</excludeTransitive>
|
||||
<stripVersion>true</stripVersion>
|
||||
<includeScope>runtime</includeScope>
|
||||
<includeScope>compile</includeScope>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<configuration>
|
||||
|
|
@ -116,7 +68,6 @@
|
|||
<exclude>*.properties</exclude>
|
||||
<exclude>*.xml</exclude>
|
||||
</excludes>
|
||||
<outputDirectory>${project.build.directory}/install/lib</outputDirectory>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
|
|
@ -129,15 +80,11 @@
|
|||
<phase>compile</phase>
|
||||
<configuration>
|
||||
<target>
|
||||
<mkdir dir="${project.build.directory}/install/bin"/>
|
||||
<mkdir dir="${project.build.directory}/install/lib"/>
|
||||
<mkdir dir="${project.build.directory}/install/logs"/>
|
||||
<mkdir dir="${project.build.directory}/install/bin"/>
|
||||
<mkdir dir="${project.build.directory}/install/data/index"/>
|
||||
<echo message="unzip elastic"/>
|
||||
<unzip src="${project.basedir}/lib/dataindex-es-5.0.1.zip"
|
||||
dest="${project.build.directory}/install/data/index"/>
|
||||
<chmod dir="${project.build.directory}/install/data/index/bin" perm="ugo+rx"
|
||||
dest="${project.build.directory}/${build.finalName}/data/index"/>
|
||||
<chmod dir="${project.build.directory}/${build.finalName}/data/index/bin"
|
||||
perm="ugo+rx"
|
||||
includes="*"/>
|
||||
</target>
|
||||
</configuration>
|
||||
|
|
@ -150,22 +97,7 @@
|
|||
<phase>pre-clean</phase>
|
||||
<configuration>
|
||||
<target>
|
||||
<delete dir="${project.build.directory}/install/data/index"/>
|
||||
</target>
|
||||
</configuration>
|
||||
<goals>
|
||||
<goal>run</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>tar</id>
|
||||
<phase>package</phase>
|
||||
<configuration>
|
||||
<target>
|
||||
<chmod dir="${project.build.directory}/install/bin" perm="ugo+rx"
|
||||
includes="*"/>
|
||||
<tar destfile="${project.build.directory}/install.tar" basedir="${project.build.directory}/install">
|
||||
</tar>
|
||||
<delete dir="${project.build.directory}/${build.finalName}/data/index"/>
|
||||
</target>
|
||||
</configuration>
|
||||
<goals>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,34 @@
|
|||
<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>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>storageServer.sh</include>
|
||||
</includes>
|
||||
<fileMode>0755</fileMode>
|
||||
</fileSet>
|
||||
<fileSet>
|
||||
<directory>src/main/resources</directory>
|
||||
<outputDirectory>/config</outputDirectory>
|
||||
</fileSet>
|
||||
<fileSet>
|
||||
<directory>${project.build.directory}/${build.finalName}/data/index</directory>
|
||||
<outputDirectory>/data/index</outputDirectory>
|
||||
<fileMode>0755</fileMode>
|
||||
</fileSet>
|
||||
</fileSets>
|
||||
</assembly>
|
||||
|
|
@ -15,7 +15,7 @@ public class ElasticBootstrap {
|
|||
private static ILog logger = LogManager.getLogger(ElasticBootstrap.class);
|
||||
public static final String DATA_INDEX_HOME = "DATA_INDEX_HOME";
|
||||
private static final String DEVELOP_RUNTIME_ELASTIC_HOME =
|
||||
ElasticBootstrap.class.getResource("/").getPath() + ".." + File.separator + "install" + File.separator + "data"
|
||||
ElasticBootstrap.class.getResource("/").getPath() + ".." + File.separator + "skywalking-storage" + File.separator + "data"
|
||||
+ File.separator + "index";
|
||||
private String elasticHome;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue