فهرست منبع

配置监控的服务

gaodm 6 سال پیش
والد
کامیت
1ea47ef059
39فایلهای تغییر یافته به همراه533 افزوده شده و 10 حذف شده
  1. 25 0
      admin-service/.gitignore
  2. 78 0
      admin-service/pom.xml
  3. 103 0
      admin-service/src/main/java/com/diagbot/AdminServiceApplication.java
  4. 16 0
      admin-service/src/main/resources/bootstrap.yml
  5. 5 0
      admin-service/src/main/resources/logback-spring.xml
  6. 16 0
      admin-service/src/test/java/com/diagbot/AdminServiceApplicationTests.java
  7. 1 1
      bi-service/src/main/java/com/diagbot/config/ResourceServerConfiguration.java
  8. 5 0
      bi-service/src/main/resources/logback-spring.xml
  9. 33 0
      config-server/src/main/resources/shared/admin-service-dev.yml
  10. 33 0
      config-server/src/main/resources/shared/admin-service-pro.yml
  11. 11 1
      config-server/src/main/resources/shared/application.yml
  12. 1 0
      config-server/src/main/resources/shared/bi-service-dev.yml
  13. 1 0
      config-server/src/main/resources/shared/diagbotman-service-dev.yml
  14. 1 0
      config-server/src/main/resources/shared/feedback-service-dev.yml
  15. 3 0
      config-server/src/main/resources/shared/gateway-service-dev.yml
  16. 1 0
      config-server/src/main/resources/shared/knowledge-service-dev.yml
  17. 5 3
      config-server/src/main/resources/shared/logger-service-dev.yml
  18. 15 0
      config-server/src/main/resources/shared/monitor-service-dev.yml
  19. 1 0
      config-server/src/main/resources/shared/uaa-service-dev.yml
  20. 1 0
      config-server/src/main/resources/shared/user-service-dev.yml
  21. 1 1
      diagbotman-service/src/main/java/com/diagbot/config/ResourceServerConfiguration.java
  22. 5 0
      diagbotman-service/src/main/resources/logback-spring.xml
  23. 1 1
      feedback-service/src/main/java/com/diagbot/config/ResourceServerConfiguration.java
  24. 5 0
      feedback-service/src/main/resources/logback-spring.xml
  25. 5 0
      gateway-service/src/main/resources/logback-spring.xml
  26. 1 1
      knowledge-service/src/main/java/com/diagbot/config/ResourceServerConfiguration.java
  27. 5 0
      knowledge-service/src/main/resources/logback-spring.xml
  28. 1 1
      log-service/src/main/java/com/diagbot/config/ResourceServerConfiguration.java
  29. 5 0
      log-service/src/main/resources/logback-spring.xml
  30. 25 0
      monitor-service/.gitignore
  31. 61 0
      monitor-service/pom.xml
  32. 18 0
      monitor-service/src/main/java/com/diagbot/MonitorServiceApplication.java
  33. 9 0
      monitor-service/src/main/resources/bootstrap.yml
  34. 5 0
      monitor-service/src/main/resources/logback-spring.xml
  35. 16 0
      monitor-service/src/test/java/com/diagbot/MonitorServiceApplicationTests.java
  36. 8 0
      pom.xml
  37. 1 0
      uaa-service/src/main/java/com/diagbot/config/WebSecurityConfig.java
  38. 1 1
      user-service/src/main/java/com/diagbot/config/ResourceServerConfiguration.java
  39. 5 0
      user-service/src/main/resources/logback-spring.xml

+ 25 - 0
admin-service/.gitignore

@@ -0,0 +1,25 @@
+/target/
+!.mvn/wrapper/maven-wrapper.jar
+
+### STS ###
+.apt_generated
+.classpath
+.factorypath
+.project
+.settings
+.springBeans
+.sts4-cache
+
+### IntelliJ IDEA ###
+.idea
+*.iws
+*.iml
+*.ipr
+
+### NetBeans ###
+/nbproject/private/
+/build/
+/nbbuild/
+/dist/
+/nbdist/
+/.nb-gradle/

+ 78 - 0
admin-service/pom.xml

