-
Notifications
You must be signed in to change notification settings - Fork 399
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
111 changed files
with
1,827 additions
and
362 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,4 +22,3 @@ disconf/ | |
.DS_Store | ||
/.DS_Store | ||
/out/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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,所以该项目无需部署,只需要打包。 | ||
|
@@ -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 | ||
``` | ||
|
@@ -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 | ||
|
@@ -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等): | ||
|
@@ -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> | ||
|
@@ -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等): | ||
|
@@ -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" | ||
``` | ||
### 配置 | ||
|
@@ -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> | ||
``` | ||
|
@@ -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' | ||
} | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# 项目介绍 | ||
rancher容器部署的agent,提供宿主机的host给对接app的容器使用,改项目只需在每个机器上启动下然后停止(网络模式需要是host) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/\\*") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
rootProject.name = 'skyeye-agent' |
Oops, something went wrong.