Comments (4)
druid 配置信息
spring:
#druid数据源连接池
datasource:
druid:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/api-boot-admin?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8
username: root
password: root
type: com.alibaba.druid.pool.DruidDataSource #明确指明使用druid
initialSize: 5
minIdle: 5
maxActive: 20
maxWait: 60000
timeBetweenEvictionRunsMillis: 60000
minEvictableIdleTimeMillis: 300000
validationQuery: SELECT 1 FROM DUAL
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
poolPreparedStatements: true
# 配置监控统计拦截的filters,stat:监控统计、Log4j:日志记录、wall:防御sql注入
# filters: stat,wall,log4j
maxPoolPreparedStatementPerConnectionSize: 20
useGlobalDataSourceStat: true
connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=500
# 通过 connection-properties 属性打开 mergeSql 功能;慢 SQL 记录
filter:
wall:
enabled: true
stat:
enabled: true
log-slow-sql: true
slow-sql-millis: 10000
merge-sql: true
# 配置 DruidStatFilter
web-stat-filter:
enabled: true
url-pattern: /*
session-stat-enable: true
profile-enable: true
exclusions: '*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*'
# 配置 DruidStatViewServlet
stat-view-servlet:
enabled: true
# IP 白名单,没有配置或者为空,则允许所有访问
allow:
# IP 黑名单,若白名单也存在,则优先使用
deny:
# 禁用 HTML 中 Reset All 按钮
reset-enable: false
# 登录用户名/密码
login-username: root
login-password: 123
aop-patterns: com.druid.*
from api-boot.
@randeexiong 是不是配置用户名密码的方式不太对,如果没有引入security依赖,apiboot不会限制登录路径,而且那个登录地址也是druid提供的
from api-boot.
同样的配置,用 druid-spring-boot-starter
和 spring-boot-starter-web
是可以正常进入druid的监控界面的
from api-boot.
可以访问http://localhost:8080/druid/index.html
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.minbox.framework</groupId>
<artifactId>api-boot-starter-mybatis-enhance</artifactId>
</dependency>
<dependency>
<groupId>org.minbox.framework</groupId>
<artifactId>api-boot-starter-ssh-agent</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
<version>1.2.11</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.minbox.framework</groupId>
<artifactId>api-boot-dependencies</artifactId>
<version>2.3.8</version>
<scope>import</scope>
<type>pom</type>
</dependency>
</dependencies>
</dependencyManagement>
spring:
datasource:
url: jdbc:mariadb://127.0.0.1/metadata?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&allowPublicKeyRetrieval=true
username: developer
password: iamadeveloper
driver-class-name: com.mysql.cj.jdbc.Driver
type: com.alibaba.druid.pool.DruidDataSource
druid:
filter:
wall:
enabled: true
stat:
enabled: true
log-slow-sql: true
slow-sql-millis: 10000
merge-sql: true
# 配置 DruidStatFilter
web-stat-filter:
enabled: true
url-pattern: /*
session-stat-enable: true
profile-enable: true
exclusions: '*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*'
# 配置 DruidStatViewServlet
stat-view-servlet:
enabled: true
# IP 白名单,没有配置或者为空,则允许所有访问
allow:
# IP 黑名单,若白名单也存在,则优先使用
deny:
# 禁用 HTML 中 Reset All 按钮
reset-enable: false
# 登录用户名/密码
login-username: root
login-password: 123
from api-boot.
Related Issues (20)
- 集成 "message-pipe" 分布式顺序消费管道框架
- 添加LoggingFactoryBeanCustomizers类来集合注入LoggingFactoryBeanCustomizer实例 HOT 1
- 升级Message Pipe版本为v1.0.1 HOT 1
- 修改Banner显示样式,新增输出官网以及博客地址
- 升级message pipe消息管道版本为 v1.0.2.RELESE
- 新增MessagePipeConfiguration配置类的自定义Customizer接口 HOT 1
- apiboot 从2.2.7.RELEASE升级到2.3.0RELEASE版本报错 HOT 1
- api-boot升级2.3.1版本报错 HOT 17
- 集成ssh-agent代理组件 HOT 1
- 自定义Oauth2认证失败响应格式 HOT 1
- refresh_token获取token报Handling error: InvalidGrantException, Invalid refresh token HOT 1
- 已经在ignoring-urls 添加了不需要授权的链接,但访问时候还是提示未授权错误 HOT 1
- 启动报循环依赖错误 HOT 7
- api-boot-starter-logging 导致druid 监控界面无法登陆,提示用户名密码错误 HOT 8
- > 你可以看下我的博客:https://blog.minbox.org/
- 请求指导, api-boot-starter-mybatis-enhance启动报错,执行重载SqlSource失败 HOT 3
- ApiBoot Mybatis Enhance 影响原生mybatis使用??我试着使用xml文件自定义sql的方式,报错Invalid bound statement (not found) HOT 6
- Dependency org.apache.httpcomponents:httpclient, leading to CVE problem
- 支持统一接入飞书、钉钉、企业微信群消息webhook,以及个人工作通知项目发送,OA流程接入等api HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from api-boot.