@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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>
+
+    <groupId>com.diagbot</groupId>
+    <artifactId>admin-service</artifactId>
+    <version>0.0.1-SNAPSHOT</version>
+    <packaging>jar</packaging>
+
+    <name>admin-service</name>
+    <description>Admin Service for Spring Boot</description>
+
+    <parent>
+        <groupId>com.diagbot</groupId>
+        <artifactId>diagbotcloud</artifactId>
+        <version>0.0.1-SNAPSHOT</version>
+    </parent>
+
+    <dependencies>
+        <!-- 配置-->
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-config</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-netflix-turbine</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-actuator</artifactId>
+        </dependency>
+
+        <!--hystrix-dashboard-->
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-netflix-hystrix-dashboard</artifactId>
+        </dependency>
+        <!--hystrix -->
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
+        </dependency>
+        <!--spring cloud admin server-->
+        <dependency>
+            <groupId>de.codecentric</groupId>
+            <artifactId>spring-boot-admin-starter-server</artifactId>
+            <version>2.0.2</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-security</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.jolokia</groupId>
+            <artifactId>jolokia-core</artifactId>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>

+ 103 - 0
admin-service/src/main/java/com/diagbot/AdminServiceApplication.java

@@ -0,0 +1,103 @@
+package com.diagbot;
+
+
+import de.codecentric.boot.admin.server.config.AdminServerProperties;
+import de.codecentric.boot.admin.server.config.EnableAdminServer;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.cloud.netflix.hystrix.EnableHystrix;
+import org.springframework.cloud.netflix.hystrix.dashboard.EnableHystrixDashboard;
+import org.springframework.cloud.netflix.turbine.EnableTurbine;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Profile;
+import org.springframework.security.config.annotation.web.builders.HttpSecurity;
+import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
+import org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler;
+
+/**
+ * @Description: 系统管理中心启动文件
+ * @author: gaodm
+ * @time: 2018/8/7 10:48
+ */
+@SpringBootApplication
+@EnableTurbine
+@EnableHystrixDashboard
+@EnableHystrix
+@EnableAdminServer
+@Configuration
+@EnableAutoConfiguration
+public class AdminServiceApplication {
+
+    public static void main(String[] args) {
+        SpringApplication.run(AdminServiceApplication.class, args);
+    }
+
+//    // tag::configuration-spring-security[]
+//    @Configuration
+//    public static class SecurityConfig extends WebSecurityConfigurerAdapter {
+//        @Override
+//        protected void configure(HttpSecurity http) throws Exception {
+//            // Page with login form is served as /login.html and does a POST on /login
+//            http.formLogin().loginPage("/login.html").loginProcessingUrl("/login").permitAll();
+//            // The UI does a POST on /logout on logout
+//            http.logout().logoutUrl("/logout");
+//            // The ui currently doesn't support csrf
+//            http.csrf().disable();
+//
+//            // Requests for the login page and the static assets are allowed
+//            http.authorizeRequests()
+//                    .antMatchers("/login.html", "/**/*.css", "/img/**", "/third-party/**")
+//                    .permitAll();
+//            // ... and any other request needs to be authorized
+//            http.authorizeRequests().antMatchers("/**").authenticated();
+//
+//            // Enable so that the clients can authenticate via HTTP basic for registering
+//            http.httpBasic();
+//        }
+//    }
+//
+//    @Autowired
+//    public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
+//        auth
+//                .inMemoryAuthentication()
+//                .withUser("admin").password("123456").roles("USER");
+//    }
+
+    @Profile("dev")
+    @Configuration
+    public static class SecurityPermitAllConfig extends WebSecurityConfigurerAdapter {
+        @Override
+        protected void configure(HttpSecurity http) throws Exception {
+            http.authorizeRequests().anyRequest().permitAll()
+                    .and().csrf().disable();
+        }
+    }
+
+    @Profile("pro")
+    @Configuration
+    public static class SecuritySecureConfig extends WebSecurityConfigurerAdapter {
+        private final String adminContextPath;
+
+        public SecuritySecureConfig(AdminServerProperties adminServerProperties) {
+            this.adminContextPath = adminServerProperties.getContextPath();
+        }
+
+        @Override
+        protected void configure(HttpSecurity http) throws Exception {
+            SavedRequestAwareAuthenticationSuccessHandler successHandler = new SavedRequestAwareAuthenticationSuccessHandler();
+            successHandler.setTargetUrlParameter("redirectTo");
+
+            http.authorizeRequests()
+                    .antMatchers(adminContextPath + "/assets/**").permitAll()
+                    .antMatchers(adminContextPath + "/login").permitAll()
+                    .anyRequest().authenticated()
+                    .and()
+                    .formLogin().loginPage(adminContextPath + "/login").successHandler(successHandler).and()
+                    .logout().logoutUrl(adminContextPath + "/logout").and()
+                    .httpBasic().and()
+                    .csrf().disable();
+        }
+    }
+
+}

