<dependency>
<groupId>com.github.benfromchina</groupId>
<artifactId>druid-admin-spring-boot-starter</artifactId>
<version>1.0.0</version>
</dependency>
<!-- druid 监控底层基于 servlet ,需要 web 模块支持 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>${spring-cloud.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
<version>${spring-cloud.version}</version>
</dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
<version>${spring-cloud-alibaba.version}</version>
</dependency>
spring:
datasource:
druid:
admin:
login-username: user
login-password: 123456
applications: # 需要监控的微服务名,默认为 spring.application.name
- escloud-service-elk
- escloud-service-manager
- escloud-service-ocr
- escloud-service-user
eureka:
instance:
prefer-ip-address: true
lease-renewal-interval-in-seconds: 5
lease-expiration-duration-in-seconds: 15
client:
service-url:
defaultZone: http://192.168.22.146:7001/eureka
spring:
cloud:
nacos:
server-addr: 192.168.22.100:8848 # 单机 nacos 地址,或 nacos 集群虚拟 IP
datasource:
druid:
admin:
login-username: user
login-password: 123456
applications: # 需要监控的微服务名,默认为 spring.application.name
- escloud-service-elk
- escloud-service-manager
- escloud-service-ocr
- escloud-service-user
spring:
datasource:
druid:
filter:
stat:
enabled: true
web-stat-filter:
enabled: true
url-pattern: /*
exclusions: '*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*'
stat-view-servlet:
enabled: true
allow: '' # ''表示允许所有地址访问,默认只能本服务访问
url-pattern: /druid/*