diff --git a/README.md b/README.md index a9fa986..06d22a9 100644 --- a/README.md +++ b/README.md @@ -81,23 +81,12 @@ ![image](doc/pic/cloud-framework.png) -# 常见问题 +# 常见问题 + +- 找不到带Q开头的类 - lombok 安装 - * 下载lombok.jar包 https://projectlombok.org/download.html - * 在eclipse.ini 配置文件最后添加:-javaagent:F:\xxx\lombok.jar 注:F:\xxx 为lombok.jar 放置的目录地址 - * 重启eclipse - - 项目导入工程遇到 maven 插件问题 -~~~ -You need to run build with JDK or have tools.jar on the classpath. If this occurs during eclipse build make sure you run eclipse under JDK as well (com.mysema.maven:apt-maven-plugin:1.1.3:process:default:generate-sources - -解决:在eclipse.ini 配置文件添加 --vm -{path_to_jdk}\jdk{your_version}\bin\javaw.exe -~~~ -- idea 安装 - * 查看地址[guide](http://blog.csdn.net/zhglance/article/details/54931430) - * idea 导入工程方法建议参考[guide](http://blog.csdn.net/sinat_36246371/article/details/52914448) +- 上述问题解决[guide](https://github.com/liuweijw/fw-cloud-framework/wiki/09-%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98%E8%A7%A3%E5%86%B3) # 服务相关图片 - eureka服务注册 [点击访问,用户名:admin 密码:liuweijw](http://47.106.144.24:1001/) @@ -115,3 +104,8 @@ You need to run build with JDK or have tools.jar on the classpath. If this occur ![image](doc/pic/1005.png) ![image](doc/pic/1006.png) ![image](doc/pic/1007.png) + +- zipkin db服务状态监控 [点击访问](http://47.106.144.24:1011/) + +![image](doc/pic/1008.png) +![image](doc/pic/1009.png) diff --git a/doc/pic/1008.png b/doc/pic/1008.png new file mode 100644 index 0000000..bec3315 Binary files /dev/null and b/doc/pic/1008.png differ diff --git a/doc/pic/1009.png b/doc/pic/1009.png new file mode 100644 index 0000000..206d046 Binary files /dev/null and b/doc/pic/1009.png differ diff --git a/fw-cloud-monitor/fw-cloud-monitor-zipkin-db/.gitignore b/fw-cloud-monitor/fw-cloud-monitor-zipkin-db/.gitignore new file mode 100644 index 0000000..b83d222 --- /dev/null +++ b/fw-cloud-monitor/fw-cloud-monitor-zipkin-db/.gitignore @@ -0,0 +1 @@ +/target/ diff --git a/fw-cloud-monitor/fw-cloud-monitor-zipkin-db/pom.xml b/fw-cloud-monitor/fw-cloud-monitor-zipkin-db/pom.xml new file mode 100644 index 0000000..23cf9ac --- /dev/null +++ b/fw-cloud-monitor/fw-cloud-monitor-zipkin-db/pom.xml @@ -0,0 +1,76 @@ + + 4.0.0 + + fw-cloud-monitor-zipkin-db + jar + + fw-cloud-monitor-zipkin-db + 系统zipkin database监控 + + + com.github.liuweijw + fw-cloud-monitor + ${fw.monitor.version} + + + + + com.github.liuweijw + fw-cloud-core-commons + ${fw.core.version} + + + io.zipkin.java + zipkin-server + + + io.zipkin.java + zipkin-autoconfigure-ui + + + + + io.zipkin.java + zipkin-autoconfigure-collector-rabbitmq + ${zipkin-autoconfigure.version} + + + + io.zipkin.java + zipkin-autoconfigure-storage-mysql + + + mysql + mysql-connector-java + + + org.springframework.boot + spring-boot-starter-jdbc + + + org.apache.tomcat + tomcat-jdbc + + + + + + com.zaxxer + HikariCP + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + ${project.name} + + + + + + diff --git a/fw-cloud-monitor/fw-cloud-monitor-zipkin-db/pom_jar.xml b/fw-cloud-monitor/fw-cloud-monitor-zipkin-db/pom_jar.xml new file mode 100644 index 0000000..23cf9ac --- /dev/null +++ b/fw-cloud-monitor/fw-cloud-monitor-zipkin-db/pom_jar.xml @@ -0,0 +1,76 @@ + + 4.0.0 + + fw-cloud-monitor-zipkin-db + jar + + fw-cloud-monitor-zipkin-db + 系统zipkin database监控 + + + com.github.liuweijw + fw-cloud-monitor + ${fw.monitor.version} + + + + + com.github.liuweijw + fw-cloud-core-commons + ${fw.core.version} + + + io.zipkin.java + zipkin-server + + + io.zipkin.java + zipkin-autoconfigure-ui + + + + + io.zipkin.java + zipkin-autoconfigure-collector-rabbitmq + ${zipkin-autoconfigure.version} + + + + io.zipkin.java + zipkin-autoconfigure-storage-mysql + + + mysql + mysql-connector-java + + + org.springframework.boot + spring-boot-starter-jdbc + + + org.apache.tomcat + tomcat-jdbc + + + + + + com.zaxxer + HikariCP + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + ${project.name} + + + + + + diff --git a/fw-cloud-monitor/fw-cloud-monitor-zipkin-db/pom_war.xml b/fw-cloud-monitor/fw-cloud-monitor-zipkin-db/pom_war.xml new file mode 100644 index 0000000..fe216b9 --- /dev/null +++ b/fw-cloud-monitor/fw-cloud-monitor-zipkin-db/pom_war.xml @@ -0,0 +1,74 @@ + + 4.0.0 + + fw-cloud-monitor-zipkin-db + war + + fw-cloud-monitor-zipkin-db + 系统zipkin database监控 + + + com.github.liuweijw + fw-cloud-monitor + ${fw.monitor.version} + + + + + com.github.liuweijw + fw-cloud-core-commons + ${fw.core.version} + + + io.zipkin.java + zipkin-server + + + io.zipkin.java + zipkin-autoconfigure-ui + + + + io.zipkin.java + zipkin-autoconfigure-collector-rabbitmq + ${zipkin-autoconfigure.version} + + + + io.zipkin.java + zipkin-autoconfigure-storage-mysql + + + mysql + mysql-connector-java + + + org.springframework.boot + spring-boot-starter-jdbc + + + org.apache.tomcat + tomcat-jdbc + + + + + + com.zaxxer + HikariCP + + + + + + ZIPKINDB + + + org.springframework.boot + spring-boot-maven-plugin + + + + + diff --git a/fw-cloud-monitor/fw-cloud-monitor-zipkin-db/src/main/java/com/github/liuweijw/monitor/zipkindb/FwMonitorZipkenDbApplication.java b/fw-cloud-monitor/fw-cloud-monitor-zipkin-db/src/main/java/com/github/liuweijw/monitor/zipkindb/FwMonitorZipkenDbApplication.java new file mode 100644 index 0000000..324f042 --- /dev/null +++ b/fw-cloud-monitor/fw-cloud-monitor-zipkin-db/src/main/java/com/github/liuweijw/monitor/zipkindb/FwMonitorZipkenDbApplication.java @@ -0,0 +1,25 @@ +package com.github.liuweijw.monitor.zipkindb; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.builder.SpringApplicationBuilder; +import org.springframework.boot.web.support.SpringBootServletInitializer; +import org.springframework.cloud.client.discovery.EnableDiscoveryClient; + +import zipkin.server.EnableZipkinServer; + +@EnableDiscoveryClient +@SpringBootApplication +@EnableZipkinServer +public class FwMonitorZipkenDbApplication extends SpringBootServletInitializer { + + @Override + protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { + return application.sources(FwMonitorZipkenDbApplication.class); + } + + public static void main(String[] args) { + SpringApplication.run(FwMonitorZipkenDbApplication.class, args); + } + +} diff --git a/fw-cloud-monitor/fw-cloud-monitor-zipkin-db/src/main/resources/bootstrap.yml b/fw-cloud-monitor/fw-cloud-monitor-zipkin-db/src/main/resources/bootstrap.yml new file mode 100644 index 0000000..e50efa0 --- /dev/null +++ b/fw-cloud-monitor/fw-cloud-monitor-zipkin-db/src/main/resources/bootstrap.yml @@ -0,0 +1,43 @@ +spring: + application: + name: monitor-zipkindb-server + profiles: + active: dev + cloud: + config: + fail-fast: true + discovery: + service-id: system-config-server + enabled: true + profile: ${spring.profiles.active} + label: ${spring.profiles.active} +--- +spring: + profiles: dev +eureka: + instance: + prefer-ip-address: true + lease-renewal-interval-in-seconds: 5 + lease-expiration-duration-in-seconds: 10 + client: + registry-fetch-interval-seconds: 10 # 默认为30秒 表示eureka client间隔多久去拉取服务注册信息,默认为30秒,对于api-gateway,如果要迅速获取服务注册状态,可以缩小该值,比如5秒 + serviceUrl: + defaultZone: http://admin:liuweijw@localhost:1001/eureka +--- +spring: + profiles: untest +eureka: + instance: + prefer-ip-address: true + client: + serviceUrl: + defaultZone: http://admin:liuweijw@47.106.144.24:1001/eureka +--- +spring: + profiles: prod +eureka: + instance: + prefer-ip-address: true + client: + serviceUrl: + defaultZone: http://admin:liuweijw@localhost:1001/eureka diff --git a/fw-cloud-monitor/pom.xml b/fw-cloud-monitor/pom.xml index eb4358a..ad3c82e 100644 --- a/fw-cloud-monitor/pom.xml +++ b/fw-cloud-monitor/pom.xml @@ -22,8 +22,8 @@ fw-cloud-monitor-monitor - + + fw-cloud-monitor-zipkin-db diff --git a/fw-cloud-system/fw-cloud-system-config/src/main/resources/shared/monitor-zipkindb-server-dev.yml b/fw-cloud-system/fw-cloud-system-config/src/main/resources/shared/monitor-zipkindb-server-dev.yml new file mode 100644 index 0000000..3f7947e --- /dev/null +++ b/fw-cloud-system/fw-cloud-system-config/src/main/resources/shared/monitor-zipkindb-server-dev.yml @@ -0,0 +1,19 @@ +server: + port: 1011 + +spring: + datasource: + driver-class-name: com.mysql.jdbc.Driver + username: ENC(rC/X/8UBBH2bn9Tgfuu7aw==) + password: ENC(IVTzs5LDfVEsblAFWFgA9w==) + url: jdbc:mysql://localhost:3306/fw-cloud?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false + +zipkin: + collector: + rabbitmq: + addresses: 127.0.0.1:5672 + password: guest + username: guest + queue: zipkin + storage: + type: mysql