+ 16 - 0
admin-service/src/main/resources/bootstrap.yml

@@ -0,0 +1,16 @@
+spring:
+  application:
+    name: admin-service
+  cloud:
+    config:
+      uri: http://localhost:8769
+      fail-fast: true
+  profiles:
+    active: dev
+
+
+
+
+
+
+

+ 5 - 0
admin-service/src/main/resources/logback-spring.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration>
+    <include resource="org/springframework/boot/logging/logback/base.xml"/>
+    <jmxConfigurator/>
+</configuration>

+ 16 - 0
admin-service/src/test/java/com/diagbot/AdminServiceApplicationTests.java

@@ -0,0 +1,16 @@
+package com.diagbot;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit4.SpringRunner;
+
+@RunWith(SpringRunner.class)
+@SpringBootTest
+public class AdminServiceApplicationTests {
+
+    @Test
+    public void contextLoads() {
+    }
+
+}

+ 1 - 1
bi-service/src/main/java/com/diagbot/config/ResourceServerConfiguration.java

@@ -25,7 +25,7 @@ public class ResourceServerConfiguration extends ResourceServerConfigurerAdapter
         http
                 .csrf().disable()
                 .authorizeRequests()
-                .regexMatchers(".*swagger.*",".*v2.*",".*webjars.*","/druid.*").permitAll()
+                .regexMatchers(".*swagger.*",".*v2.*",".*webjars.*","/druid.*","/actuator.*","/hystrix.*").permitAll()
                 .antMatchers("/**").authenticated();
 //        .antMatchers("/**").permitAll();
     }

+ 5 - 0
bi-service/src/main/resources/logback-spring.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration>
+    <include resource="org/springframework/boot/logging/logback/base.xml"/>
+    <jmxConfigurator/>
+</configuration>

+ 33 - 0
config-server/src/main/resources/shared/admin-service-dev.yml

@@ -0,0 +1,33 @@
+server:
+  port: 9998
+
+#spring:
+#  boot:
+#    admin:
+#      routes:
+#        endpoints: env,metrics,dump,jolokia,info,configprops,trace,logfile,refresh,flyway,liquibase,heapdump,loggers,auditevents,hystrix.stream,activiti
+#      turbine:
+#        clusters: default
+#        location: monitor-service
+
+security2:
+    user:
+      name: "admin"
+      password: "123456"
+
+
+spring:
+  profiles: dev
+#  security:
+#    user:
+#      name: ${security2.user.name}
+#      password: ${security2.user.password}
+
+eureka:
+  instance:
+    metadata-map:
+      user.name: ${security2.user.name}
+      user.password: ${security2.user.password}
+
+logging:
+  file: "logs/admin-service-dev.log"

+ 33 - 0
config-server/src/main/resources/shared/admin-service-pro.yml

@@ -0,0 +1,33 @@
+server:
+  port: 9998
+
+#spring:
+#  boot:
+#    admin:
+#      routes:
+#        endpoints: env,metrics,dump,jolokia,info,configprops,trace,logfile,refresh,flyway,liquibase,heapdump,loggers,auditevents,hystrix.stream,activiti
+#      turbine:
+#        clusters: default
+#        location: monitor-service
+
+security2:
+    user:
+      name: "admin"
+      password: "123456"
+
+
+spring:
+  profiles: pro
+  security:
+    user:
+      name: ${security2.user.name}
+      password: ${security2.user.password}
+
+eureka:
+  instance:
+    metadata-map:
+      user.name: ${security2.user.name}
+      user.password: ${security2.user.password}
+
+logging:
+  file: "logs/admin-service-pro.log"

