当前位置:网站首页>Alibaba data source Druid visual monitoring configuration

Alibaba data source Druid visual monitoring configuration

2022-07-06 19:40:00 Wandering hunter

1、 Introduce dependent jar file gav
1-1、druid Visual monitoring service start

     <dependency>
         <groupId>com.alibaba</groupId>
         <artifactId>druid-spring-boot-starter</artifactId>
         <version>1.2.11</version>
     </dependency>

1-2、 data source druid rely on jar file gav introduce

   <dependency>
        <groupId>com.alibaba</groupId>
        <artifactId>druid</artifactId>
        <version>1.2.4</version>
        <scope>compile</scope>
    </dependency>

1-3、 Configuration file attribute configuration

spring:
  datasource:
    druid:
      web-stat-filter:
        exclusions: '*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico'
        enabled: true 
      stat-view-servlet:
        url-pattern: /druid/* # Allow implicit access addresses 
        login-username: admin # Customize druid User name of visual interface 
        login-password: ******* # Customize druid Visual interface password 
        enabled: true # Open or not druid Visual monitoring 
        allow: localhost # Allow yourself access druid( visit druid Prompt on the back page  Sorry, you are not permitted to view this page  Configuring this property can solve )
      max-active: 20
      initial-size: 5
      min-idle: 3
      max-wait: 3000
      time-between-eviction-runs-millis: 100000
      filters: stat  #druid But chemical monitoring stat: Monitoring statistics 、log4j: logging 、wall: defense sql Inject (SQL Monitoring required )
    driver-class-name: com.mysql.cj.jdbc.Driver # Connect to the database driver 
    type: com.alibaba.druid.pool.DruidDataSource # Indicate the data source type ( The default is com.zaxxer.hikari.HikariDataSource)

原网站

版权声明
本文为[Wandering hunter]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/187/202207061138560888.html