Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
JThink committed Dec 19, 2017
2 parents d00df5d + 3fe31a2 commit 6338890
Show file tree
Hide file tree
Showing 111 changed files with 1,827 additions and 362 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,3 @@ disconf/
.DS_Store
/.DS_Store
/out/

41 changes: 21 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,16 @@
修改根目录gradle文件中的私服地址(这样才能打包deploy到自己的本地私服)
打包:gradle clean install upload -x test

## 容器部署

需要自己修改每个项目下的image下的Dockerfile文件

PS: rancher一键部署skyeye后期出教程,基本符合持续交付的场景。

```shell
sudo bash build.sh 1.3.0 master
```

## skyeye-base

本项目没有具体的业务逻辑,主要是各个模块通用的类定义,如:常量、dto、dapper相关、公用util,所以该项目无需部署,只需要打包。
Expand Down Expand Up @@ -79,12 +89,12 @@

### dubbox

由于使用dubbox,为了能够采集到dubbox里面的rpc数据,需要修改dubbox的源码,见我修改的dubbox项目:[dubbox](https://github.com/JThink/dubbox/tree/skyeye-trace-1.2.0),该项目主要实现了rpc跟踪的具体实现,需要单独打包。
由于使用dubbox,为了能够采集到dubbox里面的rpc数据,需要修改dubbox的源码,见我修改的dubbox项目:[dubbox](https://github.com/JThink/dubbox/tree/skyeye-trace-1.3.0),该项目主要实现了rpc跟踪的具体实现,需要单独打包。

```shell
git clone https://github.com/JThink/dubbox.git
cd dubbox
git checkout skyeye-trace-1.2.0
git checkout skyeye-trace-1.3.0
修改相关pom中的私服地址
mvn clean install deploy -Dmaven.test.skip=true
```
Expand Down Expand Up @@ -493,15 +503,8 @@ rabbit.request.exchange=direct.log
rabbit.request.routingKey=log.key

# monitor
monitor.es.window=*/10 * * * * ? # 监控代码执行的周期,建议不修改
monitor.es.interval=0 */1 * * * ? # 监控代码执行的周期,建议不修改
[email protected]
monitor.es.interval=10 # 采集多久之前的数据进行分析(单位:分钟),建议按需修改
monitor.es.middlewareResponseTime=1000 # 中间件操作耗时大于多少(毫秒),建议根据实际报警情况来定,防止出现报警风暴(比如大于5秒,这个值就要设置5000)
monitor.es.middlewareThreshold=0.1 # 中间件的报警阈值(耗时大于 monitor.es.middlewareResponseTime 该值的比例大于该值),该值需要按照实际运行过程的情况不断得调节,防止出现报警风暴
monitor.es.apiResponseTime=1000
monitor.es.apiThreshold=0.1
monitor.es.thirdResponseTime=1000
monitor.es.thirdThreshold=0.1

# hbase config
hbase.quorum=panda-01,panda-01,panda-03
Expand Down Expand Up @@ -532,7 +535,7 @@ nohup bin/skyeye-web &
gradle或者pom中加入skyeye-client的依赖
``` xml
compile "skyeye:skyeye-client-logback:1.2.0"
compile "skyeye:skyeye-client-logback:1.3.0"
```
### 配置
在logback.xml中加入一个kafkaAppender,并在properties中配置好相关的值,如下(rpc这个项目前支持none和dubbo,所以如果项目中有dubbo服务的配置成dubbo,没有dubbo服务的配置成none,以后会支持其他的rpc框架,如:thrift、spring cloud等):
Expand All @@ -543,7 +546,7 @@ compile "skyeye:skyeye-client-logback:1.2.0"
<appender name="kafkaAppender" class="com.jthink.skyeye.client.logback.appender.KafkaAppender">
<encoder class="com.jthink.skyeye.client.logback.encoder.KafkaLayoutEncoder">
<layout class="ch.qos.logback.classic.PatternLayout">
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS};${CONTEXT_NAME};${HOSTNAME};%thread;%-5level;%logger{96};%line;%msg%n</pattern>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS};${CONTEXT_NAME};HOSTNAME;%thread;%-5level;%logger{96};%line;%msg%n</pattern>
</layout>
</encoder>
<topic>app-log</topic>
Expand All @@ -556,15 +559,14 @@ compile "skyeye:skyeye-client-logback:1.2.0"
<config>acks=0</config>
<config>linger.ms=100</config>
<config>max.block.ms=5000</config>
<config>client.id=${CONTEXT_NAME}-${HOSTNAME}-logback</config>
</appender>
```
## log4j
### 依赖
gradle或者pom中加入skyeye-client的依赖
``` xml
compile "skyeye:skyeye-client-log4j:1.2.0"
compile "skyeye:skyeye-client-log4j:1.3.0"
```
### 配置
在log4j.xml中加入一个kafkaAppender,并在properties中配置好相关的值,如下(rpc这个项目前支持none和dubbo,所以如果项目中有dubbo服务的配置成dubbo,没有dubbo服务的配置成none,以后会支持其他的rpc框架,如:thrift、spring cloud等):
Expand Down Expand Up @@ -593,7 +595,7 @@ compile "skyeye:skyeye-client-log4j:1.2.0"
gradle或者pom中加入skyeye-client的依赖
``` xml
compile "skyeye:skyeye-client-log4j2:1.2.0"
compile "skyeye:skyeye-client-log4j2:1.3.0"
```
### 配置
Expand All @@ -602,13 +604,12 @@ compile "skyeye:skyeye-client-log4j2:1.2.0"
```xml
<KafkaCustomize name="KafkaCustomize" topic="app-log" zkServers="riot01.jthink.com:2181,riot02.jthink.com:2181,riot03.jthink.com:2181"
mail="[email protected]" rpc="none" app="${APP_NAME}" host="${hostName}">
mail="[email protected]" rpc="none" app="${APP_NAME}">
<ThresholdFilter level="info" onMatch="ACCEPT" onMismatch="DENY"/>
<PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS};${APP_NAME};${hostName};%t;%-5level;%logger{96};%line;%msg%n"/>
<PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS};${APP_NAME};HOSTNAME;%t;%-5level;%logger{96};%line;%msg%n"/>
<Property name="bootstrap.servers">riot01.jthink.com:9092,riot02.jthink.com:9092,riot03.jthink.com:9092</Property>
<Property name="acks">0</Property>
<Property name="linger.ms">100</Property>
<Property name="client.id">${APP_NAME}-${hostName}-log4j2</Property>
</KafkaCustomize>
```
Expand All @@ -620,11 +621,11 @@ compile "skyeye:skyeye-client-log4j2:1.2.0"
### log4j
由于log4j本身的appender比较复杂难写,所以在稳定性和性能上没有logback支持得好,应用能使用logback请尽量使用logback
### rpc trace
使用自己打包的dubbox([dubbox](https://github.com/JThink/dubbox/tree/skyeye-trace-1.2.0)),在soa中间件dubbox中封装了rpc的跟踪
使用自己打包的dubbox([dubbox](https://github.com/JThink/dubbox/tree/skyeye-trace-1.3.0)),在soa中间件dubbox中封装了rpc的跟踪
``` shell
compile "com.101tec:zkclient:0.10"
compile ("com.alibaba:dubbo:2.8.4-skyeye-trace-1.2.0") {
compile ("com.alibaba:dubbo:2.8.4-skyeye-trace-1.3.0") {
exclude group: 'org.springframework', module: 'spring'
}
```
Expand Down
10 changes: 5 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ allprojects {
apply plugin: 'eclipse'

group = 'skyeye'
version = '1.2.2'

sourceCompatibility = 1.8
version = '1.3.0'

targetCompatibility = 1.8
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
buildDir = 'target'
Expand Down Expand Up @@ -36,7 +35,8 @@ subprojects {
zkclientVersion = '0.10'
slf4jVersion = '1.7.25'
fastJsonVersion = '1.2.40'
dubboVersion = '2.8.4-skyeye-trace-1.2.1'
dubboVersion = '2.5.8'
dubboxVersion = '2.8.4-skyeye-trace-1.3.0'
springBootVersion = '1.5.6.RELEASE'
springVersion = '4.3.10.RELEASE'
hbaseVersion = '1.0.0-cdh5.4.4'
Expand All @@ -49,7 +49,7 @@ subprojects {
springBootVersion = '1.5.6.RELEASE'
gradlePluginVersion = '1.0.3.RELEASE'
esVersion = '2.3.3'
hadoopVersion = '2.6.0-cdh5.4.0'
hadoopVersion = '2.6.0-cdh5.4.4'
}

dependencies {
Expand Down
46 changes: 46 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/bin/bash

version=$1
branch=$2

pwd=`pwd`

echo "start build skyeye-agent"
cd $pwd/skyeye-agent/image
sudo bash build.sh $version
echo "finished build skyeye-agent"

echo "start build skyeye-alarm"
cd $pwd/skyeye-alarm/image
sudo bash build.sh $version $branch
echo "finished build skyeye-alarm"

echo "start build skyeye-monitor"
cd $pwd/skyeye-monitor/image
sudo bash build.sh $version $branch
echo "finished build skyeye-monitor"

echo "start build skyeye-web"
cd $pwd/skyeye-web/image
sudo bash build.sh $version $branch
echo "finished build skyeye-web"

echo "start build skyeye-collector-backup"
cd $pwd/skyeye-collector/skyeye-collector-backup/image
sudo bash build.sh $version $branch
echo "finished build skyeye-collector-backup"

echo "start build skyeye-collector-indexer"
cd $pwd/skyeye-collector/skyeye-collector-indexer/image
sudo bash build.sh $version $branch
echo "finished build skyeye-collector-indexer"

echo "start build skyeye-collector-metrics"
cd $pwd/skyeye-collector/skyeye-collector-metrics/image
sudo bash build.sh $version $branch
echo "finished build skyeye-collector-metrics"

echo "start build skyeye-collector-trace"
cd $pwd/skyeye-collector/skyeye-collector-trace/image
sudo bash build.sh $version $branch
echo "finished build skyeye-collector-trace"
58 changes: 58 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
version: '2'
services:
skyeye-alarm:
image: 192.168.88.73:8888/skyeye/skyeye-alarm:1.3.0
container_name: skyeye-alarm
restart: always
mem_limit: 1g
volumes:
- /home/upsmart/deploy/skyeye/logs/alarm:/home/deploy/logs
skyeye-monitor:
image: 192.168.88.73:8888/skyeye/skyeye-monitor:1.3.0
container_name: skyeye-monitor
restart: always
mem_limit: 1g
volumes:
- /home/upsmart/deploy/skyeye/logs/monitor:/home/deploy/logs
skyeye-collector-backup:
image: 192.168.88.73:8888/skyeye/skyeye-collector-backup:1.3.0
container_name: skyeye-collector-backup
scale: 3
restart: always
mem_limit: 2g
volumes:
- /home/upsmart/deploy/skyeye/logs/collector/backup:/home/deploy/logs
- /tmp/monitor-center:/tmp/monitor-center
skyeye-collector-indexer:
image: 192.168.88.73:8888/skyeye/skyeye-collector-indexer:1.3.0
container_name: skyeye-collector-indexer
scale: 3
restart: always
mem_limit: 4g
volumes:
- /home/upsmart/deploy/skyeye/logs/collector/indexer:/home/deploy/logs
skyeye-collector-metrics:
image: 192.168.88.73:8888/skyeye/skyeye-collector-metrics:1.3.0
container_name: skyeye-collector-metrics
scale: 3
restart: always
mem_limit: 2g
volumes:
- /home/upsmart/deploy/skyeye/logs/collector/metrics:/home/deploy/logs
skyeye-collector-trace:
image: 192.168.88.73:8888/skyeye/skyeye-collector-trace:1.3.0
container_name: skyeye-collector-trace
scale: 3
restart: always
mem_limit: 3g
volumes:
- /home/upsmart/deploy/skyeye/logs/collector/trace:/home/deploy/logs
skyeye-web:
image: 192.168.88.73:8888/skyeye/skyeye-web:1.3.0
container_name: skyeye-web
restart: always
mem_limit: 4g
volumes:
- /home/upsmart/deploy/skyeye/logs/web:/home/deploy/logs
ports:
- "18090:8090"
3 changes: 2 additions & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
include 'skyeye-agent'
include 'skyeye-base'
include 'skyeye-client:skyeye-client-core', 'skyeye-client:skyeye-client-log4j', 'skyeye-client:skyeye-client-logback', 'skyeye-client:skyeye-client-log4j2'
include 'skyeye-trace:skyeye-trace-core', 'skyeye-trace:skyeye-trace-sc'
include 'skyeye-data:skyeye-data-dubbox', 'skyeye-data:skyeye-data-hbase', 'skyeye-data:skyeye-data-http', 'skyeye-data:skyeye-data-jpa', 'skyeye-data:skyeye-data-rabbitmq'
include 'skyeye-data:skyeye-data-dubbo', 'skyeye-data:skyeye-data-dubbox', 'skyeye-data:skyeye-data-hbase', 'skyeye-data:skyeye-data-http', 'skyeye-data:skyeye-data-jpa', 'skyeye-data:skyeye-data-rabbitmq'
include 'skyeye-collector:skyeye-collector-core', 'skyeye-collector:skyeye-collector-backup', 'skyeye-collector:skyeye-collector-indexer', 'skyeye-collector:skyeye-collector-metrics', 'skyeye-collector:skyeye-collector-trace'
include 'skyeye-alarm'
include 'skyeye-web'
Expand Down
23 changes: 23 additions & 0 deletions skyeye-agent/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
bin/
target/
file/
logs/
gen-java/
.externalToolBuilders/
.settings/
.gradle/
.classpath
.gradletasknamecache
.buildpath
.project
.springBeans
dependency-reduced-pom.xml
*.iml
nohup.out
/tmp
/.apt_generated/
.idea/
disconf/
/target/
/build/
/out/
2 changes: 2 additions & 0 deletions skyeye-agent/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# 项目介绍
rancher容器部署的agent,提供宿主机的host给对接app的容器使用,改项目只需在每个机器上启动下然后停止(网络模式需要是host)
32 changes: 32 additions & 0 deletions skyeye-agent/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
apply plugin: 'application'

dependencies {
compile project(':skyeye-base')
}

configurations {
compile.exclude group: "log4j", module: "log4j"
compile.exclude group: "org.slf4j", module: "slf4j-log4j12"
compile.exclude group: "org.springframework", module: "spring-web"
}

mainClassName = 'com.jthink.skyeye.agent.launcher.Launcher'

buildscript {

repositories {
mavenLocal()
maven { url mavenPublicUrl }
mavenCentral()
}

dependencies {
classpath("io.spring.gradle:dependency-management-plugin:$gradlePluginVersion")
}
}

startScripts {
doLast {
unixScript.text = unixScript.text.replaceAll("lib/(.*)\n", "lib/\\*")
}
}
25 changes: 25 additions & 0 deletions skyeye-agent/image/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# build the base image: jdk
# this is the docker file, use the jdk 8u144-ubuntu16.04
# VERSION 1
# Author: leviqian

# the basic image
FROM 192.168.88.73:8888/common/jdk:8u144-ubuntu16.04

# maintainer
MAINTAINER leviqian [email protected]

# get the args
ARG version

# set env
ENV VERSION $version

# copy the file
RUN mkdir -p /home/deploy
ADD skyeye-agent-$version.tar /home/deploy
COPY run.sh /run.sh
RUN chmod +x /run.sh

# CMD to start
CMD ["/run.sh"]
7 changes: 7 additions & 0 deletions skyeye-agent/image/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

version=$1
cp ../target/distributions/*.tar .

sudo docker build --build-arg version=$version -t 192.168.88.73:8888/skyeye/skyeye-agent:$version .
sudo docker push 192.168.88.73:8888/skyeye/skyeye-agent:$version
7 changes: 7 additions & 0 deletions skyeye-agent/image/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

source /etc/profile.d/java.sh

cd /home/deploy/skyeye-agent-$VERSION
nohup bin/skyeye-agent &
tail -f /opt/jthink/jthink-config/README.md
1 change: 1 addition & 0 deletions skyeye-agent/settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rootProject.name = 'skyeye-agent'
Loading

0 comments on commit 6338890

Please sign in to comment.