+ 11 - 1
config-server/src/main/resources/shared/application.yml

@@ -11,7 +11,11 @@
 #            timeoutInMilliseconds: 10000
 
 eureka:
+  instance:
+    leaseRenewalIntervalInSeconds: 10
+    health-check-url-path: /actuator/health #2.0后actuator的地址发生了变化
   client:
+    registryFetchIntervalSeconds: 5
     serviceUrl:
       defaultZone: http://localhost:8761/eureka/
 
@@ -30,7 +34,13 @@ eureka:
 management:
   security:
     enabled: false
-
+  endpoints:
+    web:
+      exposure:
+        include: '*'
+  endpoint:
+      health:
+        show-details: ALWAYS
 feign:
   hystrix:
     enabled: true

+ 1 - 0
config-server/src/main/resources/shared/bi-service-dev.yml

@@ -99,3 +99,4 @@ mybatis-plus:
 #logging
 logging:
   level.com.diagbot: debug
+  file: "logs/bi-service-dev.log"

+ 1 - 0
config-server/src/main/resources/shared/diagbotman-service-dev.yml

@@ -99,3 +99,4 @@ mybatis-plus:
 #logging
 logging:
   level.com.diagbot: debug
+  file: "logs/diagbotman-service-dev.log"

+ 1 - 0
config-server/src/main/resources/shared/feedback-service-dev.yml

@@ -99,3 +99,4 @@ mybatis-plus:
 #logging
 logging:
   level.com.diagbot: debug
+  file: "logs/feedback-service-dev.log"

+ 3 - 0
config-server/src/main/resources/shared/gateway-service-dev.yml

@@ -49,3 +49,6 @@ zuul:
 server:
   port: 5000
 
+logging:
+  file: "logs/gateway-service-dev.log"
+

+ 1 - 0
config-server/src/main/resources/shared/knowledge-service-dev.yml

@@ -99,3 +99,4 @@ mybatis-plus:
 #logging
 logging:
   level.com.diagbot: debug
+  file: "logs/knowledge-service-dev.log"

+ 5 - 3
config-server/src/main/resources/shared/logger-service-dev.yml

@@ -9,6 +9,10 @@
 #      ddl-auto: update
 #    show-sql: true
 
+
+server:
+  port: 9997
+
 # 驱动配置信息
 spring:
   datasource:
@@ -96,6 +100,4 @@ mybatis-plus:
 #logging
 logging:
   level.com.diagbot: debug
-
-server:
-  port: 9997
+  file: "logs/logger-service-dev.log"

+ 15 - 0
config-server/src/main/resources/shared/monitor-service-dev.yml

@@ -0,0 +1,15 @@
+server:
+  port: 8766
+security.basic.enabled: false
+turbine:
+  aggregator:
+    clusterConfig: default
+  appConfig: user-service , logger-service
+  clusterNameExpression: new String("default")
+
+management:
+  security:
+    enabled: false
+
+logging:
+  file: "logs/monitor-service-dev.log"

+ 1 - 0
config-server/src/main/resources/shared/uaa-service-dev.yml

@@ -87,6 +87,7 @@ mybatis-plus:
 #logging
 logging:
   level.com.diagbot: debug
+  file: "logs/uaa-service-dev.log"
 
 server:
   port: 9999

+ 1 - 0
config-server/src/main/resources/shared/user-service-dev.yml

@@ -100,5 +100,6 @@ mybatis-plus:
 #logging
 logging:
   level.com.diagbot: debug
+  file: "logs/user-service-dev.log"
 
 foo: foo version 1

+ 1 - 1
diagbotman-service/src/main/java/com/diagbot/config/ResourceServerConfiguration.java

@@ -25,7 +25,7 @@ public class ResourceServerConfiguration extends ResourceServerConfigurerAdapter
         http
                 .csrf().disable()
                 .authorizeRequests()
