mirror of https://github.com/apache/iotdb
prepare to merge origin
This commit is contained in:
parent
efeee4d97c
commit
250ed54fc6
|
@ -0,0 +1,40 @@
|
|||
#!/bin/sh
|
||||
|
||||
mvn clean package -DskipTests
|
||||
|
||||
if [ -d "./tsfiledb/lib/" ]; then
|
||||
rm -r ./tsfiledb/lib/
|
||||
fi
|
||||
|
||||
if [ -d "./tsfiledb/doc/" ]; then
|
||||
rm -r ./tsfiledb/doc/
|
||||
fi
|
||||
|
||||
if [ -d "./tsfiledb/tmp/" ]; then
|
||||
rm -r ./tsfiledb/tmp/
|
||||
fi
|
||||
|
||||
if [ -d "./tsfiledb/logs/" ]; then
|
||||
rm -r ./tsfiledb/logs/
|
||||
fi
|
||||
|
||||
if [ -f "./tsfiledb/conf/tsfile.yaml" ]; then
|
||||
rm ./tsfiledb/conf/tsfile.yaml
|
||||
fi
|
||||
|
||||
if [ -f "./tsfiledb.tar.gz" ]; then
|
||||
rm ./tsfiledb.tar.gz
|
||||
fi
|
||||
|
||||
mkdir ./tsfiledb/lib/
|
||||
mkdir ./tsfiledb/doc/
|
||||
mkdir ./tsfiledb/tmp/
|
||||
mkdir ./tsfiledb/logs/
|
||||
|
||||
#cp ./tsfile-service/target/lib/* ./delta/lib/
|
||||
#cp ./tsfile-service/target/tsfile-service-0.0.1-SNAPSHOT.jar ./delta/lib/
|
||||
#cp ./tsfile-jdbc/target/lib/* ./delta/lib/
|
||||
#cp ./tsfile-jdbc/target/tsfile-jdbc-0.0.1-SNAPSHOT.jar ./delta/lib/
|
||||
#cp ./tsfile-common/src/main/resources/tsfile.yaml ./delta/conf/
|
||||
|
||||
tar -zcf ./tsfiledb.tar.gz ./tsfiledb/
|
46
pom.xml
46
pom.xml
|
@ -91,7 +91,51 @@
|
|||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>2.6</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<version>2.10</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>copy-dependencies</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>copy-dependencies</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${project.basedir}/tsfiledb/lib</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-antrun-plugin</artifactId>
|
||||
<version>1.7</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>copy-native-libraries</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>run</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<target>
|
||||
<copy todir="${project.basedir}/tsfiledb/lib">
|
||||
<fileset dir="${project.basedir}/target/">
|
||||
<include name="*.jar" />
|
||||
</fileset>
|
||||
</copy>
|
||||
</target>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<!-- <plugin>
|
||||
<groupId>org.antlr</groupId>
|
||||
<artifactId>antlr4-maven-plugin</artifactId>
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
使用方法:
|
||||
|
||||
在conf/tsfile-env.sh中设置JAVA_HOME
|
||||
|
||||
启动服务器:运行bin下面的start-server.sh
|
||||
|
||||
启动客户端:运行bin下面的start-client.sh -host127.0.0.1 -port6667 -uroot
|
|
@ -0,0 +1,35 @@
|
|||
#!/bin/sh
|
||||
if [ $# -lt 3 ] ; then
|
||||
echo "Arguments : -host<host> -port<port> -u<username>"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ -z "${TSFILE_HOME}" ]; then
|
||||
export TSFILE_HOME="$(cd "`dirname "$0"`"/..; pwd)"
|
||||
fi
|
||||
|
||||
|
||||
MAIN_CLASS=cn.edu.thu.tsfiledb.jdbc.Client
|
||||
|
||||
|
||||
CLASSPATH=""
|
||||
for f in ${TSFILE_HOME}/lib/*.jar; do
|
||||
CLASSPATH=${CLASSPATH}":"$f
|
||||
done
|
||||
|
||||
|
||||
if [ -n "$JAVA_HOME" ]; then
|
||||
for java in "$JAVA_HOME"/bin/amd64/java "$JAVA_HOME"/bin/java; do
|
||||
if [ -x "$java" ]; then
|
||||
JAVA="$java"
|
||||
break
|
||||
fi
|
||||
done
|
||||
else
|
||||
JAVA=java
|
||||
fi
|
||||
|
||||
|
||||
exec "$JAVA" -cp "$CLASSPATH" "$MAIN_CLASS" "$1" "$2" "$3"
|
||||
|
||||
exit $?
|
|
@ -0,0 +1,7 @@
|
|||
#!/bin/sh
|
||||
|
||||
if [ -z "${TSFILE_HOME}" ]; then
|
||||
export TSFILE_HOME="$(cd "`dirname "$0"`"/..; pwd)"
|
||||
fi
|
||||
|
||||
"$TSFILE_HOME"/bin/tsfiledb-deamon.sh start
|
|
@ -0,0 +1,7 @@
|
|||
#!/bin/sh
|
||||
|
||||
if [ -z "${TSFILE_HOME}" ]; then
|
||||
export TSFILE_HOME="$(cd "`dirname "$0"`"/..; pwd)"
|
||||
fi
|
||||
|
||||
"$TSFILE_HOME"/bin/tsfiledb-deamon.sh stop
|
|
@ -0,0 +1,89 @@
|
|||
#!/bin/sh
|
||||
|
||||
if [ -z "${TSFILE_HOME}" ]; then
|
||||
export TSFILE_HOME="$(cd "`dirname "$0"`"/..; pwd)"
|
||||
fi
|
||||
|
||||
|
||||
TSFILE_CONF=${TSFILE_HOME}/conf
|
||||
TSFILE_LOGS=${TSFILE_HOME}/logs
|
||||
|
||||
|
||||
if [ -f "$TSFILE_CONF/tsfile-env.sh" ]; then
|
||||
. "$TSFILE_CONF/tsfile-env.sh"
|
||||
else
|
||||
echo "can't find $TSFILE_CONF/tsfile-env.sh"
|
||||
fi
|
||||
|
||||
|
||||
if [ -n "$JAVA_HOME" ]; then
|
||||
for java in "$JAVA_HOME"/bin/amd64/java "$JAVA_HOME"/bin/java; do
|
||||
if [ -x "$java" ]; then
|
||||
JAVA="$java"
|
||||
break
|
||||
fi
|
||||
done
|
||||
else
|
||||
JAVA=java
|
||||
fi
|
||||
|
||||
if [ -z $JAVA ] ; then
|
||||
echo Unable to find java executable. Check JAVA_HOME and PATH environment variables. > /dev/stderr
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
CLASSPATH=""
|
||||
for f in ${TSFILE_HOME}/lib/*.jar; do
|
||||
CLASSPATH=${CLASSPATH}":"$f
|
||||
done
|
||||
|
||||
MAIN_CLASS=cn.edu.thu.tsfiledb.service.JMXManager
|
||||
|
||||
pid="$TSFILE_HOME"/tmp/tsfiledb.pid
|
||||
|
||||
case "$1" in
|
||||
|
||||
start)
|
||||
if [ -f ${pid} ]; then
|
||||
TARGET_ID="$(cat "$pid")"
|
||||
PIDS=`ps -ef |grep "$TARGET_ID" |grep -v grep | awk '{print $2}'`
|
||||
if [ "$PIDS" != "" ]; then
|
||||
echo "delta is already running as process "$TARGET_ID". Stop it first."
|
||||
else
|
||||
echo "starting delta"
|
||||
rm -rf ${pid}
|
||||
"$JAVA" -DTSFILE_HOME=${TSFILE_HOME} -Dlogback.configurationFile=${TSFILE_CONF}/logback.xml -cp "$CLASSPATH" "$MAIN_CLASS"
|
||||
echo $! > ${pid}
|
||||
fi
|
||||
else
|
||||
echo "starting delta"
|
||||
rm -rf ${pid}
|
||||
"$JAVA" -DTSFILE_HOME=${TSFILE_HOME} -Dlogback.configurationFile=${TSFILE_CONF}/logback.xml -cp "$CLASSPATH" "$MAIN_CLASS"
|
||||
echo $! > ${pid}
|
||||
fi
|
||||
;;
|
||||
|
||||
stop)
|
||||
if [ -f ${pid} ]; then
|
||||
TARGET_ID="$(cat "$pid")"
|
||||
PIDS=`ps -ef |grep "$TARGET_ID" |grep -v grep | awk '{print $2}'`
|
||||
if [ "$PIDS" != "" ]; then
|
||||
echo "stopping delta"
|
||||
kill `cat $pid`
|
||||
rm -rf ${pid}
|
||||
else
|
||||
echo "no delta to stop"
|
||||
rm -rf ${pid}
|
||||
fi
|
||||
else
|
||||
echo "no delta to stop"
|
||||
fi
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Usage: run.sh {start|stop}"
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
exit 0
|
|
@ -0,0 +1,149 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
说明:
|
||||
1、日志级别及文件
|
||||
日志记录采用分级记录,级别与日志文件名相对应,不同级别的日志信息记录到不同的日志文件中
|
||||
例如:error级别记录到log_error_xxx.log或log_error.log(该文件为当前记录的日志文件),而log_error_xxx.log为归档日志,
|
||||
日志文件按日期记录,同一天内,若日志文件大小等于或大于2M,则按0、1、2...顺序分别命名
|
||||
例如log-level-2013-12-21.0.log
|
||||
其它级别的日志也是如此。
|
||||
2、文件路径
|
||||
若开发、测试用,在Eclipse中运行项目,则到Eclipse的安装路径查找logs文件夹,以相对路径../logs。
|
||||
若部署到Tomcat下,则在Tomcat下的logs文件中
|
||||
3、Appender
|
||||
FILEERROR对应error级别,文件名以log-error-xxx.log形式命名
|
||||
FILEWARN对应warn级别,文件名以log-warn-xxx.log形式命名
|
||||
FILEINFO对应info级别,文件名以log-info-xxx.log形式命名
|
||||
FILEDEBUG对应debug级别,文件名以log-debug-xxx.log形式命名
|
||||
stdout将日志信息输出到控制上,为方便开发测试使用
|
||||
-->
|
||||
<configuration>
|
||||
|
||||
<!-- 日志记录器,日期滚动记录 -->
|
||||
<appender name="FILEERROR" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<!-- 正在记录的日志文件的路径及文件名 -->
|
||||
<file>${TSFILE_HOME}/logs/log_error.log</file>
|
||||
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 归档的日志文件的路径,例如今天是2013-12-21日志,当前写的日志文件路径为file节点指定,可以将此文件与file指定文件路径设置为不同路径,从而将当前日志文件或归档日志文件置不同的目录。
|
||||
而2013-12-21的日志文件在由fileNamePattern指定。%d{yyyy-MM-dd}指定日期格式,%i指定索引 -->
|
||||
<fileNamePattern>${TSFILE_HOME}/log-error-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
|
||||
<!-- 除按日志记录之外,还配置了日志文件不能超过2M,若超过2M,日志文件会以索引0开始,
|
||||
命名日志文件,例如log-error-2013-12-21.0.log -->
|
||||
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
|
||||
<maxFileSize>2MB</maxFileSize>
|
||||
</timeBasedFileNamingAndTriggeringPolicy>
|
||||
</rollingPolicy>
|
||||
<!-- 追加方式记录日志 -->
|
||||
<append>true</append>
|
||||
<!-- 日志文件的格式 -->
|
||||
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
|
||||
<pattern>%-5p [%d] %C:%L - %m %n</pattern>
|
||||
<charset>utf-8</charset>
|
||||
</encoder>
|
||||
<!-- 此日志文件只记录error级别的 -->
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<level>error</level>
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<appender name="FILEWARN" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${TSFILE_HOME}/logs/log_warn.log</file>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<fileNamePattern>${TSFILE_HOME}/log-warn-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
|
||||
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
|
||||
<maxFileSize>2MB</maxFileSize>
|
||||
</timeBasedFileNamingAndTriggeringPolicy>
|
||||
</rollingPolicy>
|
||||
<append>true</append>
|
||||
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
|
||||
<pattern>%-5p [%d] %C:%L - %m %n</pattern>
|
||||
<charset>utf-8</charset>
|
||||
</encoder>
|
||||
<!-- 此日志文件只记录warn级别,不记录大于warn级别的日志 -->
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<level>WARN</level>
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<appender name="FILEINFO" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${TSFILE_HOME}/logs/log_info.log</file>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<fileNamePattern>${TSFILE_HOME}/log-info-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
|
||||
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
|
||||
<maxFileSize>200MB</maxFileSize>
|
||||
</timeBasedFileNamingAndTriggeringPolicy>
|
||||
</rollingPolicy>
|
||||
<append>true</append>
|
||||
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
|
||||
<pattern>%-5p [%d] [%t] %C:%L - %m %n</pattern>
|
||||
<charset>utf-8</charset>
|
||||
</encoder>
|
||||
<!-- 此日志文件只记录info级别,不记录大于info级别的日志 -->
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<level>INFO</level>
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
|
||||
<appender name="FILEDEBUG" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${TSFILE_HOME}/logs/log_debug.log</file>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<fileNamePattern>${TSFILE_HOME}/log-debug-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
|
||||
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
|
||||
<maxFileSize>200MB</maxFileSize>
|
||||
</timeBasedFileNamingAndTriggeringPolicy>
|
||||
</rollingPolicy>
|
||||
<append>true</append>
|
||||
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
|
||||
<pattern>%-5p [%d] [%t] %C:%L - %m %n</pattern>
|
||||
<charset>utf-8</charset>
|
||||
</encoder>
|
||||
<!-- 此日志文件只记录debug级别,不记录大于debug级别的日志 -->
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<level>DEBUG</level>
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<appender name="stdout" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<Target>System.out</Target>
|
||||
<encoder>
|
||||
<pattern>%-5p [%d] [%thread] %C:%L - %m %n</pattern>
|
||||
<charset>utf-8</charset>
|
||||
</encoder>
|
||||
<!-- 此日志appender是为开发使用,只配置最底级别,控制台输出的日志级别是大于或等于此级别的日志信息-->
|
||||
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
|
||||
<level>DEBUG</level>
|
||||
</filter>
|
||||
<!-- <filter class="ch.qos.logback.classic.filter.LevelFilter"> -->
|
||||
<!-- <level>DEBUG</level> -->
|
||||
<!-- <onMatch>ACCEPT</onMatch> -->
|
||||
<!-- <onMismatch>DENY</onMismatch> -->
|
||||
<!-- </filter> -->
|
||||
</appender>
|
||||
|
||||
<!-- <logger name="com.corp.tsfile.bufferwrite" level="debug"/> -->
|
||||
|
||||
<!-- 为单独的包配置日志级别,若root的级别大于此级别, 此处级别也会输出
|
||||
应用场景:生产环境一般不会将日志级别设置为trace或debug,但是为详细的记录SQL语句的情况,
|
||||
可将hibernate的级别设置为debug,如此一来,日志文件中就会出现hibernate的debug级别日志,
|
||||
而其它包则会按root的级别输出日志
|
||||
-->
|
||||
<!-- 生产环境,将此级别配置为适合的级别,以名日志文件太多或影响程序性能 -->
|
||||
<root level="ERROR">
|
||||
<appender-ref ref="FILEDEBUG" />
|
||||
<appender-ref ref="FILEINFO" />
|
||||
<appender-ref ref="FILEWARN" />
|
||||
<appender-ref ref="FILEERROR" />
|
||||
<!-- 生产环境将请stdout去掉 -->
|
||||
<appender-ref ref="stdout" />
|
||||
</root>
|
||||
</configuration>
|
|
@ -0,0 +1,3 @@
|
|||
#!/bin/sh
|
||||
|
||||
#export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home
|
|
@ -0,0 +1 @@
|
|||
|
Loading…
Reference in New Issue