-                .regexMatchers(".*swagger.*",".*v2.*",".*webjars.*","/druid.*").permitAll()
+                .regexMatchers(".*swagger.*",".*v2.*",".*webjars.*","/druid.*","/actuator.*","/hystrix.*").permitAll()
                 .antMatchers("/**").authenticated();
 //        .antMatchers("/**").permitAll();
     }

+ 5 - 0
diagbotman-service/src/main/resources/logback-spring.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration>
+    <include resource="org/springframework/boot/logging/logback/base.xml"/>
+    <jmxConfigurator/>
+</configuration>

+ 1 - 1
feedback-service/src/main/java/com/diagbot/config/ResourceServerConfiguration.java

@@ -25,7 +25,7 @@ public class ResourceServerConfiguration extends ResourceServerConfigurerAdapter
         http
                 .csrf().disable()
                 .authorizeRequests()
-                .regexMatchers(".*swagger.*",".*v2.*",".*webjars.*","/druid.*").permitAll()
+                .regexMatchers(".*swagger.*",".*v2.*",".*webjars.*","/druid.*","/actuator.*","/hystrix.*").permitAll()
                 .antMatchers("/**").authenticated();
 //        .antMatchers("/**").permitAll();
     }

+ 5 - 0
feedback-service/src/main/resources/logback-spring.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration>
+    <include resource="org/springframework/boot/logging/logback/base.xml"/>
+    <jmxConfigurator/>
+</configuration>

+ 5 - 0
gateway-service/src/main/resources/logback-spring.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration>
+    <include resource="org/springframework/boot/logging/logback/base.xml"/>
+    <jmxConfigurator/>
+</configuration>

+ 1 - 1
knowledge-service/src/main/java/com/diagbot/config/ResourceServerConfiguration.java

@@ -25,7 +25,7 @@ public class ResourceServerConfiguration extends ResourceServerConfigurerAdapter
         http
                 .csrf().disable()
                 .authorizeRequests()
-                .regexMatchers(".*swagger.*",".*v2.*",".*webjars.*","/druid.*").permitAll()
+                .regexMatchers(".*swagger.*",".*v2.*",".*webjars.*","/druid.*","/actuator.*","/hystrix.*").permitAll()
                 .antMatchers("/**").authenticated();
 //        .antMatchers("/**").permitAll();
     }

+ 5 - 0
knowledge-service/src/main/resources/logback-spring.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration>
+    <include resource="org/springframework/boot/logging/logback/base.xml"/>
+    <jmxConfigurator/>
+</configuration>

+ 1 - 1
log-service/src/main/java/com/diagbot/config/ResourceServerConfiguration.java

@@ -25,7 +25,7 @@ public class ResourceServerConfiguration extends ResourceServerConfigurerAdapter
         http
                 .csrf().disable()
                 .authorizeRequests()
-                .regexMatchers(".*swagger.*",".*v2.*",".*webjars.*","/druid.*").permitAll()
+                .regexMatchers(".*swagger.*",".*v2.*",".*webjars.*","/druid.*","/actuator.*","/hystrix.*").permitAll()
                 .antMatchers("/**").authenticated();
 //        .antMatchers("/**").permitAll();
     }

+ 5 - 0
log-service/src/main/resources/logback-spring.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration>
+    <include resource="org/springframework/boot/logging/logback/base.xml"/>
+    <jmxConfigurator/>
+</configuration>

+ 25 - 0
monitor-service/.gitignore

@@ -0,0 +1,25 @@
+/target/
+!.mvn/wrapper/maven-wrapper.jar
+
+### STS ###
+.apt_generated
+.classpath
+.factorypath
+.project
+.settings
+.springBeans
+.sts4-cache
+
+### IntelliJ IDEA ###
+.idea
+*.iws
+*.iml
+*.ipr
+
+### NetBeans ###
+/nbproject/private/
+/build/
+/nbbuild/
+/dist/
+/nbdist/
+/.nb-gradle/

+ 61 - 0
monitor-service/pom.xml

@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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>
+
+    <groupId>com.diagbot</groupId>
+    <artifactId>monitor-service</artifactId>
+    <version>0.0.1-SNAPSHOT</version>
+    <packaging>jar</packaging>
+
+    <name>monitor-service</name>
+    <description>Monitor Service for Spring Boot</description>
+
+    <parent>
+        <groupId>com.diagbot</groupId>
+        <artifactId>diagbotcloud</artifactId>
+        <version>0.0.1-SNAPSHOT</version>
+    </parent>
+
+    <dependencies>
+
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-config</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-netflix-turbine</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-actuator</artifactId>
+        </dependency>
+
+        <!--hystrix-dashboard-->
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-netflix-hystrix-dashboard</artifactId>
+        </dependency>
+        <!--hystrix -->
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
+        </dependency>
+
+
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>

+ 18 - 0
monitor-service/src/main/java/com/diagbot/MonitorServiceApplication.java

@@ -0,0 +1,18 @@
+package com.diagbot;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.cloud.netflix.hystrix.EnableHystrix;
+import org.springframework.cloud.netflix.hystrix.dashboard.EnableHystrixDashboard;
+import org.springframework.cloud.netflix.turbine.EnableTurbine;
+
+@SpringBootApplication
+@EnableTurbine
+@EnableHystrixDashboard
+@EnableHystrix
+public class MonitorServiceApplication {
+
+    public static void main(String[] args) {
+        SpringApplication.run(MonitorServiceApplication.class, args);
+    }
+}

+ 9 - 0
monitor-service/src/main/resources/bootstrap.yml

@@ -0,0 +1,9 @@
+spring:
+  application:
+    name: monitor-service
+  cloud:
+    config:
+      uri: http://localhost:8769
+      fail-fast: true
+  profiles:
+      active: dev

+ 5 - 0
monitor-service/src/main/resources/logback-spring.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration>
+    <include resource="org/springframework/boot/logging/logback/base.xml"/>
+    <jmxConfigurator/>
+</configuration>

+ 16 - 0
monitor-service/src/test/java/com/diagbot/MonitorServiceApplicationTests.java

@@ -0,0 +1,16 @@
+package com.diagbot;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit4.SpringRunner;
+
+@RunWith(SpringRunner.class)
+@SpringBootTest
+public class MonitorServiceApplicationTests {
+
+    @Test
+    public void contextLoads() {
+    }
+
+}

+ 8 - 0
pom.xml

@@ -21,6 +21,8 @@
         <module>feedback-service</module>
         <module>knowledge-service</module>
         <module>bi-service</module>
+        <module>monitor-service</module>
+        <module>admin-service</module>
     </modules>
 
     <parent>
@@ -90,6 +92,12 @@
                 <version>${swagger.version}</version>
             </dependency>
 
+            <dependency>
+                <groupId>de.codecentric</groupId>
+                <artifactId>spring-boot-admin-starter-client</artifactId>
+                <version>2.0.0</version>
+            </dependency>
+
             <!-- springboot整合mybatis(核心就这一个) -->
             <!-- 注意顺序,这个一定要放在最下面 -->
             <dependency>

+ 1 - 0
uaa-service/src/main/java/com/diagbot/config/WebSecurityConfig.java

@@ -48,6 +48,7 @@ class WebSecurityConfig extends WebSecurityConfigurerAdapter {
                 })
                 .and()
                 .authorizeRequests()
+                .regexMatchers("/actuator.*").permitAll()
                 .antMatchers("/**").authenticated()
             .and()
                 .httpBasic();

+ 1 - 1
user-service/src/main/java/com/diagbot/config/ResourceServerConfiguration.java

@@ -25,7 +25,7 @@ public class ResourceServerConfiguration extends ResourceServerConfigurerAdapter
         http
                 .csrf().disable()
                 .authorizeRequests()
-                .regexMatchers(".*swagger.*",".*v2.*",".*webjars.*","/user/login.*","/user/registry.*","/user/test.*","/druid.*").permitAll()
+                .regexMatchers(".*swagger.*",".*v2.*",".*webjars.*","/user/login.*","/user/registry.*","/user/test.*","/druid.*","/actuator.*","/hystrix.*").permitAll()
                 .antMatchers("/**").authenticated();
 //        .antMatchers("/**").permitAll();
     }

+ 5 - 0
user-service/src/main/resources/logback-spring.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration>
+    <include resource="org/springframework/boot/logging/logback/base.xml"/>
+    <jmxConfigurator/>
+</configuration>